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
File details
Details for the file android-lint-to-glcq-0.1.3.tar.gz
.
File metadata
- Download URL: android-lint-to-glcq-0.1.3.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3da17db3f6553c8b1d3f3febe966facdf2f8619aa0c3542c852607206366cef |
|
MD5 | e040e86293f96b93a2e6cf183a4f9ddb |
|
BLAKE2b-256 | 27956ce7017d56e8877127dc6b3474eedee7af91b72fc60b67f9b6248e48d379 |
File details
Details for the file android_lint_to_glcq-0.1.3-py2.py3-none-any.whl
.
File metadata
- Download URL: android_lint_to_glcq-0.1.3-py2.py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 619d956d613ac0e95eb7c1372705cc1f6f1e42a439fe97ae1843b9e4fd4fc902 |
|
MD5 | 3fa5290be42f6dada60ccd358d31d6f7 |
|
BLAKE2b-256 | 490f9e959b841312b875638e14b0d822eb138f07c56a0a2be0d831f66142c361 |