Skip to content
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

Add cppcheck to CI/CD #733

Open
zjeffer opened this issue Jan 19, 2025 · 1 comment
Open

Add cppcheck to CI/CD #733

zjeffer opened this issue Jan 19, 2025 · 1 comment

Comments

@zjeffer
Copy link
Collaborator

zjeffer commented Jan 19, 2025

To improve code quality, performance, and avoid bugs, we could run cppcheck: http://cppcheck.net/ and check for improvements (similar to clang-tidy).

I've tested it out on the repo with the following options:

cppcheck --enable=all --inconclusive --force --inline-suppr --library=qt --project=build/compile_commands.json --suppress="*:3rdParty*" --suppress="*:build/*" -i 3rdParty/ -i build --suppress=missingIncludeSystem --suppress=missingInclude --quiet -j$(nproc) --disable=unusedFunction --check-level=exhaustive 2>&1 | tee cppcheck.txt

Some of the suppressions are because we don't care about 3rdParty code, and because some false positives are popping up (missing includes when they aren't actually missing).

Here's the output: cppcheck.txt

Cppcheck can be integrated into PRs with GitHub actions so that when a user submits a PR, a cppcheck bot will 'review' the PR and leave comments to improve the code. We should also run it periodically to check for improvements.

@nuttyartist
Copy link
Owner

Sounds good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants