-
Notifications
You must be signed in to change notification settings - Fork 41
Add --error-exitcode=1 to cppcheck to fail on errors #513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: gz-cmake5
Are you sure you want to change the base?
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 <[email protected]> Generated-by: claude-opus-4-5-20251101
azeey
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
Signed-off-by: Jose Luis Rivero <[email protected]>
|
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. |
🦟 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.