Skip to content

Commit 9867620

Browse files
committed
Add git hooks for formatting and linting
1 parent 801101f commit 9867620

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

.githooks/pre-commit

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
3+
if which fourmolu > /dev/null ; then
4+
find app test src -name '*.hs' -exec fourmolu --mode check {} +
5+
else
6+
echo "Fourmolu not found, aborting."
7+
exit 1
8+
fi
9+
10+
if which hlint > /dev/null ; then
11+
hlint app test src
12+
else
13+
echo "HLint not found, aborting."
14+
exit 1
15+
fi

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
init: ## Set up git hooks properly - needs calling once when cloning the repo
2+
@git config core.hooksPath .githooks
3+
14
start: ## Start flora-server
25
@cabal run exe:flora-server
36

0 commit comments

Comments
 (0)