Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1627)

Unified Diff: build/android/PRESUBMIT.py

Issue 132463007: Enable presubmit pylint in build/android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address frankf review comments. Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/android/adb_logcat_monitor.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/PRESUBMIT.py
diff --git a/build/android/PRESUBMIT.py b/build/android/PRESUBMIT.py
index d8e5ae34bb4e1d4a53f8e67b01c262a653f369af..ba31dfb3543f319604e6474dc7792e3a2f5b409a 100644
--- a/build/android/PRESUBMIT.py
+++ b/build/android/PRESUBMIT.py
@@ -35,10 +35,54 @@ def CommonChecks(input_api, output_api):
"""Returns a path relative to presubmit directory."""
return input_api.os_path.join(input_api.PresubmitLocalPath(), *dirs)
+ # warnings:
+ # E1002 - |super| on old-style class
+ # R0201 - method could be a function
+ # W0212 - protected member access
+ # W0401 - wildcard import
+ # W0614 - unused import
+ # W0702 - bare-except ("except:")
+
+ warning_exemptions = {
frankf 2014/02/03 21:16:38 is it possible to disable these in the source code
+ r'adb_logcat_printer\.py$' : ['W0702'],
+ r'host_heartbeat\.py$' : ['W0702'],
+ r'pylib/base/test_dispatcher_unittest\.py$' : ['R0201','W0212'],
+ r'pylib/chrome_test_server_spawner\.py$' : ['W0702'],
+ r'pylib/constants\.py$' : ['W0212'],
+ r'pylib/forwarder\.py$' : ['W0212'],
+ r'pylib/gtest/setup\.py$' : ['W0212'],
+ r'pylib/gtest/test_package_apk\.py$' : ['W0212'],
+ r'pylib/gtest/test_package\.py$' : ['R0201'],
+ r'pylib/host_driven/tests_annotations\.py$' : ['W0212'],
+ r'pylib/instrumentation/test_jar\.py$' : ['W0702'],
+ r'pylib/linker/test_case\.py$' : ['R0201'],
+ r'pylib/perf/surface_stats_collector_unittest\.py$' : ['W0212'],
+ r'pylib/pexpect\.py$' : ['W0401','W0614'],
+ r'pylib/utils/reraiser_thread\.py$' : ['W0212'],
+ r'pylib/utils/flakiness_dashboard_results_uploader\.py$' :
+ ['E1002','R0201'],
+ r'pylib/valgrind_tools\.py$' : ['R0201'],
+ r'pylib/utils/timeout_retry\.py$' : ['W0702'],
+ r'pylib/utils/xvfb\.py$' : ['W0702']
+ }
+
+ all_disabled_warnings = ['F0401']
+ # exempt android_commands because it's a mess and will be replaced soon.
+ all_exempted_files = [r'pylib/android_commands\.py$']
+ for filename, warnings in warning_exemptions.items():
+ output.extend(input_api.canned_checks.RunPylint(
+ input_api,
+ output_api,
+ white_list=[filename],
+ disabled_warnings=list(all_disabled_warnings) + warnings))
+ all_exempted_files.append(filename)
+
output.extend(input_api.canned_checks.RunPylint(
input_api,
output_api,
- white_list=[r'PRESUBMIT\.py$', r'buildbot/.*\.py$'],
+ white_list=[r'.*\.py$'],
+ black_list=all_exempted_files,
+ disabled_warnings=list(all_disabled_warnings),
extra_paths_list=[
J(), J('..', '..', 'third_party', 'android_testrunner'),
J('buildbot')]))
« no previous file with comments | « no previous file | build/android/adb_logcat_monitor.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698