Closed crocsandcoffee closed 1 year ago
It's worth mentioning the detekt formatting rules just wrap ktlint rules so you can use detekt to cover both rulesets without adding another plugin for ktlint.
Ktlint comes with an autoformatter which makes it easy to automatically fix the formatting failure, or even prevent it by adding it to a pre-commit hook.
This would save everyone a lot of time.
As far as I'm aware, Detekt doesn't have an autoformatter like that?
Detekt does support auto formatting based on ktlint. See: https://github.com/ReluctApp/Reluct/blob/c9de419e966abbf7e686ac7752dbe46178da2fc5/build.gradle.kts#L80
We could also use Twitter's 😉 Compose Rules. It's really nice because it also catches common Compose errors / gotchas.
As part of this task, we could also add some git hooks to auto-format and catch rule violations before code is pushed to GH
While you all write so much comments into this issue, you could probably have it added already 😂 Fill a PR and let's start coding in style
I made good experience with the Kotlinter Gradle plugin. It also offers a Git hook.
@racka98 plz make PR to upstream main. Thanks for taking the initiative and throwing something together. We can look over the setup you did in the PR and go from there.
@crocsandcoffee see #37
Description
https://detekt.dev/ https://pinterest.github.io/ktlint/
At some point it would be nice to get these setup in the project so developers can focus more on contributions and have these checkers as part of CI.
Additional Information
No response