Convert android gradle lint outputs to a GitLab valid json code quality result file
Project description
Android Lint to Gitlab Code Quality Report
Convert android gradle lint outputs to a GitLab valid json code quality result file.
Thanks to the author of the original project ansible-lint-to-junit-xml and to author of yaml-lint fork yaml-lint-to-junit-xml
Quickstart
Install android-lint-to-glcq
with pip:
pip install android-lint-to-glcq
Or you can simply get this repo and install with setup.py
Usage
Run ./gradlew :app:lintDebug
and use a file to pass the output
./gradlew :app:lintDebug
android-lint-to-glcq <relative path to lint xml report> <absolute path to project root> > <output file>
Features
- Output JSON file is compliant with gitlab code quality schema , so you can use it to artifact as report
Example
Running ./gradlew :app:lintDebug
on my Android project results in:
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 7.0.1">
<issue
id="FragmentTagUsage"
severity="Warning"
message="Replace the <fragment> tag with FragmentContainerView."
category="Correctness"
priority="5"
summary="Use FragmentContainerView instead of the <fragment> tag"
explanation="FragmentContainerView replaces the <fragment> tag as the preferred way of adding fragments via XML. Unlike the <fragment> tag, FragmentContainerView uses a normal `FragmentTransaction` under the hood to add the initial fragment, allowing further FragmentTransaction operations on the FragmentContainerView and providing a consistent timing for lifecycle events."
url="https://developer.android.com/reference/androidx/fragment/app/FragmentContainerView.html"
urls="https://developer.android.com/reference/androidx/fragment/app/FragmentContainerView.html"
errorLine1=" <fragment"
errorLine2=" ~~~~~~~~">
<location
file="/Users/vlad/StudioProjects/Company/fleet/app/src/main/res/layout/activity_main.xml"
line="13"
column="10"/>
</issue>
</issues>
Running android-lint-to-glcq
on gradle lint outputs looks line this:
./gradlew :app:lintDebug
android-lint-to-glcq app/lint/reports/lint-results-debug.xml /Users/vlad/StudioProjects/Company/fleet/ > results/android-lint-results.xml
Would result in:
[
{
"description": "Use FragmentContainerView instead of the <fragment> tag",
"severity": "major",
"fingerprint": "f753a37f26e791db8d499657e23f9caa",
"location": {
"path": "fleet/app/src/main/res/layout/activity_main.xml",
"lines": {
"begin": "13"
}
}
}
]
And final result:
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
Close
Hashes for android-lint-to-glcq-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfda8368d032655ce468a91cafc2f3d65a850ff297ff5fcbc8b1d9e706c6acfe |
|
MD5 | 7e78fde81f1d41d9a84349c5ed1e97b6 |
|
BLAKE2b-256 | c49d1aa3fdc9d3657f70e478bdd89a388aa53e18c1e34073aff7d2e8ee19ea7b |
Close
Hashes for android_lint_to_glcq-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c43040c62f539101ed835f5cc5f030fb6c8ce0f795200c93573425c35758969 |
|
MD5 | 3b27f44bbca341579d1e766e10b6f677 |
|
BLAKE2b-256 | 1e2b97c38777b700ae45a4ae38c87c18df1adb5a823d40f8b2862aaf1d98cf72 |