1 # Copyright 2015 The Chromium Authors. All rights reserved. 2 # Use of this source code is governed by a BSD-style license that can be 3 # found in the LICENSE file. 4 5 6 def CheckChangeOnUpload(input_api, output_api): 7 return _CommonChecks(input_api, output_api) 8 9 10 def CheckChangeOnCommit(input_api, output_api): 11 return _CommonChecks(input_api, output_api) 12 13 14 def _CommonChecks(input_api, output_api): 15 results = [] 16 results += input_api.RunTests(input_api.canned_checks.GetPylint( 17 input_api, output_api, extra_paths_list=_GetPathsToPrepend(input_api), 18 pylintrc='pylintrc')) 19 return results 20 21 22 def _GetPathsToPrepend(input_api): 23 project_dir = input_api.PresubmitLocalPath() 24 return [ 25 project_dir, 26 ] 27