Add pre commit hook for ktlint

This commit is contained in:
Sambo Chea 2021-03-08 13:13:25 +07:00
parent 6337f757b4
commit b942e97b32

View 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