Add pre commit hook for ktlint
This commit is contained in:
parent
6337f757b4
commit
b942e97b32
5
gradle/kotlin/hooks/ktlint-git-pre-commit-hook.sh
Normal file
5
gradle/kotlin/hooks/ktlint-git-pre-commit-hook.sh
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# https://github.com/shyiko/ktlint pre-commit hook
|
||||||
|
|
||||||
|
git diff --name-only --relative | grep '\.kt[s"]\?$' | xargs ktlint --relative .
|
||||||
|
if [ $? -ne 0 ]; then exit 1; fi
|
Loading…
Reference in New Issue
Block a user