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 gcl. | 8 for more details about the presubmit API built into gcl. |
9 """ | 9 """ |
10 | 10 |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 error_descriptions.append(description_with_path) | 421 error_descriptions.append(description_with_path) |
422 else: | 422 else: |
423 warning_descriptions.append(description_with_path) | 423 warning_descriptions.append(description_with_path) |
424 | 424 |
425 results = [] | 425 results = [] |
426 if error_descriptions: | 426 if error_descriptions: |
427 results.append(output_api.PresubmitError( | 427 results.append(output_api.PresubmitError( |
428 'You added one or more #includes that violate checkdeps rules.', | 428 'You added one or more #includes that violate checkdeps rules.', |
429 error_descriptions)) | 429 error_descriptions)) |
430 if warning_descriptions: | 430 if warning_descriptions: |
431 results.append(output_api.PresubmitPromptWarning( | 431 if not input_api.is_committing: |
| 432 warning_factory = output_api.PresubmitPromptWarning |
| 433 else: |
| 434 # We don't want to block use of the CQ when there is a warning |
| 435 # of this kind, so we only show a message when committing. |
| 436 warning_factory = output_api.PresubmitNotifyResult |
| 437 results.append(warning_factory( |
432 'You added one or more #includes of files that are temporarily\n' | 438 'You added one or more #includes of files that are temporarily\n' |
433 'allowed but being removed. Can you avoid introducing the\n' | 439 'allowed but being removed. Can you avoid introducing the\n' |
434 '#include? See relevant DEPS file(s) for details and contacts.', | 440 '#include? See relevant DEPS file(s) for details and contacts.', |
435 warning_descriptions)) | 441 warning_descriptions)) |
436 return results | 442 return results |
437 | 443 |
438 | 444 |
439 def _CheckFilePermissions(input_api, output_api): | 445 def _CheckFilePermissions(input_api, output_api): |
440 """Check that all files have their permissions properly set.""" | 446 """Check that all files have their permissions properly set.""" |
441 args = [sys.executable, 'tools/checkperms/checkperms.py', '--root', | 447 args = [sys.executable, 'tools/checkperms/checkperms.py', '--root', |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 | 599 |
594 # Match things like path/aura/file.cc and path/file_aura.cc. | 600 # Match things like path/aura/file.cc and path/file_aura.cc. |
595 # Same for ash and chromeos. | 601 # Same for ash and chromeos. |
596 if any(re.search('[/_](ash|aura)', f) for f in files): | 602 if any(re.search('[/_](ash|aura)', f) for f in files): |
597 trybots += ['linux_chromeos', 'linux_chromeos_clang:compile', 'win_aura'] | 603 trybots += ['linux_chromeos', 'linux_chromeos_clang:compile', 'win_aura'] |
598 else: | 604 else: |
599 if any(re.search('[/_]chromeos', f) for f in files): | 605 if any(re.search('[/_]chromeos', f) for f in files): |
600 trybots += ['linux_chromeos', 'linux_chromeos_clang:compile'] | 606 trybots += ['linux_chromeos', 'linux_chromeos_clang:compile'] |
601 | 607 |
602 return trybots | 608 return trybots |
OLD | NEW |