In Android Studio there is the lint.xml configuration and ./idea/inspectionProfiles/.xml manageable via Settings => Editor => Inspections. I understand lint.xml is used by lint command line tool and the inspection profile is used by Android Studio IDE.
The official documentation is here. I also found this post How is lint integrated with IntelliJ inspections in Android Studio? and this post Android lint on command-line missing issue groups (versus options available in Android Studio).
This answer has a good example of lintOptions{ } block in build.gradle.
Yet there is some information missing.
The lint.xml file A configuration file that you can use to specify any lint checks that you want to exclude and to customize problem severity levels.
I can sum up my research so far.
1.) Inspection Profile is extending lint.xml, so the number of lint.xml rules is smaller than the number of Inspection profile rules. The current lint.xml ruleset can be found here.
2.) When you have defined a lint.xml, in your Android Studio you can go to File => Settings => Editor => Inspections and use the Manage => Import dropdown towards your lint.xml. This will set all rule outside lint.xml to be deactivated.
I don't know of any way for convert from InspectionProfile into lint.xml.
3.) See 1.), Inspection Profile is extending lint.xml.
4.) As Inspection Profile is locally used and inside Android Studio, it is executed during runtime in the editor and on commit when analysis is checked. Your lint.xml is usually located in the project's root and submitted into SVN/GIT. Then your configuration server (Jenkins, QuickBuild etc.) can have a designated task to run this lint.xml and process its output.
Additional, helpful things:
When you open a lint.xml file in your Android Studio editor, a lot of content assist is provided for the rules. Nevertheless there seems to be a gap in the rulesets, as e.g. Convert2Lambda is in the example lint.xml, but not in the official documentation.
Despite that it is generally a bad idea to put ./idea under version control, for team distibution you can submit your Inspection Profile at /.idea/inspectionProfiles/MyInspectionProfile.xml and put every other file inside /.idea on ignore. There is an article on this topic I cannot find anymore, but this solution works like a charm for my team.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With