-
Notifications
You must be signed in to change notification settings - Fork 303
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
Use ktfmt in spotless and switch (back) to google-java-format #294
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome!
thanks @MuhammadSalman-7214 and @joiskash for taking a look. To other reviewers, if there's too much to go through, please focus on the non-kotlin files. Namely, the |
changing java version used in github action which might have an impact on the integration tests |
After trying out a few different linter options in spotless (see documentation) and using a few different IDE plugins available for kotlin formatting in Android Studio, I've really seen the advantages of using ktfmt but decided to keep also ktlint in the list of linters in spotless (you can use multiple linters).
The documentation here explains quite well why they decided to use google-java-format, not the least because of the rectangle rule. It's very deterministic, which means it really takes formatting away as a concern for the developer.
See the linked issue for a bit more background.