I use cppcheck via the CLI in a continuous integration test parcours. If cppcheck fails, my job fails. Thus, I am limiting the issues cppcheck tests in order to not halt the development completely.
More specifically, I currently use --enable=missingInclude,warning together with some --suppress.
How can I elevate specific, non-error and non-warning issue to let cppcheck fail, e.g. missingOverride, which is of the category "style" ?
--enable=missingOverride does not seem to work as enable only accepts error|warning|style|performance|portability|information|all
--enable=style is also no option because then I have way too many aspects to take care of to get my CI running again instead of fixing them iteratively
--enable=styleand then suppress everything else via --suppressions-list= also is problematic, as a new cppcheck version might have new check ids
Last edit: Philipp Hasper 2020-02-26
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The procedure you can use right now would be to add --enable=style and then suppress the warnings that you do not like. Are there lots of messages you do not like?
If you want to add something like --enable=missingOverride then well I think that technically that is OK. Feel free to add a github pull request.
If we would try to limit it so that each check will only be executed if it's enabled then I think it will be a lot of work for very little gain (cppcheck spends far more cpu time parsing the code and performing value flow analysis etc than on running checks). So I suggest that we filter the output; if --enable=missingOverride is given then all checks will be executed and the results will be filtered so no stylistic messages except missingOverride are shown.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@danielmarjamaki Yes, basically I want to suppress all but this one.
Okay, concerning the Github pull requests that's a good way to go however I am uncertain how complex the dev environment will turn out to be. I will see if I find some time for that.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
(I copied my question from https://stackoverflow.com/questions/60395271/ to have it in a place more suitable for feature discussions)
I use cppcheck via the CLI in a continuous integration test parcours. If cppcheck fails, my job fails. Thus, I am limiting the issues cppcheck tests in order to not halt the development completely.
More specifically, I currently use
--enable=missingInclude,warning
together with some--suppress
.How can I elevate specific, non-error and non-warning issue to let cppcheck fail, e.g.
missingOverride
, which is of the category "style" ?--enable=missingOverride
does not seem to work as enable only acceptserror|warning|style|performance|portability|information|all
--enable=style
is also no option because then I have way too many aspects to take care of to get my CI running again instead of fixing them iteratively--enable=style
and then suppress everything else via--suppressions-list=
also is problematic, as a new cppcheck version might have new check idsLast edit: Philipp Hasper 2020-02-26
The procedure you can use right now would be to add
--enable=style
and then suppress the warnings that you do not like. Are there lots of messages you do not like?If you want to add something like
--enable=missingOverride
then well I think that technically that is OK. Feel free to add a github pull request.If we would try to limit it so that each check will only be executed if it's enabled then I think it will be a lot of work for very little gain (cppcheck spends far more cpu time parsing the code and performing value flow analysis etc than on running checks). So I suggest that we filter the output; if
--enable=missingOverride
is given then all checks will be executed and the results will be filtered so no stylistic messages except missingOverride are shown.@danielmarjamaki Yes, basically I want to suppress all but this one.
Okay, concerning the Github pull requests that's a good way to go however I am uncertain how complex the dev environment will turn out to be. I will see if I find some time for that.