Convert a CppCheck XML report to a GitLab-compatible Code Quality JSON report
Project description
cppcheck-codequality
About
I wanted reports from CppCheck to appear in GitLab Merge Requests as Code Quality reports, which is a JSON file defined by the Code Climate team/service.
That's all this does: convert CppCheck XML to Code Climate JSON.
Usage
CppCheck already has a script to convert its XML report to HTML for easy human reading. See "Chapter 11 HTML Report" in the CppCheck Manual v?.?
This script follows that example and provides similar command-line options. So usage is as follows:
# Generate CppCheck report as XML
cppcheck --xml --enable=warning,style,performance ./my_src_dir/ 2> cppcheck_out.xml
# Convert to a Code Climate JSON report
python3 -m cppcheck-codequality --input-file=cppcheck_out.xml --output-file=cppcheck.json
Now, in your GitLab CI script, upload this file as a Code Quality report.
my-code-quality:
script:
- [...]
artifacts:
reports:
codequality: cppcheck.json
Contributing
Credits & Trademarks
CppCheck is an open-source project with a GPL v3.0 license.
"Code Climate" may be a registered trademark of Code Climate, Inc. which provides super-cool free and paid services to the developer community.
"GitLab" is a trademark of GitLab B.V.
All other trademarks belong to their respective owners.
Project details
Release history Release notifications | RSS feed
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 cppcheck_codequality-1.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0665eff4824268817b4f9cd0b453c26e943e363fa902d93d0aae8259cbbbc377 |
|
MD5 | 7c4595e3e4c5eebd596668a2da5b67b8 |
|
BLAKE2b-256 | 74eaf077a4381290c32c865bd5a2ee9a6249a8da58f62fb72e12ee172ceb4754 |
Hashes for cppcheck_codequality-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0af77e28f5e01e545efb6061e9425bef554921eda071dc9a879b281d2352748 |
|
MD5 | 4c2f829de252d3ed026c7cea9e2a5b46 |
|
BLAKE2b-256 | f53b26ea4d42382f9cff23e96ce3d49aad2955c11d7c706dcef3d9a7c5e12fa3 |