Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

android

ktlint

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?

like image 480
Belphegor Avatar asked Jan 27 '26 00:01

Belphegor


1 Answers

ktlint {
    filter {
        exclude("**/generated/**")
        include("**/kotlin/**")
    }
}
like image 121
العبد Avatar answered Jan 28 '26 16:01

العبد