kotlinter-gradle icon indicating copy to clipboard operation
kotlinter-gradle copied to clipboard

Task formatKotlin does not respect ignored directories.

Open strindberg opened this issue 1 year ago • 2 comments

We have configured the linter to ignore our (generated) code directory db like so:

tasks.lintKotlinMain {
    exclude("**/db/**")
}

This works fine. However, when running task formatKotlin, the formatter does not respect this setting but formats the code in the db directory.

strindberg avatar Aug 04 '23 10:08 strindberg

I got it to work this way: https://github.com/jeremymailen/kotlinter-gradle/issues/251#issuecomment-1577310228

jasonab avatar Aug 04 '23 17:08 jasonab

Thank you, that's a good workaround. However, I still think there is room for improvement in the plugin: either that the format task inherits its exclusions from the lint task if no exclusions are specified, or that the format task also can be configured in the same way as the lint task, i.e. with an exclude-dsl.

strindberg avatar Aug 09 '23 06:08 strindberg