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

Unified Diff: presubmit_canned_checks.py

Issue 119421: Add CheckChangeSvnEolStyle presubmit canned check. (Closed)
Patch Set: version Created 11 years, 6 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 | presubmit_support.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: presubmit_canned_checks.py
diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py
index f31b1687a352e306dd1bd415d31e702a44c416e2..18e700698bd92c7f4427314d27fe67f859cfa74d 100755
--- a/presubmit_canned_checks.py
+++ b/presubmit_canned_checks.py
@@ -119,6 +119,16 @@ def CheckLongLines(input_api, output_api, maxlen=80, source_file_filter=None):
return []
+def CheckChangeSvnEolStyle(input_api, output_api, source_file_filter):
+ """Checks that the source files have svn:eol-style=LF."""
+ bad = filter(lambda f: f.scm == 'svn' and f.Property('svn:eol-style') != 'LF',
+ input_api.AffectedSourceFiles(source_file_filter))
+ if bad:
+ return [output_api.PresubmitError(
+ "Fix these files with svn svn:eol-style=LF", items=bad)]
+ return []
+
+
### Other checks
def CheckDoNotSubmit(input_api, output_api):
« no previous file with comments | « no previous file | presubmit_support.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698