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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa02037f3bbd6f680b4dacccd4e131bad4fcb01006fb72d3133476e8f7e26373 |
|
MD5 | 320b3e1cde23137cb08d2bfc469698ff |
|
BLAKE2b-256 | 959a90bdb8ec1b8c998359830a1ff932c93c0805a746b7055102307a48b8d46b |
Close
Hashes for android_lint_to_glcq-0.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ac19326ea7b041a5e6ac72183f9c11575f4170b9431626f60de9fe1b5773d1e |
|
MD5 | e6bef8da3cac58b8c8d05d8424ba97e6 |
|
BLAKE2b-256 | 6e3cd993ed7835474bcf855c5c68fd0c8c94ae17cbdd8d25b2f283f3b162b81d |