blob: 38bad96cf1e58d5faa9b1ac62edae13c6093cd4d [file] [log] [blame]
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
def RunChecks(input_api, output_api):
results = []
from build import presubmit_checks
results += presubmit_checks.RunChecks(input_api)
return map(output_api.PresubmitError, results)
def CheckChange(input_api, output_api):
original_sys_path = sys.path
sys.path += [input_api.PresubmitLocalPath()]
return RunChecks(input_api, output_api)
sys.path = original_sys_path
def CheckChangeOnUpload(input_api, output_api):
return CheckChange(input_api, output_api)
def CheckChangeOnCommit(input_api, output_api):
return CheckChange(input_api, output_api)