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

Unified Diff: PRESUBMIT.py

Issue 11448014: Add a presubmit check to prevent committing .rej/.orig patch files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address all comments Created 8 years 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 | PRESUBMIT_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PRESUBMIT.py
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 6ab44910877fbd05cbf94e12fb0af77f00cf777f..f16d273ab1d4f0e7caefc583f0e2dd3fc12dd973 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -669,6 +669,7 @@ def _CommonChecks(input_api, output_api):
results.extend(_CheckNoAuraWindowPropertyHInHeaders(input_api, output_api))
results.extend(_CheckIncludeOrder(input_api, output_api))
results.extend(_CheckForVersionControlConflicts(input_api, output_api))
+ results.extend(_CheckPatchFiles(input_api, output_api))
if any('PRESUBMIT.py' == f.LocalPath() for f in input_api.AffectedFiles()):
results.extend(input_api.canned_checks.RunUnitTestsInDirectory(
@@ -752,6 +753,16 @@ def _CheckAuthorizedAuthor(input_api, output_api):
return []
+def _CheckPatchFiles(input_api, output_api):
+ problems = [f.LocalPath() for f in input_api.AffectedFiles()
M-A Ruel 2012/12/05 19:39:22 In theory, you should put this one at +4 too on ne
enne (OOO) 2012/12/05 19:46:44 Oh? Are you suggesting to linebreak after the brac
M-A Ruel 2012/12/05 19:51:08 Actually, you are right it'd be +2, don't bother.
+ if f.LocalPath().endswith(('.orig', '.rej'))]
+ if problems:
+ return [output_api.PresubmitError(
+ "Don't commit .rej and .orig files.", problems)]
+ else:
+ return []
+
+
def CheckChangeOnUpload(input_api, output_api):
results = []
results.extend(_CommonChecks(input_api, output_api))
« no previous file with comments | « no previous file | PRESUBMIT_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698