-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Open
Labels
Description
If you have an invalid clang-tidy config file, clang-tidy carries on silently and uses the default configuration settings. I've encountered this in several projects where there is a typo in the clang-tidy config file, which results in the default config being used.
With verify-config, the errors are reported, but it eventually claims "No config error detected" and sets a successful exit code.
-> clang-tidy-17 --version
Ubuntu LLVM version 17.0.4
Optimized build.
-> echo "This is not a valid clang-tidy file" > .clang-tidy
-> clang-tidy-17 --verify-config && echo PASSED || echo FAILED
/tmp/test/.clang-tidy:1:1: error: not a mapping
This is not a valid clang-tidy file
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error parsing /tmp/test/.clang-tidy: Invalid argument
/tmp/test/.clang-tidy:1:1: error: not a mapping
This is not a valid clang-tidy file
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error parsing /tmp/test/.clang-tidy: Invalid argument
No config errors detected.
PASSED
FlashSheridan and tiagomacarios