Skip to content

Commit

Permalink
cppcheck: add SCA_CPPCHECK_CHECKLEVEL option
Browse files Browse the repository at this point in the history
to configure the behavior of check-level of cppcheck,
which has been introduced lately.
Defaults to normal (other option being exhaustive)

Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>
  • Loading branch information
priv-kweihmann committed Dec 2, 2023
1 parent ac51d23 commit a8b4164
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions classes/sca-cppcheck.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ SCA_CPPCHECK_RUNMODE ?= "fast"
SCA_CPPCHECK_MAX_CONFIG ?= "1"
## Config to use
SCA_CPPCHECK_LIBRARY ?= "std.cfg"
## Check level - normal or exhaustive
SCA_CPPCHECK_CHECKLEVEL ?= "normal"

SCA_RAW_RESULT_FILE[cppcheck] = "xml"

Expand Down Expand Up @@ -127,6 +129,7 @@ python do_sca_cppcheck() {
_args += ["--max-configs={}".format(d.getVar("SCA_CPPCHECK_MAX_CONFIG"))]
_args += ["--enable=warning,style,performance,portability,information"]
_args += ["-j", d.getVar("BB_NUMBER_THREADS")]
_args += ["--check-level={}".format(d.getVar("SCA_CPPCHECK_CHECKLEVEL"))]
_args += ["--inline-suppr"]
_args += ["-I", d.getVar("STAGING_INCDIR")]
for item in _add_include:
Expand Down
3 changes: 2 additions & 1 deletion docs/conf/module/cppcheck.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ For further explanations on the variables see the manpage of cppcheck
| SCA_CPPCHECK_EXTRA_FATAL | Extra error-IDs leading to build termination when found | space-separated-list | ""
| SCA_CPPCHECK_CHECK_DEPTH | Depth of analysis - higher value = higher effort | int | "3"
| SCA_CPPCHECK_ADD_INCLUDES | Additional paths leading to includes | space-separated-list | ""
| SCA_CPPCHECK_CHECKLEVEL | Check level - normal or exhaustive | space-separated-list | "normal"
| SCA_BLOCKLIST_cppcheck | Blacklist filter for this tool | space-separated-list | "linux-*"

## Supports
Expand All @@ -28,7 +29,7 @@ For further explanations on the variables see the manpage of cppcheck
* [x] terminate build on fatal
* [x] run on recipe
* [ ] run on image
* [ ] available in SDK
* [x] available in SDK
* [x] run with SCA-layer default settings (see SCA_AVAILABLE_MODULES)

## Requires
Expand Down

0 comments on commit a8b4164

Please sign in to comment.