| 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 # TODO(phajdan.jr): pylint recipes-py code (http://crbug.com/617939). |
| 271 black_list += [r'^recipes/recipes\.py$'] |
| 270 black_list += IgnoredPaths(input_api) | 272 black_list += IgnoredPaths(input_api) |
| 271 | 273 |
| 272 extra_syspaths = [venv_path] | 274 extra_syspaths = [venv_path] |
| 273 | 275 |
| 274 all_python_files = FetchAllFiles(input_api, white_list, black_list) | 276 all_python_files = FetchAllFiles(input_api, white_list, black_list) |
| 275 | 277 |
| 276 root_to_paths = GroupPythonFilesByRoot(input_api, all_python_files) | 278 root_to_paths = GroupPythonFilesByRoot(input_api, all_python_files) |
| 277 source_filter = lambda path: input_api.FilterSourceFile(path, | 279 source_filter = lambda path: input_api.FilterSourceFile(path, |
| 278 white_list=white_list, black_list=black_list) | 280 white_list=white_list, black_list=black_list) |
| 279 changed_py_files = [f.LocalPath() | 281 changed_py_files = [f.LocalPath() |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 try_config = {} | 380 try_config = {} |
| 379 for master in masters: | 381 for master in masters: |
| 380 try_config.setdefault(master, {}) | 382 try_config.setdefault(master, {}) |
| 381 for builder in masters[master]: | 383 for builder in masters[master]: |
| 382 # Do not trigger presubmit builders, since they're likely to fail | 384 # Do not trigger presubmit builders, since they're likely to fail |
| 383 # (e.g. OWNERS checks before finished code review), and we're | 385 # (e.g. OWNERS checks before finished code review), and we're |
| 384 # running local presubmit anyway. | 386 # running local presubmit anyway. |
| 385 if 'presubmit' not in builder.lower(): | 387 if 'presubmit' not in builder.lower(): |
| 386 try_config[master][builder] = ['defaulttests'] | 388 try_config[master][builder] = ['defaulttests'] |
| 387 return try_config | 389 return try_config |
| OLD | NEW |