PRESUBMIT.py 971 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. import sys
  9. USE_PYTHON3 = True
  10. def CommonChecks(input_api, output_api):
  11. output = []
  12. sys_path_backup = sys.path
  13. try:
  14. sys.path = [
  15. input_api.PresubmitLocalPath()
  16. ] + sys.path
  17. pylint_checks = input_api.canned_checks.GetPylint(
  18. input_api,
  19. output_api,
  20. version='2.7')
  21. output.extend(input_api.RunTests(pylint_checks))
  22. finally:
  23. sys.path = sys_path_backup
  24. return output
  25. def CheckChangeOnUpload(input_api, output_api):
  26. return CommonChecks(input_api, output_api)
  27. def CheckChangeOnCommit(input_api, output_api):
  28. return CommonChecks(input_api, output_api)