-
Notifications
You must be signed in to change notification settings - Fork 1
/
justfile
47 lines (35 loc) · 982 Bytes
/
justfile
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
stack_build := "stack build --fast"
src_dirs := "src test"
# No default tasks
default:
just --list
# Build and run tests on file change
watch target="":
{{ stack_build }} --test --file-watch {{ target }}
# Build and run tests
test target="":
{{ stack_build }} --test {{ target }}
# Build only
build target="":
{{ stack_build }} --test --no-run-tests {{ target }}
# Enter repl
repl target="":
stack ghci --test --ghci-options "-XOverloadedStrings" {{ target }}
# Clean stack work
clean:
stack clean --full
# Open browser with generated docs
docs:
stack haddock --open
# Install tool deps
deps:
stack build --copy-compiler-tool hlint fourmolu apply-refact
# Format with fourmolu
format:
stack exec -- fourmolu --mode inplace {{ src_dirs }}
# Lint with hlint
lint:
stack exec -- hlint {{ src_dirs }}
# Apply hlint suggestions
lint-apply:
find {{ src_dirs }} -name '*.hs' | xargs -t -I % stack exec -- hlint % --refactor --refactor-options="--inplace"