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

Side by Side Diff: presubmit_support.py

Issue 14265007: Fix R= line handling when there is no value and improve presubmit TAG line regex (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Also check no trigger on whitespace Created 7 years, 8 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 | « git_cl.py ('k') | tests/git_cl_test.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) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 """Enables directory-specific presubmit checks to run at upload and/or commit. 6 """Enables directory-specific presubmit checks to run at upload and/or commit.
7 """ 7 """
8 8
9 __version__ = '1.6.2' 9 __version__ = '1.6.2'
10 10
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 678
679 Instance members: 679 Instance members:
680 tags: Dictionnary of KEY=VALUE pairs found in the change description. 680 tags: Dictionnary of KEY=VALUE pairs found in the change description.
681 self.KEY: equivalent to tags['KEY'] 681 self.KEY: equivalent to tags['KEY']
682 """ 682 """
683 683
684 _AFFECTED_FILES = AffectedFile 684 _AFFECTED_FILES = AffectedFile
685 685
686 # Matches key/value (or "tag") lines in changelist descriptions. 686 # Matches key/value (or "tag") lines in changelist descriptions.
687 TAG_LINE_RE = re.compile( 687 TAG_LINE_RE = re.compile(
688 '^\s*(?P<key>[A-Z][A-Z_0-9]*)\s*=\s*(?P<value>.*?)\s*$') 688 '^[ \t]*(?P<key>[A-Z][A-Z_0-9]*)[ \t]*=[ \t]*(?P<value>.*?)[ \t]*$')
689 scm = '' 689 scm = ''
690 690
691 def __init__( 691 def __init__(
692 self, name, description, local_root, files, issue, patchset, author): 692 self, name, description, local_root, files, issue, patchset, author):
693 if files is None: 693 if files is None:
694 files = [] 694 files = []
695 self._name = name 695 self._name = name
696 self._full_description = description 696 self._full_description = description
697 # Convert root into an absolute path. 697 # Convert root into an absolute path.
698 self._local_root = os.path.abspath(local_root) 698 self._local_root = os.path.abspath(local_root)
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
1311 except PresubmitFailure, e: 1311 except PresubmitFailure, e:
1312 print >> sys.stderr, e 1312 print >> sys.stderr, e
1313 print >> sys.stderr, 'Maybe your depot_tools is out of date?' 1313 print >> sys.stderr, 'Maybe your depot_tools is out of date?'
1314 print >> sys.stderr, 'If all fails, contact maruel@' 1314 print >> sys.stderr, 'If all fails, contact maruel@'
1315 return 2 1315 return 2
1316 1316
1317 1317
1318 if __name__ == '__main__': 1318 if __name__ == '__main__':
1319 fix_encoding.fix_encoding() 1319 fix_encoding.fix_encoding()
1320 sys.exit(Main(None)) 1320 sys.exit(Main(None))
OLDNEW
« no previous file with comments | « git_cl.py ('k') | tests/git_cl_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698