.ktlint.0.37.2.source-code.ktlint-git-pre-push-hook.sh Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ktlint Show documentation
Show all versions of ktlint Show documentation
An anti-bikeshedding Kotlin linter with built-in formatter.
#!/bin/sh
# https://github.com/shyiko/ktlint pre-push hook
git diff --name-only HEAD origin/$(git rev-parse --abbrev-ref HEAD) | grep '\.kt[s"]\?$' | xargs ktlint --relative .
if [ $? -ne 0 ]; then exit 1; fi
© 2015 - 2024 Weber Informatics LLC | Privacy Policy