* cljstyle redux, with pre-commit * Use fork of lein-githooks with fixes for shell characters * Remove stale doc
21 lines
403 B
Bash
Executable file
21 lines
403 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "${BASH_SOURCE[0]}")/.."
|
|
|
|
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!"
|