Consider this example:
$ cat main.cpp
#include "foo.h"
$ cat include/foo.h
#define poorNamedMacro
$ cat include/.clang-tidy
InvalidOption
$ cat .clang-tidy
CheckOptions: {
readability-identifier.naming.MacroDefinitionCase: UPPER_CASE
}
Running clang-tidy:
$ clang-tidy -checks=-*,readability-identifier-naming main.cpp -header-filter=.* -- -I include/
/tmp/include/.clang-tidy:1:1: error: not a mapping
InvalidOption
^~~~~~~~~~~~~
Error parsing /tmp/include/.clang-tidy: Invalid argument
$ echo $?
0
The .clang-tidy file in the include folder has invalid syntax. readability-identifier-naming picks up this file when processing a warning from a header next to it. However it does not make clang-tidy fail with an error upon parse failure, like clang-tidy would do with the "main" .clang-tidy file.