-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
27 lines (22 loc) · 1005 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# This Makefile attempts to follow the best-practice set out by Alexis King
# in "An opinionated guide to Haskell in 2018" where we build developer tooling
# as part of the project environment rather than globally. This ensures that
# tools like `ghcmod` are using the same version of GHC as our target runtime to
# get the most relevant results.
#
# https://lexi-lambda.github.io/blog/2018/02/10/an-opinionated-guide-to-haskell-in-2018/
BIN_PATH=$(shell stack path | grep bin-path | awk -F\ '{ print $$2 }' | head -n1)
export PATH := $(BIN_PATH):$(PATH)
clean:
@stack clean && rm *.cabal
# This should only need to be done once per developer machine.
setup: clean
stack build --copy-compiler-tool ghc-mod stylish-haskell hlint apply-refact
_HLINT=hlint --refactor --refactor-options -i {} \;
hlint:
@find {src,app} -name "*.hs" -exec $(_HLINT)
_STYLISH=stylish-haskell -i {} \;
stylish-haskell:
@find {src,app} -name "*.hs" -exec $(_STYLISH)
test:
stack test --test-arguments "--color always"