facebook / ktfmt

A program that reformats Kotlin source code to comply with the common community standard for Kotlin code conventions.
https://facebook.github.io/ktfmt/
Apache License 2.0
859 stars 67 forks source link

Sort modifiers based on Kotlin conventions #293

Open JavierSegoviaCordoba opened 2 years ago

JavierSegoviaCordoba commented 2 years ago

When modifiers aren't in a specific order, the linter suggests to be sorted, ktfmt could sort them.

strulovich commented 2 years ago

This is indeed possible, but will require an extra pass due to the way Ktfmt is structured (we can't just reorganize tokens).

There might also be some intention in the order of mixing annotations with modifiers, but I can't come up with an example of the top of my head right now.

In the meantime, we recommend using Ktfmt with other linters that fix specific issues.