Android Studio and lint.xml

半世苍凉 提交于 2019-12-10 22:04:38

问题


I want to create a lint.xml file and share it on our VCS so all the project's contributors can use it. The Google documentation states:

If you are configuring lint preferences in Android Studio, the lint.xml file is automatically created and added to your Android project for you

It does not for my project. I do not know where it saves the changes that I make to the inspections. If I click on Prefercens => Editor => Inspections => Export, then it exports a totally different file structure:

<?xml version="1.0" encoding="UTF-8"?>
<inspections version="1.0">
  <option name="myName" value="Blabla" />
</inspections>

instead of lint's:

<?xml version="1.0" encoding="UTF-8"?>
<lint>
  <issue id="UnusedResources">
  <ignore ... />
  </issue>
</lint>

I would like to control my warnings in the IDE and if I click "Analyze => Inspect Code", in one place that can be shared on the VCS. Is that possible?


回答1:


Editing IntelliJ inspection settings is better it seems, it includes lint AND the extra IntelliJ inspections both, instead of just lint.

You can export and import IntelliJ inspection settings in Android Studio, and then share it with your team mates.



来源:https://stackoverflow.com/questions/35367189/android-studio-and-lint-xml

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