| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 | 5 |
| 6 """Top-level presubmit script for Skia. | 6 """Top-level presubmit script for Skia. |
| 7 | 7 |
| 8 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts | 8 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
| 9 for more details about the presubmit API built into gcl. | 9 for more details about the presubmit API built into gcl. |
| 10 """ | 10 """ |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 """Run checks on any modified Python files.""" | 78 """Run checks on any modified Python files.""" |
| 79 pylint_disabled_warnings = ( | 79 pylint_disabled_warnings = ( |
| 80 'F0401', # Unable to import. | 80 'F0401', # Unable to import. |
| 81 'E0611', # No name in module. | 81 'E0611', # No name in module. |
| 82 'W0232', # Class has no __init__ method. | 82 'W0232', # Class has no __init__ method. |
| 83 'E1002', # Use of super on an old style class. | 83 'E1002', # Use of super on an old style class. |
| 84 'W0403', # Relative import used. | 84 'W0403', # Relative import used. |
| 85 'R0201', # Method could be a function. | 85 'R0201', # Method could be a function. |
| 86 'E1003', # Using class name in super. | 86 'E1003', # Using class name in super. |
| 87 'W0613', # Unused argument. | 87 'W0613', # Unused argument. |
| 88 'W0105', # String statement has no effect. |
| 88 ) | 89 ) |
| 89 # Run Pylint on only the modified python files. Unfortunately it still runs | 90 # Run Pylint on only the modified python files. Unfortunately it still runs |
| 90 # Pylint on the whole file instead of just the modified lines. | 91 # Pylint on the whole file instead of just the modified lines. |
| 91 affected_python_files = [] | 92 affected_python_files = [] |
| 92 for affected_file in input_api.AffectedSourceFiles(None): | 93 for affected_file in input_api.AffectedSourceFiles(None): |
| 93 affected_file_path = affected_file.LocalPath() | 94 affected_file_path = affected_file.LocalPath() |
| 94 if affected_file_path.endswith('.py'): | 95 if affected_file_path.endswith('.py'): |
| 95 affected_python_files.append(affected_file_path) | 96 affected_python_files.append(affected_file_path) |
| 96 return input_api.canned_checks.RunPylint( | 97 return input_api.canned_checks.RunPylint( |
| 97 input_api, output_api, | 98 input_api, output_api, |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 state and an error if it is in 'Closed' state. | 517 state and an error if it is in 'Closed' state. |
| 517 """ | 518 """ |
| 518 results = [] | 519 results = [] |
| 519 results.extend(_CommonChecks(input_api, output_api)) | 520 results.extend(_CommonChecks(input_api, output_api)) |
| 520 results.extend( | 521 results.extend( |
| 521 _CheckTreeStatus(input_api, output_api, json_url=( | 522 _CheckTreeStatus(input_api, output_api, json_url=( |
| 522 SKIA_TREE_STATUS_URL + '/banner-status?format=json'))) | 523 SKIA_TREE_STATUS_URL + '/banner-status?format=json'))) |
| 523 results.extend(_CheckLGTMsForPublicAPI(input_api, output_api)) | 524 results.extend(_CheckLGTMsForPublicAPI(input_api, output_api)) |
| 524 results.extend(_CheckOwnerIsInAuthorsFile(input_api, output_api)) | 525 results.extend(_CheckOwnerIsInAuthorsFile(input_api, output_api)) |
| 525 return results | 526 return results |
| OLD | NEW |