Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2014 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 infra. | 5 """Top-level presubmit script for infra. |
| 6 | 6 |
| 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for | 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for |
| 8 details on the presubmit API built into gcl. | 8 details on the presubmit API built into gcl. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 260 venv_path = input_api.os_path.join(infra_root, 'ENV', 'lib', 'python2.7') | 260 venv_path = input_api.os_path.join(infra_root, 'ENV', 'lib', 'python2.7') |
| 261 | 261 |
| 262 # Cause all pylint commands to execute in the virtualenv | 262 # Cause all pylint commands to execute in the virtualenv |
| 263 input_api.python_executable = ( | 263 input_api.python_executable = ( |
| 264 input_api.os_path.join(infra_root, 'ENV', 'bin', 'python')) | 264 input_api.os_path.join(infra_root, 'ENV', 'bin', 'python')) |
| 265 | 265 |
| 266 white_list = ['.*\.py$'] | 266 white_list = ['.*\.py$'] |
| 267 black_list = list(input_api.DEFAULT_BLACK_LIST) | 267 black_list = list(input_api.DEFAULT_BLACK_LIST) |
| 268 black_list += DISABLED_PROJECTS | 268 black_list += DISABLED_PROJECTS |
| 269 black_list += ['.*\.pyc$', '.*_pb2\.py'] | 269 black_list += ['.*\.pyc$', '.*_pb2\.py'] |
| 270 black_list += [r'^recipes/recipes\.py$'] | |
|
Sergiy Byelozyorov
2016/06/07 12:00:00
Why is this needed? Can we fix recipes.py instead?
Paweł Hajdan Jr.
2016/06/07 12:07:18
Other repos also have it. It generates pylint warn
Sergiy Byelozyorov
2016/06/07 13:19:46
We've discussed it offline and Pawel added comment
| |
| 270 black_list += IgnoredPaths(input_api) | 271 black_list += IgnoredPaths(input_api) |
| 271 | 272 |
| 272 extra_syspaths = [venv_path] | 273 extra_syspaths = [venv_path] |
| 273 | 274 |
| 274 all_python_files = FetchAllFiles(input_api, white_list, black_list) | 275 all_python_files = FetchAllFiles(input_api, white_list, black_list) |
| 275 | 276 |
| 276 root_to_paths = GroupPythonFilesByRoot(input_api, all_python_files) | 277 root_to_paths = GroupPythonFilesByRoot(input_api, all_python_files) |
| 277 source_filter = lambda path: input_api.FilterSourceFile(path, | 278 source_filter = lambda path: input_api.FilterSourceFile(path, |
| 278 white_list=white_list, black_list=black_list) | 279 white_list=white_list, black_list=black_list) |
| 279 changed_py_files = [f.LocalPath() | 280 changed_py_files = [f.LocalPath() |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 378 try_config = {} | 379 try_config = {} |
| 379 for master in masters: | 380 for master in masters: |
| 380 try_config.setdefault(master, {}) | 381 try_config.setdefault(master, {}) |
| 381 for builder in masters[master]: | 382 for builder in masters[master]: |
| 382 # Do not trigger presubmit builders, since they're likely to fail | 383 # Do not trigger presubmit builders, since they're likely to fail |
| 383 # (e.g. OWNERS checks before finished code review), and we're | 384 # (e.g. OWNERS checks before finished code review), and we're |
| 384 # running local presubmit anyway. | 385 # running local presubmit anyway. |
| 385 if 'presubmit' not in builder.lower(): | 386 if 'presubmit' not in builder.lower(): |
| 386 try_config[master][builder] = ['defaulttests'] | 387 try_config[master][builder] = ['defaulttests'] |
| 387 return try_config | 388 return try_config |
| OLD | NEW |