PRESUBMIT.py 878 B

123456789101112131415161718192021222324252627282930313233343536
  1. # Copyright (c) 2016 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. """Top-level presubmit script for gpu.
  5. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
  6. for more details about the presubmit API built into depot_tools.
  7. """
  8. USE_PYTHON3 = True
  9. def CommonChecks(input_api, output_api):
  10. import sys
  11. output = []
  12. sys_path_backup = sys.path
  13. try:
  14. sys.path = [
  15. input_api.PresubmitLocalPath()
  16. ] + sys.path
  17. output.extend(input_api.canned_checks.RunPylint(input_api, output_api))
  18. finally:
  19. sys.path = sys_path_backup
  20. return output
  21. def CheckChangeOnUpload(input_api, output_api):
  22. return CommonChecks(input_api, output_api)
  23. def CheckChangeOnCommit(input_api, output_api):
  24. return CommonChecks(input_api, output_api)