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.3.1.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

valgrind_codequality-1.3.1-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file valgrind_codequality-1.3.1.tar.gz.

File metadata

  • Download URL: valgrind_codequality-1.3.1.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.10.17 Linux/5.15.154+

File hashes

Hashes for valgrind_codequality-1.3.1.tar.gz
Algorithm Hash digest
SHA256 e9aa8b6f6b69b902f6901b1e716b8c7db68b7813112b2219be90eb86150da0c7
MD5 ecaedd559774a3e72a4df570fdbf122e
BLAKE2b-256 dd230f8b5dacdb02887f102e80e29c9e087dc076c3be084722512ed336a4a916

See more details on using hashes here.

File details

Details for the file valgrind_codequality-1.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for valgrind_codequality-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b4a3a311e336b625ac8f773e45d6739629261b7594afeb58d7cc2243a6d32d49
MD5 f9d1dc4b988c2c674b9448c5bf2f43aa
BLAKE2b-256 5c964fee2f65aa0dd09242f2f5a518df2e0a4ecd0a5782dd4f0c2bd3924b5b34

See more details on using hashes here.

Supported by

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