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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 return warnings | 456 return warnings |
457 | 457 |
458 | 458 |
459 def _CheckIncludeOrderInFile(input_api, f, changed_linenums): | 459 def _CheckIncludeOrderInFile(input_api, f, changed_linenums): |
460 """Checks the #include order for the given file f.""" | 460 """Checks the #include order for the given file f.""" |
461 | 461 |
462 system_include_pattern = input_api.re.compile(r'\s*#include \<.*') | 462 system_include_pattern = input_api.re.compile(r'\s*#include \<.*') |
463 # Exclude the following includes from the check: | 463 # Exclude the following includes from the check: |
464 # 1) #include <.../...>, e.g., <sys/...> includes often need to appear in a | 464 # 1) #include <.../...>, e.g., <sys/...> includes often need to appear in a |
465 # specific order. | 465 # specific order. |
466 # 2) <atlbase.h>, "build/build_config.h" | 466 # 2) "build/build_config.h" |
467 excluded_include_pattern = input_api.re.compile( | 467 excluded_include_pattern = input_api.re.compile( |
468 r'\s*#include (\<.*/.*|\<atlbase\.h\>|"build/build_config.h")') | 468 r'\s*#include (\<.*/.*|"build/build_config.h")') |
469 custom_include_pattern = input_api.re.compile(r'\s*#include "(?P<FILE>.*)"') | 469 custom_include_pattern = input_api.re.compile(r'\s*#include "(?P<FILE>.*)"') |
470 # Match the final or penultimate token if it is xxxtest so we can ignore it | 470 # Match the final or penultimate token if it is xxxtest so we can ignore it |
471 # when considering the special first include. | 471 # when considering the special first include. |
472 test_file_tag_pattern = input_api.re.compile( | 472 test_file_tag_pattern = input_api.re.compile( |
473 r'_[a-z]+test(?=(_[a-zA-Z0-9]+)?\.)') | 473 r'_[a-z]+test(?=(_[a-zA-Z0-9]+)?\.)') |
474 if_pattern = input_api.re.compile( | 474 if_pattern = input_api.re.compile( |
475 r'\s*#\s*(if|elif|else|endif|define|undef).*') | 475 r'\s*#\s*(if|elif|else|endif|define|undef).*') |
476 # Some files need specialized order of includes; exclude such files from this | 476 # Some files need specialized order of includes; exclude such files from this |
477 # check. | 477 # check. |
478 uncheckable_includes_pattern = input_api.re.compile( | 478 uncheckable_includes_pattern = input_api.re.compile( |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1128 'Mojo Linux ASan Try', | 1128 'Mojo Linux ASan Try', |
1129 'Mojo Linux Try', | 1129 'Mojo Linux Try', |
1130 ] | 1130 ] |
1131 | 1131 |
1132 return GetDefaultTryConfigs(builders) | 1132 return GetDefaultTryConfigs(builders) |
1133 | 1133 |
1134 def PostUploadHook(cl, change, output_api): | 1134 def PostUploadHook(cl, change, output_api): |
1135 import subprocess | 1135 import subprocess |
1136 subprocess.check_call(["git", "cl", "try"]) | 1136 subprocess.check_call(["git", "cl", "try"]) |
1137 return [] | 1137 return [] |
OLD | NEW |