Skip to main content

Tool to create suppression files for Cppcheck from its results.

Project description

cppcheck-suppressor

A tool that creates suppression file from Cppcheck results that can be used as a baseline to run further Cppcheck analysis, highlighting any new errors in the analyzed code.

Setting a baseline helps to see new issues. However, all the errors reported by Cppcheck before setting a baseline should be reviewed with care.

Installation

Install the latest cppcheck-suppressor with

pipx install cppcheck-suppressor

or the python package with

pip install cppcheck-suppressor

Usage

To use the cppcheck-suppressor together with Cppcheck, first make a throughout analysis of your project with Cppcheck without any suppressions and save the results to a xml file:

cppcheck --xml src/ 2> cppcheck_errors.xml

This assumes your sources are in the src/ folder. Use the arguments for Cppcheck that you would use otherwise - just no --suppress or --suppress-xml arguments, and keep the --xml argument.

After creating the results with Cppcheck, use the cppcheck-suppressor to create a baseline from the results:

cppcheck-suppressor --file cppcheck_errors.xml --output baseline.xml

or

python -m cppcheck_suppressor --file cppcheck_errors.xml --output baseline.xml

And finally use the baseline in the further Cppcheck analyses:

cppcheck --suppress-xml=baseline.xml src/

Now, Cppcheck reports only new issues from the project. The baseline should be updated - especially when any errors are solved from the project.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cppcheck_suppressor-0.0.3.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cppcheck_suppressor-0.0.3-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file cppcheck_suppressor-0.0.3.tar.gz.

File metadata

  • Download URL: cppcheck_suppressor-0.0.3.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for cppcheck_suppressor-0.0.3.tar.gz
Algorithm Hash digest
SHA256 ab4f2d1def0c1ca2d760f73327914724cfc279d5ad82697692d0838f12e036ec
MD5 c202145665c0649428f61a7588af080b
BLAKE2b-256 10e680426479c755f7f78b9f4bfe959ae5baa5e3a1093b2250cf40e2815d4f7a

See more details on using hashes here.

File details

Details for the file cppcheck_suppressor-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for cppcheck_suppressor-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 38990b85396cdd188a22dd43af527313a9ad420204ba39403c330d01bd808c27
MD5 8620744732201ca0c19aafd279fbb352
BLAKE2b-256 94ba435457c97c437c80cad6f12f931e9d384ed7b619b65912c613d20a18793a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page