-
Notifications
You must be signed in to change notification settings - Fork 95
/
justfile
88 lines (69 loc) · 2.09 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
79
80
81
82
83
84
85
86
87
88
default: help
# Get a list of recipes you can run
@help:
just --list
# Install required tools for development
setup: (_cargo-install 'cargo-nextest') _install-spell-check
# Run all the checks required for CI to pass
ci: spell-check lint test
# Format the code
fmt:
cargo +nightly fmt --all
# Check the formatting of the code but don't actually format it
fmt-check:
cargo +nightly fmt --all --check
# Lint the code
lint: fmt-check
cargo clippy --all-targets -- -Dwarnings
cargo clippy --all-targets --no-default-features -- -Dwarnings
cargo clippy --all-targets --all-features -- -Dwarnings
# Run benchmarks
bench $RUSTFLAGS='-Ctarget-cpu=native':
cargo bench
# Run the test suite
test TEST_RUNNER='cargo nextest run': setup
{{ TEST_RUNNER }}
{{ TEST_RUNNER }} --no-default-features
{{ TEST_RUNNER }} --all-features
# Check for typos
spell-check: _install-spell-check
@update-contributors:
echo 'Removing old CONTRIBUTORS.md'
mv CONTRIBUTORS.md CONTRIBUTORS.md.bak
echo 'Downloading a list of new contributors'
echo "the following is a list of contributors:" > CONTRIBUTORS.md
echo "" >> CONTRIBUTORS.md
echo "" >> CONTRIBUTORS.md
githubcontrib --owner kbknapp --repo cargo-outdated --sha master --cols 6 --format md --showlogin true --sortBy contributions --sortOrder desc >> CONTRIBUTORS.md
echo "" >> CONTRIBUTORS.md
echo "" >> CONTRIBUTORS.md
echo "This list was generated by [mgechev/github-contributors-list](https://github.com/mgechev/github-contributors-list)" >> CONTRIBUTORS.md
rm CONTRIBUTORS.md.bak
run-test TEST:
cargo test --test {{TEST}}
debug TEST:
cargo test --test {{TEST}} --features debug
run-tests:
cargo test --features "yaml unstable"
clean:
cargo clean
##
#
# Helpers
##
[unix]
_install-spell-check:
#!/usr/bin/env bash
set -euo pipefail
if ! command -v typos 2>&1 >/dev/null ; then
cargo install typos-cli --force
fi
[windows]
_install-spell-check:
#!powershell.exe
$ret = Get-Command typos >$null 2>$null
if (! $?) {
cargo install typos-cli --force
}
_cargo-install TOOL:
cargo install {{TOOL}}