1
Fork 0
tagless-final-parsing/.githooks/pre-commit

14 lines
229 B
Plaintext
Raw Normal View History

2022-01-12 11:51:56 +00:00
#!/bin/bash
set -e
filesToFormat=$(
git --no-pager diff --name-status --no-color --cached | \
awk '$1 != "D" && $2 ~ /\.hs/ {print $NF}'
)
for path in $filesToFormat
do
ormolu --mode inplace $path
git add $path
done;