tomasbjerre / violations-lib

Java library for parsing report files from static code analysis.
Apache License 2.0
148 stars 39 forks source link

New Android Severity Fatal #121

Closed NitroG42 closed 3 years ago

NitroG42 commented 3 years ago

On an Android project, while messing with the AndroidManifest, I got lint to throw this output:

    <issue
        id="Instantiatable"
        severity="Fatal"
        message="`NavigationMapFragment` must extend android.app.Activity"
        category="Correctness"
        priority="6"
        summary="Registered class is not instantiatable"
        explanation="Activities, services, broadcast receivers etc. registered in the manifest file (or for custom views, in a layout file) must be &quot;instantiatable&quot; by the system, which means that the class must be public, it must have an empty public constructor, and if it&apos;s an inner class, it must be a static inner class.">
        <location
            file="..."
            line="54"
            column="33"/>
    </issue>

Unfortunately, the severity Fatal is treated as info following the code in https://github.com/tomasbjerre/violations-lib/blob/master/src/main/java/se/bjurr/violations/lib/parsers/AndroidLintParser.java :

  public SEVERITY toSeverity(final String severity) {
    if (severity.equalsIgnoreCase("ERROR")) {
      return ERROR;
    }
    if (severity.equalsIgnoreCase("WARNING")) {
      return WARN;
    }
    return INFO;
  }

I'm using latest Android Studio 2020.3.1 Canary 11. They either added this type or I just saw this now because when the gradle task fail when generating the lint, before it would output errors, now you have to go in the report to see what was preventing the build

tomasbjerre commented 3 years ago

Should be fixed now.