Closed
Description
I have a project that originally used clang-tidy 19.1.7, and we've recently upgraded to version 20.1.2. After upgrading, I've noticed a change in behavior regarding .clang-tidy
file discovery.
In 19.1.7, clang-tidy
was able to discover and apply our self-defined .clang-tidy
files without explicitly passing the -config-file
option. However, in 20.1.2, clang-tidy
no longer discovers the .clang-tidy
file at the project root unless we explicitly pass -config-file
.
Worse, if we do pass the -config-file
flag (pointing to the one in the project root), clang-tidy
seems to ignore the .clang-tidy
file under folder B, even when checking files located in that folder.
Here is the relevant directory structure:
project-root/
├── README.md
├── .clang-tidy # Full rule config
├── folder A/
│ ├── some source files
│ └── ...
├── folder B/
│ └── .clang-tidy # Contains "Checks: '-*'" to disable checks in this folder
└── folder C/
├── other source files
└── ...
Expected behavior:
- Without
-config-file
,clang-tidy
should find and respect both the project-root.clang-tidy
and the one underfolder B
.
Actual behavior:
- Without
-config-file
,.clang-tidy
is not found at all in 20.1.2. - With
-config-file
,.clang-tidy
infolder B
is ignored.