PRESUBMIT.py revision 44c2820018b23a442f29b3e0a1fbb1b93b62411a
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 5import sys 6 7 8def CheckChange(input_api, output_api): 9 original_sys_path = sys.path 10 try: 11 sys.path += [input_api.PresubmitLocalPath()] 12 from hooks import pre_commit 13 results = pre_commit.GetResults('@{u}') 14 return map(output_api.PresubmitError, results) 15 finally: 16 sys.path = original_sys_path 17 18 19def CheckChangeOnUpload(input_api, output_api): 20 return CheckChange(input_api, output_api) 21 22 23def CheckChangeOnCommit(input_api, output_api): 24 return CheckChange(input_api, output_api) 25