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

Unified Diff: presubmit_support.py

Issue 6646040: suppress messages for PresubmitAddText results (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 9 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_support.py
diff --git a/presubmit_support.py b/presubmit_support.py
index a62948d9fafbc39fdcfdb832fe6d7b01de73cb9f..3af5edd87a54a806043687620a970f1d93652a20 100755
--- a/presubmit_support.py
+++ b/presubmit_support.py
@@ -154,12 +154,19 @@ class OutputApi(object):
"""Whether this presubmit result should result in a prompt warning."""
return False
+ def IsMessage(self):
M-A Ruel 2011/03/10 13:41:44 I'm wondering; this should have all been properti
+ """Whether this result contains anything needing to be displayed."""
+ return True
+
class PresubmitAddText(PresubmitResult):
"""Propagates a line of text back to the caller."""
def __init__(self, message, items=None, long_text=''):
super(OutputApi.PresubmitAddText, self).__init__("ADD: " + message,
items, long_text)
+ def IsMessage(self):
+ return False
+
class PresubmitError(PresubmitResult):
"""A hard presubmit error."""
def IsFatal(self):
@@ -1056,6 +1063,9 @@ def DoPresubmitChecks(change,
if items:
output_stream.write('** Presubmit %s **\n' % name)
for item in items:
+ if not item.IsMessage():
+ continue
+
# Access to a protected member XXX of a client class
# pylint: disable=W0212
if not item._Handle(output_stream, input_stream,
« 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