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

    <tr>
        <th>Summary</th>
        <td>
            Running clang-tidy on headers
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    Hi!
We use scripts on CI to select only changed files that have to be run by clang-tidy to decrease time consumption. As we use cmake, we supply `-p` option to a cmake build folder, but in some cases changed files are headers only, and `compile_commands.json` contains info only about cpp units.
It leads (I beleive so) to some problems with `#include` statements in that headers, clang-tidy can't find them.
So I have a questions:
- Is that a correct move to run clang-tidy with cmake generated build files on a header file?
- If yes, then how it finds all include directories?
- If no, is there any solution, besides dropping header files from being selected as 'changed'?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxck0GT4yYQhX8NunTZJSPbWh10mOyWK74mhxxTLWhLzCBaoWFczq9PIXkSZ08qAc37-r0GRdwYiHp1-kWdflSY08SxHyngB_6NZqKPamD76H91Sh9U_UPVb38QZCEQE92SBDjA9yskBiFPJgEH_wAzYRjJws15EkgTJpjwk8qxgSDmAMMDjMcw7pKzj7JuyURCIUhuJjAcJM9Lchz28CZw30TNjB-k9PfyL3lZ_APUud4t6lwDr6fLVbidgyE7b-HG3lIsRUNO4AIIFwEUkp84MRJMhJairG2UGgy2SBieF-fpT8PzjMHK_l04FFXDIaELAi7ceGseB84JzLJADi7JfrPtmsATWgGlv11hIE_uk0BY6W51r0AtkQdPs8DdpanIKt24YHy2VLQkYaKZQipqT1c33EL6YqfBoHSb4OaChTTR_GT4neG6BYHwVyYpholq3rbdHVyfWSEYjrGkOfOWWonsRWDl20weKVDERPbL7tVKDoBPuHVFNZd_RW7woJU4TRRg4ju4DVUAvYdnw2BdIeDoSP5fHbgUu8JKkQDDA4R9Ls2sKZM4SwI28rK4ML5iCNwizzBQWd8GlixgCaV9zoLSrWoule0b2zUdVtQfzq1um6bp2mrqb4NpbXNuiYZDczJ41DVRez6e6oG62naV63Wtm_pQN_W3uju1-2NTd93ZnlEPBzJI6ljTjM7vvf-c9xzHyolk6k9d250qjwN5Wd-j1oHusG4qrcvzjH2p2Q15FHWsvZMk_92SXPLU_5ZDKM29hMXha0yqHH0_pbSsoeuL0pfRpSkPe8Oz0pdy1_OzWyK_k0lKX1YCUfqyEv4TAAD__xfkaVY">