ktlint-gradle
ktlint-gradle copied to clipboard
Add git hook version
When git hook is updated users won't know. This change introduces a version number into the hook, and if that version number doesn't match the expected value then the gradle task will fail.
There is also a issue with the formatting of the git hook which I've fixed up.
I'm not sure about the best approach for the version of the git hook, I would think matching the version of ktlint would be a bad idea as it would force users to update the hook when there are no changes.
Currently this requires manually updating the version when changes are made to GitHook.kt
Perhaps the best way to solve this would be to have a build step that checks for changes to GitHook.kt or generates the script and checks diff. If there are changes then increment the hookVersion.