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

    <tr>
        <th>Summary</th>
        <td>
            clang-tidy => run-clang-tidy fails when compile_commands.json contains non source files
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          i-C-o-d-e-r
      </td>
    </tr>
</table>

<pre>
    I am using **clang-tidy** in version **15.0.1** and the corresponding helper script **run-clang-tidy** under Windows 11 with MSVC. The compile_commands.json for my project contains a command for the Microsoft Resource compiler:

```
{
  "directory": "E:/MyProject",
 "command": "C:\\PROGRA~2\\WI3CF2~1\\10\\bin\\100226~1.0\\x64\\rc.exe /fo <...outputPath...>\\Resources\\Main.rc.res <...inputPath...>\\Resources\\Main.rc",
  "file": "<...path...>\\Resources\\Main.rc"
}
```

The helper script **run-clang-tidy** runs clang-tidy (and therefore clang) on the file Main.rc. This produces clang-diagnostic-errors as the file is no valid C/C++ source file.

So the bug is that **run-clang-tidy** runs clang-tidy on every file in compile_commands.json, even if files are no C/C++ source code files.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVMFu4zYQ_RrqMhBBUrIjH3RwlLjYQ9Agu-geC4qkLS4kUuBQzvqSby8oyXUWTYEsYEgaznvj94ZDSkR7csbUZHNPNg-ZnGLnQ23zJve5zk0estbrS_0F5AATWncCIvZE7FUv3SmPVl-WGKyDswlovVsRfEMZ5WtWOg2xM6B8CAZH73Qq1Zl-NAFQBTvGlRYml_-n-OS0CfDdOu1fETiHVxs7ePr6V0Ph21x2GG1v_lZ-GKTTSH-gd3D0AYYLjMH_MCqC8i5K6xAkrLgZkWQ9WRU8-mOEF4N-CurfkoEUe8IeCLs-t2z9LeHd_fIBQITQNhgVfbgQIUixT0uPiS8OT5fnRUXKiGblECFWJTdCkwibhmya55c__3jZv4kl-v6laA7ijS8RZ8u7te66wITYvnG6Jn5uy-UjKGp-GiDicPRAioZS6qc4TvFZxo5SSorHBXh1jkv4JK2jQdFgcKVZ92nWLy6Tq6Ptzc3jUm_8dKm11Q8fb8H8TFPw6XEKk0O4rQIR1TqgwRx9MEuOiB14N89Hkg_XjsC3zmKaKj0pc62jrTw5j9Gq3ITgA4LEG9UiOA9n2VsNDRGHhoh7Iu5hnbWEoe_dfPUzt51OiRo7-Vt2vANzNuGy_rf7-HgQ0SSYA3ucgQgymCTzA4HK60UlrjIzXRd6V-xkZmq-vSuqbSFElXU12xVc7nabO805a0vJKla2vBXVTmi2aavM1oKJgnG-5YwxUVFeyOOu1BtWlqqSdxUpmRmk7WnfnwfqwymziJOpt4xty6yXrenxel2FOoHydjohKVlvMeKNFm3sTf1-m4sHUjzCrz2Eo7Q9wmtn_qdPt3vDefd-xzCbQl93MY64HHIiDicbu6mlyg9EHJKS9ZWP1-N_mN0gEYfZ0D8BAAD__2x9soQ">