Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(795)

Unified Diff: presubmit_canned_checks.py

Issue 119284: Use more sensible behavior in presubmit checks. (Closed)
Patch Set: Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/presubmit_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: presubmit_canned_checks.py
diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py
index 09439fb8833e5dc2d70db3f1796a7fd7dd706bcd..ba8c3ed3dc8f2fe5c7a9fe735226ee9243777e9a 100755
--- a/presubmit_canned_checks.py
+++ b/presubmit_canned_checks.py
@@ -74,7 +74,7 @@ def CheckChangeHasNoTabs(input_api, output_api):
"""
for f, line_num, line in input_api.RightHandSideLines():
if '\t' in line:
- return [output_api.PresubmitError(
+ return [output_api.PresubmitPromptWarning(
"Found a tab character in %s, line %s" %
(f.LocalPath(), line_num))]
return []
@@ -103,14 +103,15 @@ def CheckLongLines(input_api, output_api, maxlen=80):
def CheckTreeIsOpen(input_api, output_api, url, closed):
"""Checks that an url's content doesn't match a regexp that would mean that
the tree is closed."""
+ assert(input_api.is_committing)
try:
connection = input_api.urllib2.urlopen(url)
status = connection.read()
connection.close()
if input_api.re.match(closed, status):
long_text = status + '\n' + url
- return [output_api.PresubmitError("The tree is closed.",
- long_text=long_text)]
+ return [output_api.PresubmitPromptWarning("The tree is closed.",
+ long_text=long_text)]
except IOError:
pass
return []
« no previous file with comments | « no previous file | tests/presubmit_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698