Commit eea609a4 authored by joi@chromium.org's avatar joi@chromium.org

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
parent 27db38ef
...@@ -8,6 +8,7 @@ See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts ...@@ -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. for more details about the presubmit API built into gcl.
""" """
_EXCLUDED_PATHS = ( _EXCLUDED_PATHS = (
r"^breakpad[\\\/].*", r"^breakpad[\\\/].*",
r"^net/tools/spdyshark/[\\\/].*", r"^net/tools/spdyshark/[\\\/].*",
...@@ -17,6 +18,15 @@ _EXCLUDED_PATHS = ( ...@@ -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): def _CheckNoInterfacesInBase(input_api, output_api):
"""Checks to make sure no files in libbase.a have |@interface|.""" """Checks to make sure no files in libbase.a have |@interface|."""
pattern = input_api.re.compile(r'^\s*@interface', input_api.re.MULTILINE) pattern = input_api.re.compile(r'^\s*@interface', input_api.re.MULTILINE)
...@@ -87,11 +97,11 @@ def _CheckNoProductionCodeUsingTestOnlyFunctions(input_api, output_api): ...@@ -87,11 +97,11 @@ def _CheckNoProductionCodeUsingTestOnlyFunctions(input_api, output_api):
line_number += 1 line_number += 1
if problems: if problems:
return [output_api.PresubmitPromptWarning( if not input_api.is_committing:
'You might be calling functions intended only for testing from\n' return [output_api.PresubmitPromptWarning(_TEST_ONLY_WARNING, problems)]
'production code. Please verify that the following usages are OK,\n' else:
'and email joi@chromium.org if you are seeing false positives:', # We don't warn on commit, to avoid stopping commits going through CQ.
problems)] return [output_api.PresubmitNotifyResult(_TEST_ONLY_WARNING, problems)]
else: else:
return [] return []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment