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

Side by Side Diff: presubmit_canned_checks.py

Issue 6391001: Don't prompt developers to add blank test= or bug= lines. (Closed) Base URL: svn://chrome-svn/chrome/trunk/tools/depot_tools/
Patch Set: '' Created 9 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Generic presubmit checks that can be reused by other presubmit checks.""" 5 """Generic presubmit checks that can be reused by other presubmit checks."""
6 6
7 ### Description checks 7 ### Description checks
8 8
9 def CheckChangeHasTestField(input_api, output_api): 9 def CheckChangeHasTestField(input_api, output_api):
10 """Requires that the changelist have a TEST= field.""" 10 """Requires that the changelist have a TEST= field."""
11 if input_api.change.TEST: 11 if input_api.change.TEST:
12 return [] 12 return []
13 else: 13 else:
14 return [output_api.PresubmitNotifyResult( 14 return [output_api.PresubmitNotifyResult(
15 'Changelist should have a TEST= field. TEST=none is allowed.')] 15 'If this change requires manual test instructions to QA team, add '
16 'TEST=[instructions].')]
16 17
17 18
18 def CheckChangeHasBugField(input_api, output_api): 19 def CheckChangeHasBugField(input_api, output_api):
19 """Requires that the changelist have a BUG= field.""" 20 """Requires that the changelist have a BUG= field."""
20 if input_api.change.BUG: 21 if input_api.change.BUG:
21 return [] 22 return []
22 else: 23 else:
23 return [output_api.PresubmitNotifyResult( 24 return [output_api.PresubmitNotifyResult(
24 'Changelist should have a BUG= field. BUG=none is allowed.')] 25 'If this change has an associated bug, add BUG=[bug number].')]
25 26
26 27
27 def CheckChangeHasTestedField(input_api, output_api): 28 def CheckChangeHasTestedField(input_api, output_api):
28 """Requires that the changelist have a TESTED= field.""" 29 """Requires that the changelist have a TESTED= field."""
29 if input_api.change.TESTED: 30 if input_api.change.TESTED:
30 return [] 31 return []
31 else: 32 else:
32 return [output_api.PresubmitError('Changelist must have a TESTED= field.')] 33 return [output_api.PresubmitError('Changelist must have a TESTED= field.')]
33 34
34 35
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 pending_builds_len = len(builder.get('pending_builds', [])) 605 pending_builds_len = len(builder.get('pending_builds', []))
605 if pending_builds_len > max_pendings: 606 if pending_builds_len > max_pendings:
606 out.append('%s has %d build(s) pending' % 607 out.append('%s has %d build(s) pending' %
607 (builder_name, pending_builds_len)) 608 (builder_name, pending_builds_len))
608 if out: 609 if out:
609 return [output_api.PresubmitPromptWarning( 610 return [output_api.PresubmitPromptWarning(
610 'Build(s) pending. It is suggested to wait that no more than %d ' 611 'Build(s) pending. It is suggested to wait that no more than %d '
611 'builds are pending.' % max_pendings, 612 'builds are pending.' % max_pendings,
612 long_text='\n'.join(out))] 613 long_text='\n'.join(out))]
613 return [] 614 return []
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698