testcontainers-clj/script/pre-commit

20 lines
363 B
Text
Raw Normal View History

2020-08-09 00:54:51 +00:00
#!/usr/bin/env bash
set -euo pipefail
FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g')
if [[ -z "$FILES" ]]; then
exit 0
fi
echo "Fixing Clojure style..."
# Format all selected files
echo "$FILES" | xargs lein cljstyle fix --report
# Add back the modified/prettified files to staging
echo "$FILES" | xargs git add
echo "Done!"