Exclude files from Android Studio lint spell checker

五迷三道 提交于 2019-12-22 02:07:03

问题


The Android Studio lint spell checker flags hex codes that look to it like words in certain files that would be better off unchecked, such as values/colors.xml and build/intermediates/dex-cache/cache.xml.

How do I tell lint to not spell check certain folders or files?


回答1:


This can be done by using IDE scopes. In Android Studio (at least 3.4) you can configure each inspection per scope. The idea is that you create a scope that contains all files you don't want to be spellchecked, and then switch Spelling inspection off for this scope, but keep it on for everything else.

  1. Add a new scope in Settings / Appearance & Behavior / Scopes that contains all files which you want to exclude from spell checking. For example, this pattern covers all svg files: file:*.svg. In your case it could be like file:*/colors.xml||file:*/cache.xml. IDE will highlight all affected files by green, so you can check if you entered correct pattern.

  2. Then set up Spelling inspection, so that it is OFF for your new scope and ON everywhere else.




回答2:


Had the same problem with colors.xml

I couldn't find a way to disable the check for a certain file, but I could get rid of the spellcheck on the hex codes.

Click Analyze->Inspect Code. Choose Whole Project and click OK.

The inspection tool window will open with the results.

You should be able to see the problematic hex codes under Spelling->typo. Right click any one of them and choose Exclude.

Did the trick for me. HTH



来源:https://stackoverflow.com/questions/29321702/exclude-files-from-android-studio-lint-spell-checker

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