From 0e0d76bda131f055dc12735389ae888f65894d29 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Wed, 30 Apr 2025 22:15:08 +0000 Subject: [PATCH] Add --verify-config to clang-tidy invocations By default clang-tidy ignores unknown checks. This makes that an error case. --- clang_tidy/clang_tidy_test.bzl | 4 ++-- clang_tidy/run_clang_tidy.sh | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/clang_tidy/clang_tidy_test.bzl b/clang_tidy/clang_tidy_test.bzl index 6d1d438..155c056 100644 --- a/clang_tidy/clang_tidy_test.bzl +++ b/clang_tidy/clang_tidy_test.bzl @@ -64,12 +64,12 @@ ln -s .. external has_srcs=false if [[ -n "{c_sources}" ]]; then - "$bin" --quiet --export-fixes $TEST_UNDECLARED_OUTPUTS_DIR/cfixes.yaml {c_sources} -- {c_flags} + "$bin" --quiet --verify-config --export-fixes $TEST_UNDECLARED_OUTPUTS_DIR/cfixes.yaml {c_sources} -- {c_flags} has_srcs=true fi if [[ -n "{cxx_sources}" ]]; then - "$bin" --quiet --export-fixes $TEST_UNDECLARED_OUTPUTS_DIR/cxxfixes.yaml {cxx_sources} -- {cxx_flags} + "$bin" --quiet --verify-config --export-fixes $TEST_UNDECLARED_OUTPUTS_DIR/cxxfixes.yaml {cxx_sources} -- {cxx_flags} has_srcs=true fi diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh index 5cddb59..eadcf84 100755 --- a/clang_tidy/run_clang_tidy.sh +++ b/clang_tidy/run_clang_tidy.sh @@ -33,6 +33,7 @@ trap 'if (($?)); then cat "$logfile" 1>&2; fi; rm "$logfile"' EXIT # re-promoted to an error. See the clang-tidy bug here for details: # https://github.com/llvm/llvm-project/issues/61969 set -- \ + --verify-config \ --checks=-clang-diagnostic-builtin-macro-redefined \ --warnings-as-errors=-clang-diagnostic-builtin-macro-redefined \ "$@"