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

Unified Diff: build/android/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 to build/android per ilevy's 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/PRESUBMIT.py
diff --git a/build/android/PRESUBMIT.py b/build/android/PRESUBMIT.py
index f412c6ba4a86fdaa948ff0dc9aee9dd64c09a18a..fceeec3eab6e7876b7b3e14c1a096b292e780c81 100644
--- a/build/android/PRESUBMIT.py
+++ b/build/android/PRESUBMIT.py
@@ -8,6 +8,26 @@ See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on the presubmit API built into gcl.
"""
+_DELETIONS_ONLY_FILES = (
+ 'build/android/findbugs_filter/findbugs_known_bugs.txt',
+)
+
+
+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 = []
@@ -24,6 +44,7 @@ def CommonChecks(input_api, output_api):
output.extend(input_api.canned_checks.RunUnitTestsInDirectory(
input_api, output_api, J('buildbot', 'tests')))
+ output.extend(_CheckDeletionsOnlyFiles(input_api, output_api))
return output
« 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