1#!/bin/sh 2# Copyright 2017 gRPC authors. 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15 16set -ex 17 18# clang format command 19CLANG_TIDY=${CLANG_TIDY:-clang-tidy} 20 21cd ${CLANG_TIDY_ROOT} 22 23# run clang tidy for all source files 24cat compile_commands.json | jq -r '.[].file' \ 25 | grep -E "(^include/|^src/core/|^src/cpp/|^test/core/|^test/cpp/)" \ 26 | grep -v -E "src/core/telemetry/stats_data" \ 27 | grep -v -E "/upb-gen/|/upbdefs-gen/" \ 28 | sort \ 29 | xargs tools/distrib/run_clang_tidy.py "$@" 30