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

Side by Side Diff: presubmit_canned_checks.py

Issue 552202: Add a trailing \ when printing filenames for presubmit checks.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/tools/depot_tools/
Patch Set: '' Created 10 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | presubmit_support.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Generic presubmit checks that can be reused by other presubmit checks.""" 6 """Generic presubmit checks that can be reused by other presubmit checks."""
7 7
8 ### Description checks 8 ### Description checks
9 9
10 def CheckChangeHasTestField(input_api, output_api): 10 def CheckChangeHasTestField(input_api, output_api):
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 """Checks that affected_files files have prop=expected.""" 302 """Checks that affected_files files have prop=expected."""
303 if input_api.change.scm != 'svn': 303 if input_api.change.scm != 'svn':
304 return [] 304 return []
305 305
306 bad = filter(lambda f: f.Property(prop) != expected, affected_files) 306 bad = filter(lambda f: f.Property(prop) != expected, affected_files)
307 if bad: 307 if bad:
308 if input_api.is_committing: 308 if input_api.is_committing:
309 res_type = output_api.PresubmitError 309 res_type = output_api.PresubmitError
310 else: 310 else:
311 res_type = output_api.PresubmitNotifyResult 311 res_type = output_api.PresubmitNotifyResult
312 message = "Run `svn pset %s %s <item>` on these files:" % (prop, expected) 312 message = "Run the command: svn pset %s %s \\" % (prop, expected)
313 return [res_type(message, items=bad)] 313 return [res_type(message, items=bad)]
314 return [] 314 return []
315 315
316 316
317 ### Other checks 317 ### Other checks
318 318
319 def CheckDoNotSubmit(input_api, output_api): 319 def CheckDoNotSubmit(input_api, output_api):
320 return ( 320 return (
321 CheckDoNotSubmitInDescription(input_api, output_api) + 321 CheckDoNotSubmitInDescription(input_api, output_api) +
322 CheckDoNotSubmitInFiles(input_api, output_api) 322 CheckDoNotSubmitInFiles(input_api, output_api)
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 stderr=input_api.subprocess.PIPE) 386 stderr=input_api.subprocess.PIPE)
387 stdoutdata, stderrdata = subproc.communicate() 387 stdoutdata, stderrdata = subproc.communicate()
388 # Discard the output if returncode == 0 388 # Discard the output if returncode == 0
389 if subproc.returncode: 389 if subproc.returncode:
390 outputs.append("Test '%s' failed with code %d\n%s\n%s\n" % ( 390 outputs.append("Test '%s' failed with code %d\n%s\n%s\n" % (
391 unit_test_name, subproc.returncode, stdoutdata, stderrdata)) 391 unit_test_name, subproc.returncode, stdoutdata, stderrdata))
392 if outputs: 392 if outputs:
393 return [message_type("%d unit tests failed." % len(outputs), 393 return [message_type("%d unit tests failed." % len(outputs),
394 long_text='\n'.join(outputs))] 394 long_text='\n'.join(outputs))]
395 return [] 395 return []
OLDNEW
« no previous file with comments | « no previous file | presubmit_support.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698