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.
[email protected]
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
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 600190a0..f861ab5 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -863,6 +863,23 @@
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 @@
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(