cortinico/ktfmt-gradle

*Style helpers reset the config

Opened this issue · 2 comments

if i want kotlin style but not managed commas, this works:

ktfmt {
    kotlinLangStyle()
    manageTrailingCommas = false
}

but this does not:

ktfmt {
    manageTrailingCommas = false
    kotlinLangStyle()
}

if kotlinLangStyle always needs to be first, which is totally fine, the second version should produce an error message.

the second version should produce an error message.

This could be hard to implement as those functions such as kotlinLangStyle() are effectively calling a collection of setters.

Maybe it would be possible if the kotlinLangStyle method would not set the values directly and instead would invoke the convention method. Then the user could still overwrite the parameters by explicitly specifing them