Skip to content

Commit

Permalink
Make cppcheck useable again
Browse files Browse the repository at this point in the history
This adds a few suppression rules for files that we don't change
(3rd-party, auto-generated filter language parser, system-wide headers).

It also prevents those files from participating in cppcheck's
"configurations", which is essentially a set of macros that are defined
simultaneously. By cutting down the number of macros, I improved the
runtime of `make CPPCHECK_JOBS=9 cppcheck` from 41 minutes to 47
*seconds*.

Some of the test files can't be analysed because Catch's macros are too
opaque for cppcheck to handle. I didn't suppress the whole "tests"
directory because there are some seemingly useful warnings in there.
  • Loading branch information
Minoru committed Jan 7, 2021
1 parent 339af18 commit cbd8f0e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -30,3 +30,4 @@ doc/podboat-cmds-linked.asciidoc
/target/
**/*.rs.bk
.vscode
/cppcheck.log
4 changes: 3 additions & 1 deletion Makefile
Expand Up @@ -283,9 +283,11 @@ fmt:

cppcheck:
cppcheck -j$(CPPCHECK_JOBS) --force --enable=all --suppress=unusedFunction \
--config-exclude=3rd-party --config-exclude=$(relative_cargo_target_dir) --config-exclude=/usr/include \
--suppress=*:3rd-party/* --suppress=*:$(relative_cargo_target_dir)/* --suppress=*:/usr/include/* \
-DDEBUG=1 \
$(INCLUDES) $(DEFINES) \
include filter newsboat.cpp podboat.cpp rss src stfl test \
include newsboat.cpp podboat.cpp rss src stfl test \
2>cppcheck.log
@echo "Done! See cppcheck.log for details."

Expand Down

0 comments on commit cbd8f0e

Please sign in to comment.