【问题标题】:How do you tell ktlint in android to exclude specific paths in the project?你如何告诉android中的ktlint排除项目中的特定路径?
【发布时间】:2021-03-11 09:42:30
【问题描述】:

目前,当我想格式化我的代码时,我在我的 android studio 目录的终端中运行它

https://github.com/pinterest/ktlint

./gradlew ktlintFormat

这个命令效果很好,但是最近我在我的项目中添加了一些文件夹,并且其中的代码正在被 ktlintFormat 命令检查。我希望从检查中排除这些文件夹。有谁知道这是否可能?

【问题讨论】:

    标签: android ktlint


    【解决方案1】:
    ktlint {
        filter {
            exclude("**/generated/**")
            include("**/kotlin/**")
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-10-26
      • 2012-10-28
      • 2021-12-12
      • 2012-06-29
      • 2021-12-29
      • 2012-11-11
      • 1970-01-01
      • 2018-01-13
      相关资源
      最近更新 更多