ctcache icon indicating copy to clipboard operation
ctcache copied to clipboard

Support for .clang-tidy files

Open fekir opened this issue 10 months ago • 3 comments

Hi, it seems that ctcache does not take into consideration .clang-tidy files in folders and subfolders.

By that I mean that if one .clang-tidy files change, then the cache should be invalidated (at least partially), as the same C++ source file could trigger a warning that it did not trigger before.

fekir avatar Apr 29 '25 13:04 fekir

Hi, ctcache should include the relevant .clang-tidy configuration, it uses the --dump-config flag to do this. Did you see some real case where this doesn't work?

matus-chochlik avatar Apr 30 '25 20:04 matus-chochlik

I might need to give it a closer look, I'm currently not able to reproduce it anymore, maybe I tested it wrong (forgot to save the .clang-tidy file?)

Or it was a bad interaction when analyzing multiple files at once?

I execute clang-tidy with multiple files (something like find .... | xargs -P$JOBS -N$MAX clang_tidy_cache.py /usr/bin/clang-tidy-18 --quiet -p="/path/to/build/folder") and maybe the order of the files was not the same anymore.

Previously I had MAX>1, now when using ctcache, I use MAX=1 so that every file is cached separately.

Issue can probably be rejected.

fekir avatar May 02 '25 07:05 fekir

Hi, ctcache should include the relevant .clang-tidy configuration, it uses the --dump-config flag to do this. Did you see some real case where this doesn't work?

@matus-chochlik This sounds like the --directories_with_clang_tidy argument still used in example/CMakeLists.txt is obsolete and should be removed from the example.

dkar-sto avatar Aug 11 '25 07:08 dkar-sto