【问题标题】:How to configure Lint to ignore google-services.json?如何配置 Lint 以忽略 google-services.json?
【发布时间】:2017-12-15 12:20:02
【问题描述】:

应该如何配置 Lint 以忽略 Firebase 配置文件,尤其是拼写检查? google-services.json 文件位于“app”模块文件夹中。

build.gradle (app)

    lintOptions {
        lintConfig file('lint.xml')
    }

由于 RtlHardcoded 检查已成功禁用,Lint 肯定会拾取以下 lint.xml 文件,但 Lint 仍会拼写检查 Firebase json 文件并在 Lint 报告的“Typos”标题下列出几个条目。

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

    <issue id="Typos">
        <ignore path="/google-services.json" />
        <ignore path="/app/google-services.json" />
        <ignore path="**/google-services.json" />
    </issue>
</lint>

如何指定忽略路径,以便 Lint 忽略 Firebase google-services.json 文件?

【问题讨论】:

  • 拼写检查不是 Android Lint 检查,它是 Intellij IDEA 检查,不是 Android Lint 的一部分,因此在这种情况下不支持 lint.xml

标签: android android-lint google-play-services


【解决方案1】:

您可以为拼写检查创建自定义范围:

https://www.jetbrains.com/help/idea/settings-scopes.html

然后通过Editor / Inspections菜单配置拼写范围:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-12-24
    • 2011-07-30
    • 1970-01-01
    • 1970-01-01
    • 2018-11-06
    • 1970-01-01
    • 2011-08-22
    • 1970-01-01
    相关资源
    最近更新 更多