Ktlint Dont't Ignore Generated Folder Created By SQLDelight

160 views Asked by At

I'm in a Kotlin Multiplatform App project in Android Studio and using the JLLeitschuh gradle plugin(12.0.3) https://github.com/JLLeitschuh/ktlint-gradle for Ktlint.

Ktlint don't ignore the generated folder that's created by SQLDelight in my shared folder.

I tried to put the followig code to my .editorconfig according to https://pinterest.github.io/ktlint/latest/faq/#how-do-i-disable-ktlint-for-generated-code

//.editorconfig
root = true 
[*.{kt,kts}]
disabled_rules = "multiline-if-else, no-wildcard-imports"

[**/generated/**/*] 
ktlint = disabled

But when I run ktlintCheck it still shows me the errors in the generated folder.

I also tried


//build.gradle.kts(:shared)
...
ktlint {  
    filter {  
exclude { element -> element.file.path.contains("generated/") }  
    }  
}
...

and


//build.gradle.kts(:shared)
...
ktlint {
    filter {
        exclude("**/generated/**")
        include("**/kotlin/**")
    }
}
...

But now approach works for me.

I don't know why its not working.

I would very be glad for some advices.

0

There are 0 answers