Add --error-exitcode=1 to cppcheck to fail on errors#513
Add --error-exitcode=1 to cppcheck to fail on errors#513
Conversation
Cppcheck was returning exit code 0 even when errors were detected, causing CI to pass when it should fail. Adding --error-exitcode=1 ensures cppcheck returns non-zero when any errors are found. Fixes #446 Signed-off-by: Jose Luis Rivero <jrivero@honurobotics.com> Generated-by: claude-opus-4-5-20251101
azeey
left a comment
There was a problem hiding this comment.
Thanks for looking into this. I was really hopeing someone would find the time to fix this. However, before we merge/release, we should check that it doesn't break CI in downstream libraries.
Summary of downstream:
Looking into stable branches, the problems are being silently ignore https://github.com/gazebosim/sdformat/actions/runs/21492493963/job/61918436059 |
Signed-off-by: Jose Luis Rivero <jrivero@honurobotics.com>
Signed-off-by: Jose Luis Rivero <jrivero@honurobotics.com>
|
I have changed gears, we can not make all cppcheck in the first pass as mandatory, too noisy with fool warnings on standard headers. The second pass without any custom configuration seems fine to enable, making sdformat to fail with some macros that needs configuration: I want to run this on all the libraries, still on it. In draft by now. In my mind: we should use a modern tool that can replace the cppcheck. |
+1. Maybe clang-tidy? |
🦟 Bug fix
Fixes #446
Summary
Cppcheck was returning exit code 0 even when errors were detected, causing CI to pass when it should fail. Adding --error-exitcode=1 ensures cppcheck returns non-zero when any errors are found.
Checklist
codecheckpassed (See contributing)Generated-by: Opus 4.5
Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-byandGenerated-bymessages.