9

Currently when I want to format my code, I run this in the terminal in my android studio directory

https://github.com/pinterest/ktlint

./gradlew ktlintFormat

This command works great, but recently I added some folders into my project and the code in there is being checked by the ktlintFormat command. I wish to exclude those folders from being checked. Does anyone know if this is possible?

Belphegor
  • 1,683
  • 4
  • 23
  • 44

1 Answers1

11
ktlint {
    filter {
        exclude("**/generated/**")
        include("**/kotlin/**")
    }
}
العبد
  • 359
  • 5
  • 15
  • Doesn't work with JLLeitschuh/ktlint-gradle. See more here: https://github.com/JLLeitschuh/ktlint-gradle/issues/266. – Bartek Pacia Sep 26 '22 at 10:29