<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/136659>136659</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
.clang-tidy not automatically found by clang-tidy 20.1.2
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-tidy
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
kenchung285
</td>
</tr>
</table>
<pre>
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 discover and respect both the project-root `.clang-tidy` and the one under `folder B`.
Actual behavior:
* Without `-config-file`, `.clang-tidy` is not discovered at all in 20.1.2.
* With `-config-file`, `.clang-tidy` in `folder B` is ignored.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyclc-O4jgQxp_GXEpExoFADjlkmEbTh73sZc7GriTeMXbkP2F4-5WTQNMsPd1ahJRIqa_8q89VNvdetQaxIptvZPN9wWPorKt-oRFdNC3bbRZHKy_VK3R8QODQO_sPigCh4wGsU60yXOsLRI8ShOamXQYlL7Aqs1W2JWwP3Eg4I2HbAcGhQBNSeN86LlFCsDCg88oaYDRbZSyDugno5ghl2pTjdZIbG5RACRxEx02LoAwcseODsg4ctt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