AndroidDev-social / DodoForMastodon

🐘 Mastodon client for Android, iOS and Desktop (JVM)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[FEAT]: Add Detekt & Lint checker to project

crocsandcoffee opened this issue · comments

commented

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

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?

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.

Maybe spotless with ktlint is an option.

commented

@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.