-
Notifications
You must be signed in to change notification settings - Fork 0
/
GNUmakefile
57 lines (37 loc) · 652 Bytes
/
GNUmakefile
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
47
48
49
50
51
52
53
54
55
56
57
CLI := target/release/detat
PREFIX := $(HOME)/.local
.PHONY: build
build:
cargo build --release
.PHONY: install
install: build
cp $(CLI) $(PREFIX)/bin/detat
.PHONY: dev
dev:
cargo build
.PHONY: test
test:
cargo test --all
.PHONY: fmt
fmt:
cargo +nightly fmt
.PHONY: fix
fix:
cargo +nightly fix --allow-staged
.PHONY: lint
lint:
cargo +nightly clippy --all-features
.PHONY: doc
doc:
cargo doc --open
.PHONY: pre-commit
pre-commit:
$(MAKE) fix
$(MAKE) fmt
git diff --exit-code
$(MAKE) lint
$(MAKE) test
.PHONY: setup-dev
setup-dev:
echo 'exec make pre-commit 1>&2' >.git/hooks/pre-commit
chmod +x .git/hooks/pre-commit