-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmise.toml
More file actions
131 lines (107 loc) · 3.26 KB
/
mise.toml
File metadata and controls
131 lines (107 loc) · 3.26 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
min_version = "2025.10.11"
[tools]
rust = "1.89.0"
node = "22.12.0"
deno = "1.46.1"
cargo-binstall = "1.10.15"
"npm:lefthook" = "1.8.5"
"npm:@commitlint/config-conventional" = "19.6.0"
"npm:@commitlint/cli" = "19.6.0"
"npm:@commitlint/types" = "19.5.0"
"npm:repomix" = "1.5.0"
"cargo:cargo-insert-docs" = "1.2.0"
"cargo:cargo-sort" = "1.0.9"
"cargo:cargo-hack" = "0.6.33"
"cargo:cargo-machete" = "0.7.0"
"cargo:cargo-nextest" = "0.9.102"
"cargo:cargo-expand" = "1.0.114"
"cargo:rumdl" = "0.0.185"
[tasks."build"]
run = "cargo build"
[tasks."lint"]
depends = ["lint:code", "lint:docs", "lint:deps"]
[tasks."lint:code"]
run = "cargo clippy --all-targets --all-features -- -D warnings"
[tasks."lint:docs"]
run = "rumdl check"
[tasks."lint:deps"]
run = "cargo machete --with-metadata"
[tasks."test"]
depends = ["test:code", "test:docs"]
[tasks."test:code"]
run = "cargo nextest run --all-features --no-tests warn"
[tasks."test:docs"]
run = "cargo test --doc --all-features --no-fail-fast --quiet"
[tasks."fix"]
# run the tasks in parallel because they modify different files
depends = ["fix:code", "fix:docs", "fix:deps"]
[tasks."fix:code"]
# run the tasks sequentially because they modify the same files
run = """
mise run fix:code:warnings
mise run fix:code:style
"""
[tasks."fix:code:warnings"]
# second pass is needed because "cargo clippy --fix" exits with 0 even if some warnings remain
env = { __CARGO_FIX_YOLO = 'yeah' }
run = """
cargo clippy --all-targets --all-features --fix --allow-dirty --allow-staged
cargo clippy --all-targets --all-features -- -D warnings
"""
[tasks."fix:code:style"]
run = "cargo fmt --all"
[tasks."fix:docs"]
# use `rumdl fmt` instead of `rumdl check --fix` because `rumdl fmt` exits with 0 after fixing the errors
run = "rumdl fmt"
[tasks."fix:deps"]
# run the tasks sequentially because they modify the same files
run = """
mise run fix:deps:usage
mise run fix:deps:order
"""
[tasks."fix:deps:usage"]
run = "cargo machete --with-metadata --fix"
[tasks."fix:deps:order"]
run = "cargo sort"
[tasks."watch"]
run = """
#!/usr/bin/env bash
set -euo pipefail
PWD=$(pwd)
CMD_RAW="nextest run $*"
CMD_NO_WHITESPACE="$(echo -e "${CMD_RAW}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
cargo watch --clear --watch "$PWD" --exec "$CMD_NO_WHITESPACE" "$@"
"""
[tasks."gen:readme"]
run = "./README.ts --output README.md"
[tasks."commitlint"]
run = "commitlint --extends \"$(mise where npm:@commitlint/config-conventional)/lib/node_modules/@commitlint/config-conventional/lib/index.js\""
[tasks."repomix"]
usage = """
arg "<file>"
arg "[rest]" var=#true
"""
run = """
#!/usr/bin/env bash
set -xeuo pipefail
dir=$MISE_PROJECT_ROOT
file=$usage_file
header=$(taplo get -f "$dir/Cargo.toml" "package.description")
repomix \
--include src,tests,examples \
--no-file-summary \
--no-directory-structure \
--header-text "$header" \
--output "$file" \
{{arg(name="rest")}} \
"$@" \
$dir
"""
[tasks."agent:on:stop"]
depends = ["fix", "agent:test"]
[tasks."agent:test"]
depends = ["agent:test:code", "test:docs"]
[tasks."agent:test:code"]
# don't include `--fail-fast` because it's better to let the agent see all failures
# reduce output to save tokens
run = "mise run test:code -- --cargo-quiet --hide-progress-bar --status-level fail --final-status-level flaky"