jmm
jmm

Reputation: 1064

Getting (almost) the same results when running AS inspections and gradle Lint

I have a similar issue than this one. I want to get the same results (as much as possible) when running code inspections from Android Studio and from a console Gradle task. When running from AS, I am using an xml Profile that defines some inspection tools, e.g:

<inspection_tool class="AndroidLintContentDescription" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintHardcodedText" enabled="true" level="INFO" enabled_by_default="true" />
<inspection_tool class="AndroidLintRegistered" enabled="true" level="INFO" enabled_by_default="true" />
<inspection_tool class="AnonymousClassComplexity" enabled="true" level="WARNING" enabled_by_default="true">

I am having big differences in results from AS and console (78 items in AS "Android Lint" section vs. 38 items in the console). How can I load this Profile when running Lint from console? Is this even possible?

Regards

Upvotes: 1

Views: 827

Answers (2)

Robert
Robert

Reputation: 434

You can run the Android Studio inspections from command line:

<android studio path>/bin/inspect.sh

https://www.jetbrains.com/idea/help/running-inspections-offline.html

Upvotes: 4

Scott Barta
Scott Barta

Reputation: 80010

Android Lint is only a subset of the inspections that you can run in Android Studio/IntelliJ. If you want the same results in both, you should disable any non-Android-Lint inspections in Android Studio.

Upvotes: 0

Related Questions