Skip to main content

Convert Valgrind XML to GitLab Code Quality JSON file.

Project description

valgrind-codequality

badge-pypi   badge-pypi-downloads

badge-pipeline   badge-coverage   badge-pylint   badge-formatting   badge-issues-cnt

About

I wanted reports from Valgrind to appear in GitLab Merge Requests as Code Quality reports, which is a JSON file defined by the Code Quality's GitLab.

That's all this does: convert Valgrind XML report to Code Quality JSON.

Contributions are welcome.

"Buy Me A Coffee"

Usage

It is primarily used as a console script. As such, ensure you have Python 3's "scripts" directory in your PATH variable. For example, on Linux, that might be $HOME/.local/bin.

To test, try the --help or --version flags:

valgrind-codequality --help

This script follows that example and provides similar command-line options. A typical workflow might look like this:

# Generate valgrind report as XML
valgrind --tool=memcheck --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --xml=yes --xml-file=valgrind_out.xml your_exe
# Convert to a Code Climate JSON report
valgrind-codequality --input-file valgrind_out.xml --output-file valgrind.json

If you wanted, you could invoke the script directly as a module, like this:

# Run as a module instead (note the underscore in the module name here)
python -m valgrind_codequality --input-file=valgrind_out.xml --output-file=valgrind.json

Now, in your GitLab CI script, upload this file as a Code Quality report.

my-code-quality:
  script:
    - [...]
  artifacts:
    reports:
      codequality: valgrind.json

Contributing

Credits & Trademarks

valgrind is an open-source project with a GPL v3.0 license.

"GitLab" is a trademark of GitLab B.V.

All other trademarks belong to their respective owners.

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

valgrind_codequality-1.2.1.tar.gz (9.3 kB view hashes)

Uploaded Source

Built Distribution

valgrind_codequality-1.2.1-py3-none-any.whl (9.8 kB view hashes)

Uploaded Python 3

Supported by

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