I'm working on a big c++ project, using cmake/QtCreator.
The code has been around for a long time and so build times are slow.
I believe removing unused includes would reduce this build time significantly.
In my IDE (QtCreator), the most common warning relating to includes is the following :
Included header something.h is not used directly (fix available)
Calling the fix on all instances using the QtCreator's GUI would be painfully slow, which makes me wonder :
Is there a way to script this ?
call clangd on my
compile_commands.jsonask it to only log the specific warning (
Diagnostics.UnusedIncludes),apply the suggested quick fix using clang-tidy
I tried to call clangd with my path to compile-commands as well as clang-tidy but it neither wrote the checks nor applied the fixes, simply telling me that I should not call clangd from the command-line :/ source for the warning name: https://clangd.llvm.org/config#unusedincludes