-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
102 lines (69 loc) · 1.89 KB
/
justfile
File metadata and controls
102 lines (69 loc) · 1.89 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
project := "muton"
export SQLITE_FILE := project + ".sqlite"
########################################
# Common dev commands
check:
cargo check || { echo "cargo check failed"; exit 1; }
fmt-check:
cargo fmt --all --check || { echo "formatting checks failed, run 'just fmt'"; exit 1; }
fmt:
cargo fmt --all
lint:
cargo clippy --lib -p {{project}} --tests || { echo "clippy linter checks failed"; exit 1; }
lint-fix:
cargo clippy --lib -p {{project}} --tests --fix
actionlint:
actionlint
typos:
typos || { echo "typos check failed"; exit 1; }
pre-commit:
just check
just fmt-check
just lint
just actionlint
just typos
install-pre-commit:
echo 'just pre-commit' > .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit
uninstall-pre-commit:
rm .git/hooks/pre-commit
########################################
# Database
reset-db:
rm -f {{SQLITE_FILE}}
db:
rlwrap sqlite3 -table {{SQLITE_FILE}} || true
########################################
# Build
build-all: build build-nix build-x86_64-linux build-aarch64-linux build-aarch64-darwin build-docs
build:
cargo build --bin {{project}}
build-nix:
nix build .#{{project}}
build-x86_64-linux:
nix build .#{{project}}-x86_64-linux
build-aarch64-linux:
nix build .#{{project}}-aarch64-linux
build-aarch64-darwin:
nix build .#{{project}}-aarch64-darwin
build-docs:
cargo doc
########################################
# Tests
test:
cargo test
mutate lang:
cargo run --bin {{project}} -- mutate tests/{{lang}}/examples
remutate lang: reset-db
just mutate {{lang}}
run lang:
cargo run --bin {{project}} -- run tests/{{lang}}/examples --test-cmd "sleep 1; echo test passed"
rerun lang: reset-db
just run {{lang}}
########################################
# Nix Installation
install-nix:
nix profile add .#{{project}}
uninstall-nix:
nix profile remove {{project}}
upgrade-nix:
nix profile upgrade {{project}}