Context of lint.xml and inspection profile

巧了我就是萌 提交于 2019-11-30 08:27:06

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:

  • You can run gradlew lint from the Terminal inside Android Studio. It will create a html page at /build/outputs/lint-results-debug.html or at any file position specified.
  • 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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!