summaryrefslogtreecommitdiffstats
path: root/PRESUBMIT.py
diff options
context:
space:
mode:
authorscottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-29 01:04:59 +0000
committerscottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-29 01:04:59 +0000
commit5fe0f874a03a538c455e768643e0dafc5117f4c4 (patch)
treef2e7b25e4ccb0226ed8df85f0f7d70719b45c3d7 /PRESUBMIT.py
parent73ad0e22a5257f78ed82f3716bcc449d6a062c09 (diff)
downloadchromium_src-5fe0f874a03a538c455e768643e0dafc5117f4c4.zip
chromium_src-5fe0f874a03a538c455e768643e0dafc5117f4c4.tar.gz
chromium_src-5fe0f874a03a538c455e768643e0dafc5117f4c4.tar.bz2
Add PRESUBMIT disallowing msvs_cygwin_shell
build/common.gypi now has the default set to 0, avoid using 1 or introducing more uses of manual setting to 0. Only checks the diff, not the full file, so shouldn't be annoying. R=maruel@chromium.org BUG=123026 Review URL: https://codereview.chromium.org/93543002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237855 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'PRESUBMIT.py')
-rw-r--r--PRESUBMIT.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 600190a..f861ab5 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -863,6 +863,23 @@ def _CheckSpamLogging(input_api, output_api):
return []
+def _CheckCygwinShell(input_api, output_api):
+ source_file_filter = lambda x: input_api.FilterSourceFile(
+ x, white_list=(r'.+\.(gyp|gypi)$',))
+ cygwin_shell = []
+
+ for f in input_api.AffectedSourceFiles(source_file_filter):
+ for linenum, line in f.ChangedContents():
+ if 'msvs_cygwin_shell' in line:
+ cygwin_shell.append(f.LocalPath())
+ break
+
+ if cygwin_shell:
+ return [output_api.PresubmitError(
+ 'These files should not use msvs_cygwin_shell (the default is 0):',
+ items=cygwin_shell)]
+ return []
+
def _CommonChecks(input_api, output_api):
"""Checks common to both upload and commit."""
@@ -895,6 +912,7 @@ def _CommonChecks(input_api, output_api):
output_api,
source_file_filter=lambda x: x.LocalPath().endswith('.grd')))
results.extend(_CheckSpamLogging(input_api, output_api))
+ results.extend(_CheckCygwinShell(input_api, output_api))
if any('PRESUBMIT.py' == f.LocalPath() for f in input_api.AffectedFiles()):
results.extend(input_api.canned_checks.RunUnitTestsInDirectory(