forked from fossas/spectrometer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (26 loc) · 922 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
28
29
30
31
32
33
34
35
36
FMT_OPTS = -co -XTypeApplications -o -XImportQualifiedPost
FIND_OPTS = src test -type f -name '*.hs'
build:
cabal build
test:
cabal test
# Dogfood the dev version
analyze:
cabal run fossa -- analyze --output --debug --filter 'cabal@./'
# Copy the built binary into the local root
fossa:
cp $(shell cabal list-bin fossa) ./fossa
install-local: fossa
check: check-fmt lint
# Format everything (if this fails, update FMT_OPTS or use your IDE to format)
# `@command` does not echo the command before running
fmt:
@fourmolu --mode inplace ${FMT_OPTS} $(shell find ${FIND_OPTS})
# Confirm everything is formatted without changing anything
check-fmt:
@fourmolu --mode check ${FMT_OPTS} $(shell find ${FIND_OPTS})
@echo "No formatting errors found"
# Lint everything (If this fails, update .hlint.yaml or report the failure)
lint:
hlint src test
.PHONY: build test analyze install-local fmt check check-fmt lint