<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/86355>86355</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            clang-tidy fails with “Error: no checks enabled” on .clang-tidy file which --verify-config verifies
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-tidy
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          FlashSheridan
      </td>
    </tr>
</table>

<pre>
    # Steps to Reproduce:
With the attached `.clang-tidy` (a simplified version of our naïve attempt to disable all checkers in a subdirectory we didn’t own), try the following:

``` 
clang-tidy --verify-config simple.c 
clang-tidy simple.c
```

# Expected Results

Preferably, the simple `clang-tidy` invocation would return success.  Failing that, the `--verify-config` invocation should warn that the configuration was unacceptable.

# Actual Results
```
clang-tidy --verify-config simple.c 
No config errors detected.


clang-tidy simple.c
Error: no checks enabled.

 
echo $?
1
```

# Workaround
Enable an irrelevant checker; see the attached `SuperCall.clang-tidy`:
```
clang-tidy --config-file=SuperCall.clang-tidy simple.c

echo $?
0

```

## Limitation
Explicitly disabling `clang-diagnostic-error` does not work.  Uncomment the bogus inclusion in `simple.c`:

```
clang-tidy --config-file=Suppress_clang-diagnostic-error.clang-tidy simple.c
1 error generated.
Error while processing /Users/flash/Documents/Bugs/Bug_files/Tidy_Bugs/simple.c.
/Users/flash/Documents/Bugs/Bug_files/Tidy_Bugs/simple.c:1:10: error: 'WarpDarkMatter.h' file not found [clang-diagnostic-error]
    1 | #include "WarpDarkMatter.h"
      |          ^~~~~~~~~~~~~~~~~~
Found compiler error(s).


echo $?
1
```
This is a severe problem for us, since some parts of the CMake process for lld work fine for actually building our fork, but cause inclusion problems in unittests (which we don’t own) when running `clang-tidy` (which we’re still investigating).



# Related:
 * https://github.com/llvm/llvm-project/issues/77341 
* https://github.com/llvm/llvm-project/issues/85777 


# Configuration
MacOS 13.6.5 22G621 on M1 Max
`clang-tidy` built in clang version 19.0.0git (git@github.com:llvm/llvm-project.git 6b1cf00400
MacOSX14.2.sdk
Xcode 15.2 15C500b, Apple clang-1500.1.0.2.5




# Files:
[Files.zip](https://github.com/llvm/llvm-project/files/14729114/Files.zip)

* .clang-tidy:
```
---
Checks: >
        -clang-analyzer-apiModeling.Errno,
        -*,
```
* simple.c
* CMakeLists.txt:
* compile_commands.json
* SuperCall.clang-tidy
* Suppress_clang-diagnostic-error.clang-tidy
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysV0tv2zgQ_jX0ZWBBoiw_Dj4oTryXZnfRtGhvAUWOLNY0KZBUHPewv31Byu843RZdI7GlETnPb-ajmHNypRHnpLgjxf2Adb4xdr5UzDVPDVopmB5URuzmhObw5LF14A18xNYa0XEkeUnSe5KWX6RvwDcIzHvGGxRAxmnCFdOroZdiR8YpEDpl4OSmVbKWKOAFrZNGg6nBdBY0I4uclMuXqAQ3rQ-mhHSsUghMKeAN8jVaB1IDA9dVQlrk3tgdbBGEFJo8UDJNyWzmwWw1oTNCF-DtLrpWG6XMVurV0ev99zjt_6C_P3kNw-ELWlnvhtzoWq567zHhb1cenlypvLBDc3h4bZF7FPARXae8O3_-t8UaLavULnrd4F5pSOVlJqV-MZz5kLyt6ZQAi76zGlzHOTqXACyZVFKvwDfMH7SRcXoVz5Uu10RlW2Z13Bh39Ss7uzfHHHSacY6tD3VJrgMsue-YugrvMhs_n98_zd48oLXGOhDoY_ouzf64Fg9hK8lL0KZHkAPUwfejlh405bi_3dtG3hggdETyZS_I_qO0X4xdM2s6LfZ2dQ9cDdJaVPjCtD9AmOR34BDfdMxT16JdMKUuW-cE2B9kss_UsJYKSX5_S9M1SG_Hmd7sjatoQ8Af5Eb6CIt9wK-tklx6tdt3bQDgEbtCspU2zks-jMUM2BMGHWjjYWvsOgH4rLnZbFD3yKvMqgu9zlUX54TUQdsxhvO0_HpyWovOPd927f2UZT0QYYUaLTsBMWIMto1UCK01o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