jeremymailen / kotlinter-gradle

Painless, fast ktlint plugin for Gradle
Apache License 2.0
623 stars 51 forks source link

Any reason pre-commit install tasks is not wired? #339

Closed brice-laurencin closed 1 year ago

brice-laurencin commented 1 year ago

Hello,

One cannot call installKotlinterPreCommitHook because it is not installed anywhere: https://github.com/jeremymailen/kotlinter-gradle/blob/master/src/main/kotlin/org/jmailen/gradle/kotlinter/KotlinterPlugin.kt#L29

is this on purpose?

jeremymailen commented 1 year ago

Yeah, the main problem is that the plugin doesn't know which files in your workspace are the ones being committed. It might complain about files which aren't part of that set.

We've actually been pondering removing the githooks since there are better ones out there and the ktlint command line is better suited to run as part of the githook since it can target individual files.