OLD | NEW |
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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 # Path regexp that should be excluded from being considered containing source | 236 # Path regexp that should be excluded from being considered containing source |
237 # files. Don't modify this list from a presubmit script! | 237 # files. Don't modify this list from a presubmit script! |
238 DEFAULT_BLACK_LIST = ( | 238 DEFAULT_BLACK_LIST = ( |
239 r"testing_support[\\\/]google_appengine[\\\/].*", | 239 r"testing_support[\\\/]google_appengine[\\\/].*", |
240 r".*\bexperimental[\\\/].*", | 240 r".*\bexperimental[\\\/].*", |
241 r".*\bthird_party[\\\/].*", | 241 r".*\bthird_party[\\\/].*", |
242 # Output directories (just in case) | 242 # Output directories (just in case) |
243 r".*\bDebug[\\\/].*", | 243 r".*\bDebug[\\\/].*", |
244 r".*\bRelease[\\\/].*", | 244 r".*\bRelease[\\\/].*", |
245 r".*\bxcodebuild[\\\/].*", | 245 r".*\bxcodebuild[\\\/].*", |
246 r".*\bsconsbuild[\\\/].*", | 246 r".*\bout[\\\/].*", |
247 # All caps files like README and LICENCE. | 247 # All caps files like README and LICENCE. |
248 r".*\b[A-Z0-9_]{2,}$", | 248 r".*\b[A-Z0-9_]{2,}$", |
249 # SCM (can happen in dual SCM configuration). (Slightly over aggressive) | 249 # SCM (can happen in dual SCM configuration). (Slightly over aggressive) |
250 r"(|.*[\\\/])\.git[\\\/].*", | 250 r"(|.*[\\\/])\.git[\\\/].*", |
251 r"(|.*[\\\/])\.svn[\\\/].*", | 251 r"(|.*[\\\/])\.svn[\\\/].*", |
252 # There is no point in processing a patch file. | 252 # There is no point in processing a patch file. |
253 r".+\.diff$", | 253 r".+\.diff$", |
254 r".+\.patch$", | 254 r".+\.patch$", |
255 ) | 255 ) |
256 | 256 |
(...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1427 except PresubmitFailure, e: | 1427 except PresubmitFailure, e: |
1428 print >> sys.stderr, e | 1428 print >> sys.stderr, e |
1429 print >> sys.stderr, 'Maybe your depot_tools is out of date?' | 1429 print >> sys.stderr, 'Maybe your depot_tools is out of date?' |
1430 print >> sys.stderr, 'If all fails, contact maruel@' | 1430 print >> sys.stderr, 'If all fails, contact maruel@' |
1431 return 2 | 1431 return 2 |
1432 | 1432 |
1433 | 1433 |
1434 if __name__ == '__main__': | 1434 if __name__ == '__main__': |
1435 fix_encoding.fix_encoding() | 1435 fix_encoding.fix_encoding() |
1436 sys.exit(Main(None)) | 1436 sys.exit(Main(None)) |
OLD | NEW |