Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement support for Android Lint format 6 #7

Open
damian-burke opened this issue Feb 28, 2021 · 2 comments
Open

Implement support for Android Lint format 6 #7

damian-burke opened this issue Feb 28, 2021 · 2 comments

Comments

@damian-burke
Copy link
Owner

damian-burke commented Feb 28, 2021

Seems like updating to AGP 7.0.0+ prints lint results in a new format 6 which is currently not supported.

Example report:

<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 7.0.0-alpha08">

    <issue
        id="CoroutinesStaticDispatcher"
        severity="Warning"
        message="Please inject a coroutine scope / context instead of referring to static Dispatchers."
        category="Testing"
        priority="6"
        summary="Do not use static Dispatchers, inject the requires ones"
        explanation="To give us more control over dispatchers and threading, we should inject a Coroutine context if required, &#xA;instead of using the static ones."
        errorLine1="        return withContext(Dispatchers.IO) {"
        errorLine2="                           ~~~~~~~~~~~~~~">
        <location
            file="/Users/damian.burke/StudioProjects/.../src/main/java/com/.../FirebaseDatabase.kt"
            line="21"
            column="28"/>
    </issue>


    <issue
        id="UnusedResources"
        severity="Warning"
        message="The resource `R.bool.isLightMode` appears to be unused"
        category="Performance"
        priority="3"
        summary="Unused resources"
        explanation="Unused resources make applications larger and slow down builds.&#xA;&#xA;The unused resource check can ignore tests. If you want to include resources that are only referenced from tests, consider packaging them in a test source set instead.&#xA;&#xA;You can include test sources in the unused resource check by setting the system property lint.unused-resources.include-tests=true, and to exclude them (usually for performance reasons), use lint.unused-resources.exclude-tests=true."
        errorLine1="    &lt;bool name=&quot;isLightMode&quot;>true&lt;/bool>"
        errorLine2="          ~~~~~~~~~~~~~~~~~~">
        <location
            file="/Users/damian.burke/StudioProjects/.../src/main/res/values/bool.xml"
            line="3"
            column="11"/>
        <location
            file="/Users/damian.burke/StudioProjects/.../src/main/res/values-night/bool.xml"
            line="3"
            column="11"/>
    </issue>
</issues>
@damian-burke damian-burke changed the title Implement support for Checkstyle format 6 Implement support for Android Lint format 6 Mar 14, 2021
@ashughes
Copy link

I just ran into this after bumping to AGP 7. We were using version 1.0.0 of danger-plugin-lint-report. I wasn't entirely sure from the release notes whether or not this issue was fixed, but I bumped to 1.4.1 and that appears to have fixed the issue. Thanks!

@damian-burke
Copy link
Owner Author

I just ran into this after bumping to AGP 7. We were using version 1.0.0 of danger-plugin-lint-report. I wasn't entirely sure from the release notes whether or not this issue was fixed, but I bumped to 1.4.1 and that appears to have fixed the issue. Thanks!

It wasn't really fixed, but the version picker is a bit more lenient so it just prints a warning that a certain version is untested but proceeds with parsing.

I'm not sure if there are any differences between format 5 and 6 in the Android Lint format, would need to check that with a side-by-side comparison (not sure if this is documented somewhere, a quick Google search didn't bring up much).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants