From 5fe0f874a03a538c455e768643e0dafc5117f4c4 Mon Sep 17 00:00:00 2001 From: "scottmg@chromium.org" Date: Fri, 29 Nov 2013 01:04:59 +0000 Subject: 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 --- PRESUBMIT.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'PRESUBMIT.py') 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( -- cgit v1.1