Index: build/android/PRESUBMIT.py |
diff --git a/build/android/PRESUBMIT.py b/build/android/PRESUBMIT.py |
index d8e5ae34bb4e1d4a53f8e67b01c262a653f369af..9d3eb58fcf0771dc765649e79daf58b61c2d465d 100644 |
--- a/build/android/PRESUBMIT.py |
+++ b/build/android/PRESUBMIT.py |
@@ -35,10 +35,57 @@ def CommonChecks(input_api, output_api): |
"""Returns a path relative to presubmit directory.""" |
return input_api.os_path.join(input_api.PresubmitLocalPath(), *dirs) |
+ # warnings: |
+ # C0301 - line length > 80 chars |
frankf
2014/02/03 18:58:51
hmm, so why are these exempt? Is it just temporary
jbudorick
2014/02/03 19:33:57
No. The exemptions are all here because the script
|
+ # 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 = { |
+ r'adb_logcat_printer\.py$' : ['W0702'], |
+ r'gyp/apk_install\.py$' : ['C0301'], |
+ r'host_heartbeat\.py$' : ['W0702'], |
+ r'install_emulator_deps\.py$' : ['C0301'], |
+ 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')])) |