https://github.com/facebookincubator/ktfmt is an opinionated pretty-print auto-formatter for Kotlin. It's currently got some known issues (especially with regards to generating code that violates ktlint checks), but once these are in a better place we should include instructions for integrating ktfmt during onboarding. In fact, we may actually want to introduce a second Kotlin lint check which specifically verifies that all Kotlin code exactly matches what ktfmt would output. The main benefits of using an opinionated formatter:
It eliminates the need to make a decision when trying to address a ktlint issue (since it resolves ambiguous cases where multiple solutions technically match the style guide & satisfy ktlint, but look quite different)
It ensures absolute consistency for spacing & formatting elements, completely eliminating the need to bring this up during code reviews & making reading existing code much easier
To work on this issue:
Review the official docs.
Make note of any know issues and discuss with the project maintainers to determine which ones are blockers for us.
Add the dependency to both Bazel and Gradle.
Add necessary configurations.
Select a set of files and do a Ktlint vs ktfm check and analyse the differences.
https://github.com/facebookincubator/ktfmt is an opinionated pretty-print auto-formatter for Kotlin. It's currently got some known issues (especially with regards to generating code that violates ktlint checks), but once these are in a better place we should include instructions for integrating ktfmt during onboarding. In fact, we may actually want to introduce a second Kotlin lint check which specifically verifies that all Kotlin code exactly matches what ktfmt would output. The main benefits of using an opinionated formatter:
To work on this issue: