How do you tell ktlint in android to exclude specific paths in the project?

9.7k views Asked by At

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?

1

There are 1 answers

1
العبد On BEST ANSWER
ktlint {
    filter {
        exclude("**/generated/**")
        include("**/kotlin/**")
    }
}