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.8.0' | 9 __version__ = '1.8.0' |
10 | 10 |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 | 383 |
384 # The local path of the currently-being-processed presubmit script. | 384 # The local path of the currently-being-processed presubmit script. |
385 self._current_presubmit_path = os.path.dirname(presubmit_path) | 385 self._current_presubmit_path = os.path.dirname(presubmit_path) |
386 | 386 |
387 # We carry the canned checks so presubmit scripts can easily use them. | 387 # We carry the canned checks so presubmit scripts can easily use them. |
388 self.canned_checks = presubmit_canned_checks | 388 self.canned_checks = presubmit_canned_checks |
389 | 389 |
390 # TODO(dpranke): figure out a list of all approved owners for a repo | 390 # TODO(dpranke): figure out a list of all approved owners for a repo |
391 # in order to be able to handle wildcard OWNERS files? | 391 # in order to be able to handle wildcard OWNERS files? |
392 self.owners_db = owners.Database(change.RepositoryRoot(), | 392 self.owners_db = owners.Database(change.RepositoryRoot(), |
393 fopen=file, os_path=self.os_path, glob=self.glob) | 393 fopen=file, os_path=self.os_path) |
394 self.verbose = verbose | 394 self.verbose = verbose |
395 self.Command = CommandData | 395 self.Command = CommandData |
396 | 396 |
397 # Replace <hash_map> and <hash_set> as headers that need to be included | 397 # Replace <hash_map> and <hash_set> as headers that need to be included |
398 # with "base/containers/hash_tables.h" instead. | 398 # with "base/containers/hash_tables.h" instead. |
399 # Access to a protected member _XX of a client class | 399 # Access to a protected member _XX of a client class |
400 # pylint: disable=W0212 | 400 # pylint: disable=W0212 |
401 self.cpplint._re_pattern_templates = [ | 401 self.cpplint._re_pattern_templates = [ |
402 (a, b, 'base/containers/hash_tables.h') | 402 (a, b, 'base/containers/hash_tables.h') |
403 if header in ('<hash_map>', '<hash_set>') else (a, b, header) | 403 if header in ('<hash_map>', '<hash_set>') else (a, b, header) |
(...skipping 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1823 return 2 | 1823 return 2 |
1824 | 1824 |
1825 | 1825 |
1826 if __name__ == '__main__': | 1826 if __name__ == '__main__': |
1827 fix_encoding.fix_encoding() | 1827 fix_encoding.fix_encoding() |
1828 try: | 1828 try: |
1829 sys.exit(main()) | 1829 sys.exit(main()) |
1830 except KeyboardInterrupt: | 1830 except KeyboardInterrupt: |
1831 sys.stderr.write('interrupted\n') | 1831 sys.stderr.write('interrupted\n') |
1832 sys.exit(2) | 1832 sys.exit(2) |
OLD | NEW |