Imported Upstream version 1.34.0
[platform/upstream/grpc.git] / tools / dockerfile / grpc_clang_tidy / clang_tidy_all_the_things.sh
index 9ce5209..947ffba 100755 (executable)
@@ -20,5 +20,9 @@ CLANG_TIDY=${CLANG_TIDY:-clang-tidy}
 
 cd ${CLANG_TIDY_ROOT}
 
-find src/core src/cpp test/core test/cpp ! -path 'src/core/ext/upb-generated/*' -name '*.h' -or -name '*.cc' -print0 \
-  | xargs -0 tools/distrib/run_clang_tidy.py "$@"
+# run clang tidy for all source files
+cat compile_commands.json | jq -r '.[].file' \
+  | grep -E "(^src/core/|^src/cpp/|^test/core/|^test/cpp/)" \
+  | grep -v -E "/upb-generated/|/upbdefs-generated/" \
+  | sort \
+  | xargs tools/distrib/run_clang_tidy.py "$@"