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

Side by Side Diff: presubmit_support.py

Issue 8494013: Blacklist .diff and .patch files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 1 month 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 | tests/presubmit_unittest.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) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 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.1' 9 __version__ = '1.6.1'
10 10
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 # Output directories (just in case) 209 # Output directories (just in case)
210 r".*\bDebug[\\\/].*", 210 r".*\bDebug[\\\/].*",
211 r".*\bRelease[\\\/].*", 211 r".*\bRelease[\\\/].*",
212 r".*\bxcodebuild[\\\/].*", 212 r".*\bxcodebuild[\\\/].*",
213 r".*\bsconsbuild[\\\/].*", 213 r".*\bsconsbuild[\\\/].*",
214 # All caps files like README and LICENCE. 214 # All caps files like README and LICENCE.
215 r".*\b[A-Z0-9_]{2,}$", 215 r".*\b[A-Z0-9_]{2,}$",
216 # SCM (can happen in dual SCM configuration). (Slightly over aggressive) 216 # SCM (can happen in dual SCM configuration). (Slightly over aggressive)
217 r"(|.*[\\\/])\.git[\\\/].*", 217 r"(|.*[\\\/])\.git[\\\/].*",
218 r"(|.*[\\\/])\.svn[\\\/].*", 218 r"(|.*[\\\/])\.svn[\\\/].*",
219 # There is no point in processing a patch file.
220 r".+\.diff$",
221 r".+\.patch$",
219 ) 222 )
220 223
221 def __init__(self, change, presubmit_path, is_committing, 224 def __init__(self, change, presubmit_path, is_committing,
222 rietveld_obj, verbose): 225 rietveld_obj, verbose):
223 """Builds an InputApi object. 226 """Builds an InputApi object.
224 227
225 Args: 228 Args:
226 change: A presubmit.Change object. 229 change: A presubmit.Change object.
227 presubmit_path: The path to the presubmit script being processed. 230 presubmit_path: The path to the presubmit script being processed.
228 is_committing: True if the change is about to be committed. 231 is_committing: True if the change is about to be committed.
(...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after
1255 except PresubmitFailure, e: 1258 except PresubmitFailure, e:
1256 print >> sys.stderr, e 1259 print >> sys.stderr, e
1257 print >> sys.stderr, 'Maybe your depot_tools is out of date?' 1260 print >> sys.stderr, 'Maybe your depot_tools is out of date?'
1258 print >> sys.stderr, 'If all fails, contact maruel@' 1261 print >> sys.stderr, 'If all fails, contact maruel@'
1259 return 2 1262 return 2
1260 1263
1261 1264
1262 if __name__ == '__main__': 1265 if __name__ == '__main__':
1263 fix_encoding.fix_encoding() 1266 fix_encoding.fix_encoding()
1264 sys.exit(Main(None)) 1267 sys.exit(Main(None))
OLDNEW
« 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