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

    <tr>
        <th>Summary</th>
        <td>
            check_clang_tidy.py does not support checking warnings on headers
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            enhancement,
            clang-tidy,
            new issue
      </td>
    </tr>

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

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

<pre>
    I am writing a clang-tidy check that checks for the usage of "static" in headers, which is as problematic as anonymous namespaces in headers.

The check works fine, but I'm having a hard time to test it, since all the expected warnings exist only in a header file that I put in the `Inputs` folder and then include in the test:

- Since I don't have any `CHECK_MESSAGES` line in the .cpp test file, `check_clang_tidy.py` fails an assertion.
- If  remove that, none of the `CHECK_MESSAGES` the script can run, but none of the `CHECK_MESSAGES` I added in the header file under test are taken into account.

Would it be possible to add this functionality? Alternatively, is there a way for me to "simulate" including the header in the test .cpp file?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyElEFv6zYMxz-NfCEaOHIcJwcfurbZgmGnDtixoCXG1p4sGRKVPO_TD7LTvgwbsEuiSBT1-_NPBmM0vSNqRf2TqF8LTDz40CoM1sce7ZX-morO67k9A45wC4aN6wFBWXT9Exs9gxpIfQMekNdlhIsPwANBitgT-AsIKSMjGyWkBONgINQUopAvcBuMGsBEwAhT8J2lMQfmn-i8m0efIjgcKU6oKD7c3ojyVZTP6-fvA91Bbj5kBOMop-8Sw1nIZoQBryv6gEEDm5GAPTBFBsM5NBqnCNDahZ2-T6SYNNwwOOP6CPTdRAbv7Jwh8I4BF2NpVX-GKXE-y_fFvjy7KXEU-xIu3uZQdDqfOTBO2aTpMzZDiOr5Uc8TvC84Z9DeCdlw5idAN-fML7-8vfz68dvb-_vzz2_v-QVr3Fe6jZqmVVhmy9LEvlyK87HY9pFt20zzQobG5koDxkiBjXebT4DzBSDQ6K-rvJzHebf4eRf4b4x8EFUwE4NCByG5TxP-9-oZUGvSnyIeq5tcXi6KMBAwfltqyB5QKZ8c_6MV_vDJajAMHcHkYzSdXaxGnatvIlySU1kpWsOzqE7wbJmCQzZXsnMGNjEzBAKEG85LP6_tkhvZjMki09rK2cfcVg_ID6auViwuVKdCt5U-VkcsqN3um2112FcHWQwt4vHQXOpd2Rw6alS32ze1In2kSur9VlaFaWUp5VZuD9umPu7kBpWkY9cpkqQr3dRiV9KIxm6svY4bH_rCxJiorY91sy8sdmTjMuJSkhvQKRrJsZBSyBch5Y9h_tpydIMlR96pX4vQ5tRPXeqj2JXWRI4_HmPDltr_6DDQniI4zxDTNPlw_4fIBfsaK_810EUKth2Yp5iHQZ6EPPWGh9RtlB-FPOX37l9PU_B_kmIhTwtlFPK0iP07AAD__0LKmsw">