OLD | NEW |
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 Loading... |
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 Loading... |
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)) |
OLD | NEW |