-
Notifications
You must be signed in to change notification settings - Fork 1
/
justfile
78 lines (63 loc) · 1.82 KB
/
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
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
#!/usr/bin/env -S just --justfile
alias d := dev
alias f := fmt
alias l := lint
alias t := test
alias c := comply
alias k := check
[doc('List available commands')]
_default:
just --list --unsorted
[confirm('⚠️ This command will alter your system. Run recipe `setup`?')]
[doc('Setup the repository')]
setup:
just _cargo-install 'cargo-edit cargo-nextest cargo-outdated dprint git-cliff bacon typos-cli'
[doc('Tasks to make the code-base comply with the rules. Mostly used in git hooks')]
comply: _doc-check fmt lint test
[doc('Check if the repository comply with the rules and ready to be pushed')]
check: _doc-check fmt-check lint test
[doc('Develop the app')]
dev:
bacon
[doc('Format the codebase.')]
fmt:
cargo fmt --all
dprint fmt
[doc('Check is the codebase properly formatted')]
fmt-check:
cargo fmt --all -- --check
dprint check
[doc('Lint the codebase')]
lint:
cargo clippy --all-targets --all-features
typos
[doc('Test the codebase')]
test:
cargo test --doc
cargo nextest run
[doc('Create a new release. Example `cargo-release release minor --tag-name v0.2.0`')]
release level:
cargo-release release {{ level }} --execute
[doc('Make sure the repo is ready for release')]
release-check level: check
just up
cargo-release release {{ level }}
[doc('Check the documentation')]
_doc-check:
cargo doc --all-features --no-deps
cargo test --doc
[doc('Prepare release hooks')]
_release-prepare version:
git-cliff --config .cliff.toml --output CHANGELOG.md --tag {{ version }}
just fmt
[doc('Check dependencies health. Pass `--write` to upgrade dependencies')]
[unix]
up arg="":
#!/usr/bin/env bash
if [ "{{ arg }}" = "--write" ]; then
cargo upgrade
cargo update
dprint config update
else
cargo outdated --root-deps-only
fi;