After thinking about the tool a bit, I concluded that the Clang-Tidy configuration also needs to be included in the hash. The (not so much documented) option --directories_with_clang_tidy=... could help there. However, I think that's not as handy as I want it to be. I think this has to be done by default. Furthermore, this flag could include configuration files which are even not of relevance for the processed file.
Therefore, I was hunting a more generic solution. My proposal here uses the Clang-Tidy tool itself. I'm asking it to dump the configuration for the file to be processed. In this way I don't have to scan for .clang-tidy files, but let Clang-Tidy handle that. This would even work if the user uses Clang-Tidy command line option --config-file.
Of course, the drawback of this solution is that it takes some time to execute Clang-Tidy to dump the config. Yet, it's unclear to me if that's much slower than reading and hashing all the .clang-tidy files. So if desired, we could add this as option.
After thinking about the tool a bit, I concluded that the Clang-Tidy configuration also needs to be included in the hash. The (not so much documented) option
--directories_with_clang_tidy=...
could help there. However, I think that's not as handy as I want it to be. I think this has to be done by default. Furthermore, this flag could include configuration files which are even not of relevance for the processed file.Therefore, I was hunting a more generic solution. My proposal here uses the Clang-Tidy tool itself. I'm asking it to dump the configuration for the file to be processed. In this way I don't have to scan for
.clang-tidy
files, but let Clang-Tidy handle that. This would even work if the user uses Clang-Tidy command line option--config-file
.Of course, the drawback of this solution is that it takes some time to execute Clang-Tidy to dump the config. Yet, it's unclear to me if that's much slower than reading and hashing all the
.clang-tidy
files. So if desired, we could add this as option.