Skip to content

Instantly share code, notes, and snippets.

@alunduil
Created March 26, 2020 03:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alunduil/7b1805868013358f031d68b74b067367 to your computer and use it in GitHub Desktop.
Save alunduil/7b1805868013358f031d68b74b067367 to your computer and use it in GitHub Desktop.
.git/hooks/pre-commit
#!/usr/bin/env bash
set -e
set -x
if [ -e Makefile ]; then
make lint
make check
elif [ -e zfs-replicate.cabal ]; then
hlint src test
cabal v2-clean
cabal v2-configure -O0 --enable-tests --enable-benchmarks
cabal v2-build -j --ghc-options="-Werror"
cabal v2-test -j --ghc-options="-Werror"
cabal v2-sdist
cabal check
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment