Convert Valgrind XML to GitLab Code Quality JSON file.
Project description
valgrind-codequality
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.
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
Built Distribution
Hashes for valgrind_codequality-1.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ab18599bd41df8769fcf13934b437d1342c88405c749466815614d055dea505 |
|
MD5 | b99f4de384c013d3a1acfee5b0abc6cc |
|
BLAKE2b-256 | 73bcb5ec8db18c4a4227284399fea103ebbea45690067e43e7111dbae9111f2e |
Hashes for valgrind_codequality-1.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eaf4c29950991f1aca26375faccd31a046c92ee31f7fdce56d32f6db4a4ce06c |
|
MD5 | e488a360de464aabd682c23a96ba725d |
|
BLAKE2b-256 | 07f477ca2cb3fa2131ace31684559d1bedac9c181529d38d836c263a797cb47c |