| 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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 self.canned_checks = presubmit_canned_checks | 310 self.canned_checks = presubmit_canned_checks |
| 311 | 311 |
| 312 # TODO(dpranke): figure out a list of all approved owners for a repo | 312 # TODO(dpranke): figure out a list of all approved owners for a repo |
| 313 # in order to be able to handle wildcard OWNERS files? | 313 # in order to be able to handle wildcard OWNERS files? |
| 314 self.owners_db = owners.Database(change.RepositoryRoot(), | 314 self.owners_db = owners.Database(change.RepositoryRoot(), |
| 315 fopen=file, os_path=self.os_path, glob=self.glob) | 315 fopen=file, os_path=self.os_path, glob=self.glob) |
| 316 self.verbose = verbose | 316 self.verbose = verbose |
| 317 self.Command = CommandData | 317 self.Command = CommandData |
| 318 | 318 |
| 319 # Replace <hash_map> and <hash_set> as headers that need to be included | 319 # Replace <hash_map> and <hash_set> as headers that need to be included |
| 320 # with "base/hash_tables.h" instead. | 320 # with "base/containers/hash_tables.h" instead. |
| 321 # Access to a protected member _XX of a client class | 321 # Access to a protected member _XX of a client class |
| 322 # pylint: disable=W0212 | 322 # pylint: disable=W0212 |
| 323 self.cpplint._re_pattern_templates = [ | 323 self.cpplint._re_pattern_templates = [ |
| 324 (a, b, 'base/hash_tables.h') | 324 (a, b, 'base/containers/hash_tables.h') |
| 325 if header in ('<hash_map>', '<hash_set>') else (a, b, header) | 325 if header in ('<hash_map>', '<hash_set>') else (a, b, header) |
| 326 for (a, b, header) in cpplint._re_pattern_templates | 326 for (a, b, header) in cpplint._re_pattern_templates |
| 327 ] | 327 ] |
| 328 | 328 |
| 329 def PresubmitLocalPath(self): | 329 def PresubmitLocalPath(self): |
| 330 """Returns the local path of the presubmit script currently being run. | 330 """Returns the local path of the presubmit script currently being run. |
| 331 | 331 |
| 332 This is useful if you don't want to hard-code absolute paths in the | 332 This is useful if you don't want to hard-code absolute paths in the |
| 333 presubmit script. For example, It can be used to find another file | 333 presubmit script. For example, It can be used to find another file |
| 334 relative to the PRESUBMIT.py script, so the whole tree can be branched and | 334 relative to the PRESUBMIT.py script, so the whole tree can be branched and |
| (...skipping 1092 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 |