cortinico / ktfmt-gradle

A Gradle plugin to apply ktfmt to your builds, and reformat you Kotlin source code like a glimpse ๐Ÿงน๐Ÿ˜
MIT License
155 stars 19 forks source link

Helper task that creates pre-commit hook that runs ktfmtFormat #268

Open mhernand40 opened 7 months ago

mhernand40 commented 7 months ago

โš ๏ธ Is your feature request related to a problem? Please describe

The ktlint-gradle plugin has a set of helper tasks. Two notable ones are addKtlintCheckGitPreCommitHook and addKtlintFormatGitPreCommitHook. These tasks make it easy to set up a Git pre-commit hook that runs ktfmt against the changed files when committing changes. I am looking to migrate my team's project from ktlint to ktfmt but many of the devs on the team rely on the pre-commit hook that gets created specifically from the addKtlintFormatGitPreCommitHook task.

๐Ÿ’ก Describe the solution you'd like

It would be great if this plugin would provide helper tasks similar to addKtlintCheckGitPreCommitHook and addKtlintFormatGitPreCommitHook. For my team's specific needs, we only care about the latter.

๐Ÿคš Do you want to develop this feature yourself?

cortinico commented 7 months ago

Happy to receive a PR that adds this support :+1: