OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Top-level presubmit script for Chromium. | 5 """Top-level presubmit script for Chromium. |
6 | 6 |
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts | 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
8 for more details about the presubmit API built into depot_tools. | 8 for more details about the presubmit API built into depot_tools. |
9 """ | 9 """ |
10 | 10 |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 | 649 |
650 | 650 |
651 def _CheckFilePermissions(input_api, output_api): | 651 def _CheckFilePermissions(input_api, output_api): |
652 """Check that all files have their permissions properly set.""" | 652 """Check that all files have their permissions properly set.""" |
653 if input_api.platform == 'win32': | 653 if input_api.platform == 'win32': |
654 return [] | 654 return [] |
655 args = [input_api.python_executable, 'tools/checkperms/checkperms.py', | 655 args = [input_api.python_executable, 'tools/checkperms/checkperms.py', |
656 '--root', input_api.change.RepositoryRoot()] | 656 '--root', input_api.change.RepositoryRoot()] |
657 for f in input_api.AffectedFiles(): | 657 for f in input_api.AffectedFiles(): |
658 args += ['--file', f.LocalPath()] | 658 args += ['--file', f.LocalPath()] |
659 checkperms = input_api.subprocess.Popen(args, | 659 try: |
660 stdout=input_api.subprocess.PIPE) | 660 input_api.subprocess.check_output(args) |
661 errors = checkperms.communicate()[0].strip() | 661 return [] |
662 if errors: | 662 except input_api.subprocess.CalledProcessError as error: |
663 return [output_api.PresubmitError('checkperms.py failed.', | 663 return [output_api.PresubmitError( |
664 errors.splitlines())] | 664 'checkperms.py failed:', |
665 return [] | 665 long_text=error.output)] |
666 | 666 |
667 | 667 |
668 def _CheckNoAuraWindowPropertyHInHeaders(input_api, output_api): | 668 def _CheckNoAuraWindowPropertyHInHeaders(input_api, output_api): |
669 """Makes sure we don't include ui/aura/window_property.h | 669 """Makes sure we don't include ui/aura/window_property.h |
670 in header files. | 670 in header files. |
671 """ | 671 """ |
672 pattern = input_api.re.compile(r'^#include\s*"ui/aura/window_property.h"') | 672 pattern = input_api.re.compile(r'^#include\s*"ui/aura/window_property.h"') |
673 errors = [] | 673 errors = [] |
674 for f in input_api.AffectedFiles(): | 674 for f in input_api.AffectedFiles(): |
675 if not f.LocalPath().endswith('.h'): | 675 if not f.LocalPath().endswith('.h'): |
(...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1929 for master in masters: | 1929 for master in masters: |
1930 try_config.setdefault(master, {}) | 1930 try_config.setdefault(master, {}) |
1931 for builder in masters[master]: | 1931 for builder in masters[master]: |
1932 # Do not trigger presubmit builders, since they're likely to fail | 1932 # Do not trigger presubmit builders, since they're likely to fail |
1933 # (e.g. OWNERS checks before finished code review), and we're | 1933 # (e.g. OWNERS checks before finished code review), and we're |
1934 # running local presubmit anyway. | 1934 # running local presubmit anyway. |
1935 if 'presubmit' not in builder: | 1935 if 'presubmit' not in builder: |
1936 try_config[master][builder] = ['defaulttests'] | 1936 try_config[master][builder] = ['defaulttests'] |
1937 | 1937 |
1938 return try_config | 1938 return try_config |
OLD | NEW |