133259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck# Copyright 2015 The Chromium Authors. All rights reserved.
233259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck# Use of this source code is governed by a BSD-style license that can be
333259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck# found in the LICENSE file.
433259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck
533259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck"""Presubmit script for changes affecting tools/perf/.
633259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck
733259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John ReckSee http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
833259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reckfor more details about the presubmit API built into depot_tools.
933259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck"""
1033259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck
1133259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reckdef _CommonChecks(input_api, output_api):
1233259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck  """Performs common checks, which includes running pylint."""
1333259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck  results = []
1433259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck  results.extend(input_api.canned_checks.RunPylint(
1533259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck        input_api, output_api, black_list=[], pylintrc='pylintrc'))
1633259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck  return results
1733259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck
1833259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck
1933259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reckdef CheckChangeOnUpload(input_api, output_api):
2033259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck  report = []
2133259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck  report.extend(_CommonChecks(input_api, output_api))
2233259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck  return report
2333259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck
2433259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck
2533259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reckdef CheckChangeOnCommit(input_api, output_api):
2633259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck  report = []
2733259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck  report.extend(_CommonChecks(input_api, output_api))
2833259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck  return report
29