add_if_missing() does not allow multiple --suppress arguments
Closed this issue · 2 comments
Adding a --suppress
to the args in the pre-commit-config.yaml like so args: ["--suppress=*:*test*"]
will prevent the hook from adding the other default --suppress
present in the cppcheck.py :
self.add_if_missing( ["--suppress=unmatchedSuppression", "--suppress=missingIncludeSystem", "--suppress=unusedFunction"] )
This is because the add_if_missing() function will see that a --suppress
was already added in the args field so it will not add it again.
So far as I understand your question, this is working as intended. If you want to override the default options, this is the way that you can.
Why not use args: ["--suppress=*:*test*", "--suppress=unmatchedSuppression", "--suppress=missingIncludeSystem", "--suppress=unusedFunction"]
?
Closing due to inactivity.