Replies: 2 comments 7 replies
-
This question is not specific to cpp-linter. I suspect that the generated compilation database does not include any files from the test sources. Are tests compiled as a separate target? I see your project uses conan to drive test builds. I'm not well versed enough to investigate this. Again, this isn't an issue with cpp-linter, rather this is more of an issue with the generated database regarding test sources (& likely third-party dependencies fetched/built using conan). |
Beta Was this translation helpful? Give feedback.
-
This is not typically done, but it is a solution if the project only uses 1 target/compiler (& C lib version). Looking at the workflow, I don't see any command to invoke CMake for generating the compilation database before running cpp-linter. clang-tidy can't find a database that isn't there (after a clean checkout). |
Beta Was this translation helpful? Give feedback.
-
I have this GitHub Actions job:
I have just enabled the
tidy-checks
setting that variable to''
.I have set
CMAKE_EXPORT_COMPILE_COMMANDS
in the outermost CMakeLists.txt:clang-tidy seems to work well with the
src
directory but, for thetest
directory, it complains not being able to find some files. Although I'm not really sure what file or files caused the reported errors.This is the GitHub Actions output.
[Question 1] Any idea how to fix these errors?
I have seen similar errors when running the linters locally. And I saw that, depending if I was building with gcc or clang, the
compile_commands.json
would be different and lead to different results when runningclang-tidy
.[Question 2] Should I add a
compile_commands.json
file to my codebase, and provide it as an input to cpp-linter?Many thanks!
Beta Was this translation helpful? Give feedback.
All reactions