1fd4e5da5Sopenharmony_ci# Copyright (c) 2018 The Khronos Group Inc. 2fd4e5da5Sopenharmony_ci# 3fd4e5da5Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License"); 4fd4e5da5Sopenharmony_ci# you may not use this file except in compliance with the License. 5fd4e5da5Sopenharmony_ci# You may obtain a copy of the License at 6fd4e5da5Sopenharmony_ci# 7fd4e5da5Sopenharmony_ci# http://www.apache.org/licenses/LICENSE-2.0 8fd4e5da5Sopenharmony_ci# 9fd4e5da5Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software 10fd4e5da5Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS, 11fd4e5da5Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12fd4e5da5Sopenharmony_ci# See the License for the specific language governing permissions and 13fd4e5da5Sopenharmony_ci# limitations under the License. 14fd4e5da5Sopenharmony_ci 15fd4e5da5Sopenharmony_ci"""Presubmit script for SPIRV-Tools. 16fd4e5da5Sopenharmony_ci 17fd4e5da5Sopenharmony_ciSee http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts 18fd4e5da5Sopenharmony_cifor more details about the presubmit API built into depot_tools. 19fd4e5da5Sopenharmony_ci""" 20fd4e5da5Sopenharmony_ci 21fd4e5da5Sopenharmony_ciUSE_PYTHON3 = True 22fd4e5da5Sopenharmony_ci 23fd4e5da5Sopenharmony_ciLINT_FILTERS = [ 24fd4e5da5Sopenharmony_ci "-build/storage_class", 25fd4e5da5Sopenharmony_ci "-readability/casting", 26fd4e5da5Sopenharmony_ci "-readability/fn_size", 27fd4e5da5Sopenharmony_ci "-readability/todo", 28fd4e5da5Sopenharmony_ci "-runtime/explicit", 29fd4e5da5Sopenharmony_ci "-runtime/int", 30fd4e5da5Sopenharmony_ci "-runtime/printf", 31fd4e5da5Sopenharmony_ci "-runtime/references", 32fd4e5da5Sopenharmony_ci "-runtime/string", 33fd4e5da5Sopenharmony_ci] 34fd4e5da5Sopenharmony_ci 35fd4e5da5Sopenharmony_ci 36fd4e5da5Sopenharmony_cidef CheckChangeOnUpload(input_api, output_api): 37fd4e5da5Sopenharmony_ci results = [] 38fd4e5da5Sopenharmony_ci results += input_api.canned_checks.CheckPatchFormatted(input_api, output_api) 39fd4e5da5Sopenharmony_ci results += input_api.canned_checks.CheckChangeLintsClean( 40fd4e5da5Sopenharmony_ci input_api, output_api, None, LINT_FILTERS) 41fd4e5da5Sopenharmony_ci 42fd4e5da5Sopenharmony_ci return results 43