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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 for (line_num, previous_line_num) in problem_linenums: | 564 for (line_num, previous_line_num) in problem_linenums: |
565 if line_num in changed_linenums or previous_line_num in changed_linenums: | 565 if line_num in changed_linenums or previous_line_num in changed_linenums: |
566 warnings.append(' %s:%d' % (file_path, line_num)) | 566 warnings.append(' %s:%d' % (file_path, line_num)) |
567 return warnings | 567 return warnings |
568 | 568 |
569 | 569 |
570 def _CheckIncludeOrderInFile(input_api, f, changed_linenums): | 570 def _CheckIncludeOrderInFile(input_api, f, changed_linenums): |
571 """Checks the #include order for the given file f.""" | 571 """Checks the #include order for the given file f.""" |
572 | 572 |
573 system_include_pattern = input_api.re.compile(r'\s*#include \<.*') | 573 system_include_pattern = input_api.re.compile(r'\s*#include \<.*') |
574 # Exclude #include <.../...> includes from the check; e.g., <sys/...> includes | 574 # Exclude the following includes from the check: |
575 # often need to appear in a specific order. | 575 # 1) #include <.../...>, e.g., <sys/...> includes often need to appear in a |
576 excluded_include_pattern = input_api.re.compile(r'\s*#include \<.*/.*') | 576 # specific order. |
| 577 # 2) <atlbase.h>, "build/build_config.h" |
| 578 excluded_include_pattern = input_api.re.compile( |
| 579 r'\s*#include (\<.*/.*|\<atlbase\.h\>|"build/build_config.h")') |
577 custom_include_pattern = input_api.re.compile(r'\s*#include "(?P<FILE>.*)"') | 580 custom_include_pattern = input_api.re.compile(r'\s*#include "(?P<FILE>.*)"') |
578 if_pattern = input_api.re.compile( | 581 if_pattern = input_api.re.compile( |
579 r'\s*#\s*(if|elif|else|endif|define|undef).*') | 582 r'\s*#\s*(if|elif|else|endif|define|undef).*') |
580 # Some files need specialized order of includes; exclude such files from this | 583 # Some files need specialized order of includes; exclude such files from this |
581 # check. | 584 # check. |
582 uncheckable_includes_pattern = input_api.re.compile( | 585 uncheckable_includes_pattern = input_api.re.compile( |
583 r'\s*#include ' | 586 r'\s*#include ' |
584 '("ipc/.*macros\.h"|<windows\.h>|".*gl.*autogen.h")\s*') | 587 '("ipc/.*macros\.h"|<windows\.h>|".*gl.*autogen.h")\s*') |
585 | 588 |
586 contents = f.NewContents() | 589 contents = f.NewContents() |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1054 trybots += ['linux_chromeos_clang:compile', 'linux_chromeos_asan'] | 1057 trybots += ['linux_chromeos_clang:compile', 'linux_chromeos_asan'] |
1055 | 1058 |
1056 # The AOSP bot doesn't build the chrome/ layer, so ignore any changes to it | 1059 # The AOSP bot doesn't build the chrome/ layer, so ignore any changes to it |
1057 # unless they're .gyp(i) files as changes to those files can break the gyp | 1060 # unless they're .gyp(i) files as changes to those files can break the gyp |
1058 # step on that bot. | 1061 # step on that bot. |
1059 if (not all(re.search('^chrome', f) for f in files) or | 1062 if (not all(re.search('^chrome', f) for f in files) or |
1060 any(re.search('\.gypi?$', f) for f in files)): | 1063 any(re.search('\.gypi?$', f) for f in files)): |
1061 trybots += ['android_aosp'] | 1064 trybots += ['android_aosp'] |
1062 | 1065 |
1063 return trybots | 1066 return trybots |
OLD | NEW |