Commit c5965bae authored by danakj@chromium.org's avatar danakj@chromium.org

Change default ReportErrorFileAndLine to use filename:lineno format.

Currently the output is:

Found line ending with white spaces in:
cc/trees/layer_tree_host_impl_unittest.cc, line 379

This format is extremely annoying because you must combine the
file and line number together by hand. A more standard format
for expressing a position in a file is filename:lineno. This
changes the format to match:

Found line ending with white spaces in:
cc/trees/layer_tree_host_impl_unittest.cc:379

R=maruel@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/22837004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@217405 0039d316-1c4b-4281-b951-d872f2087c98
parent 538283f7
......@@ -228,7 +228,7 @@ def CheckChangeHasNoCrAndHasOnlyOneEol(input_api, output_api,
def _ReportErrorFileAndLine(filename, line_num, dummy_line):
"""Default error formatter for _FindNewViolationsOfRule."""
return '%s, line %s' % (filename, line_num)
return '%s:%s' % (filename, line_num)
def _FindNewViolationsOfRule(callable_rule, input_api, source_file_filter=None,
......
......@@ -2053,7 +2053,7 @@ class CannedChecksUnittest(PresubmitTestsBase):
self.assertEquals(results1[0].__class__,
presubmit.OutputApi.PresubmitPromptWarning)
self.assertEquals(results1[0]._long_text,
'makefile.foo, line 46')
'makefile.foo:46')
def testCannedCheckLongLines(self):
check = lambda x, y, z: presubmit_canned_checks.CheckLongLines(x, y, 10, z)
......
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