summaryrefslogtreecommitdiffstats
path: root/PRESUBMIT.py
diff options
context:
space:
mode:
authorjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-18 13:10:12 +0000
committerjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-18 13:10:12 +0000
commiteea609a4139029e604e41e611b02d39a13584e0a (patch)
tree90ee844e2fbce68c07c44412aeb63bf017b2dad0 /PRESUBMIT.py
parent27db38ef4c9d27c1fe27100b5e222b8ac43f54e1 (diff)
downloadchromium_src-eea609a4139029e604e41e611b02d39a13584e0a.zip
chromium_src-eea609a4139029e604e41e611b02d39a13584e0a.tar.gz
chromium_src-eea609a4139029e604e41e611b02d39a13584e0a.tar.bz2
ForTest presubmit check non-failing for CQ by making it just a message
instead of a warning on commit, since there continue to be occasional fale positives and to fix the last ones the presubmit script would need to invoke a full C++ parser. Update the warning text. BUG=none TEST=dev tested locally on a specially set-up branch with various files that tickle the presubmit test. Review URL: http://codereview.chromium.org/8586024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110690 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'PRESUBMIT.py')
-rw-r--r--PRESUBMIT.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 27f03a9..fa2f98f 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -8,6 +8,7 @@ See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built into gcl.
"""
+
_EXCLUDED_PATHS = (
r"^breakpad[\\\/].*",
r"^net/tools/spdyshark/[\\\/].*",
@@ -17,6 +18,15 @@ _EXCLUDED_PATHS = (
)
+_TEST_ONLY_WARNING = (
+ 'You might be calling functions intended only for testing from\n'
+ 'production code. It is OK to ignore this warning if you know what\n'
+ 'you are doing, as the heuristics used to detect the situation are\n'
+ 'not perfect. The commit queue will not block on this warning.\n'
+ 'Email joi@chromium.org if you have questions.')
+
+
+
def _CheckNoInterfacesInBase(input_api, output_api):
"""Checks to make sure no files in libbase.a have |@interface|."""
pattern = input_api.re.compile(r'^\s*@interface', input_api.re.MULTILINE)
@@ -87,11 +97,11 @@ def _CheckNoProductionCodeUsingTestOnlyFunctions(input_api, output_api):
line_number += 1
if problems:
- return [output_api.PresubmitPromptWarning(
- 'You might be calling functions intended only for testing from\n'
- 'production code. Please verify that the following usages are OK,\n'
- 'and email joi@chromium.org if you are seeing false positives:',
- problems)]
+ if not input_api.is_committing:
+ return [output_api.PresubmitPromptWarning(_TEST_ONLY_WARNING, problems)]
+ else:
+ # We don't warn on commit, to avoid stopping commits going through CQ.
+ return [output_api.PresubmitNotifyResult(_TEST_ONLY_WARNING, problems)]
else:
return []