Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*Style helpers reset the config #362

Open
christophsturm opened this issue Sep 18, 2024 · 2 comments
Open

*Style helpers reset the config #362

christophsturm opened this issue Sep 18, 2024 · 2 comments

Comments

@christophsturm
Copy link

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.

@cortinico
Copy link
Owner

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.

@simonhauck
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants