I am trying to set up a script that runs cppcheck only on the files changed in a git diff, but seem to be experiencing some nondeterminism. I have seen the pre-commit script, but edited it to use the --project flag since my project uses a compile_commands.json generated by CMake.
The command looks something like:
The ignore paths, changed file paths, and path to project database are all paths relative to the current directory.
I was originally specifying the project before the file fitlers, and was getting cppcheck: error: could not find any files matching the filter. After seeing the advice here, I moved the --project flag to the end. It worked once but the next time I got cppcheck: error: could not find any files matching the filter. again.
Platform is x86_64, CentOS 7 Linux
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to set up a script that runs cppcheck only on the files changed in a git diff, but seem to be experiencing some nondeterminism. I have seen the pre-commit script, but edited it to use the
--project
flag since my project uses acompile_commands.json
generated by CMake.The command looks something like:
the cppcheck invokation expands to:
The ignore paths, changed file paths, and path to project database are all paths relative to the current directory.
I was originally specifying the project before the file fitlers, and was getting
cppcheck: error: could not find any files matching the filter.
After seeing the advice here, I moved the--project
flag to the end. It worked once but the next time I gotcppcheck: error: could not find any files matching the filter.
again.Platform is x86_64, CentOS 7 Linux