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

Unified Diff: build/android/findbugs_filter/PRESUBMIT.py

Issue 11583028: Add a presubmit check to check that a certain set of Android specific files only have deletions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved the PRESUBMIT.py per suggestion Created 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/findbugs_filter/PRESUBMIT.py
diff --git a/build/android/findbugs_filter/PRESUBMIT.py b/build/android/findbugs_filter/PRESUBMIT.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69b8ff35c67c5fbdd138d2b100613dd242ee70c
--- /dev/null
+++ b/build/android/findbugs_filter/PRESUBMIT.py
@@ -0,0 +1,43 @@
+# Copyright (c) 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+_DELETIONS_ONLY_FILES = (
+ 'build/android/findbugs_filter/findbugs_known_bugs.txt',
M-A Ruel 2013/01/15 02:16:23 I thought the path was corrected to you should use
+)
+
+
+def _CheckDeletionsOnlyFiles(input_api, output_api):
+ """Check that a certain listed files only have deletions.
+ """
+ errors = []
+ for f in input_api.AffectedFiles():
+ if f.LocalPath() in _DELETIONS_ONLY_FILES:
+ if f.ChangedContents():
+ errors.append(f.LocalPath())
+ results = []
+ if errors:
+ results.append(output_api.PresubmitError(
+ 'Following files should only contain deletions.', errors))
+ return results
+
+
+def CommonChecks(input_api, output_api):
+ output = []
+ output.extend(input_api.canned_checks.RunPylint(
+ input_api,
+ output_api,
+ white_list=[r'PRESUBMIT\.py$'],
+ extra_paths_list=[]))
+
+ output.extend(_CheckDeletionsOnlyFiles(input_api, output_api))
+ return output
+
+
+def CheckChangeOnUpload(input_api, output_api):
+ return CommonChecks(input_api, output_api)
+
+
+def CheckChangeOnCommit(input_api, output_api):
+ return CommonChecks(input_api, output_api)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698