-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmise.toml
More file actions
167 lines (137 loc) · 4.84 KB
/
Copy pathmise.toml
File metadata and controls
167 lines (137 loc) · 4.84 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
min_version = "2026.4.8"
[settings]
idiomatic_version_file_enable_tools = ["rust"]
[plugins]
fnox-env = "https://github.com/jdx/mise-env-fnox"
[tools]
node = "24.15.0"
deno = "1.46.1"
fnox = "1.21.0"
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.6.0"
"cargo:cargo-hack" = "0.6.33"
"cargo:cargo-nextest" = "0.9.102"
"cargo:cargo-expand" = "1.0.114"
"cargo:rumdl" = "0.1.0"
[env]
_.fnox-env = { tools = true }
[tasks."build"]
run = "cargo build --workspace"
[tasks."lint"]
depends = ["lint:code", "lint:docs"]
[tasks."lint:code"]
run = "cargo clippy --workspace --all-targets --all-features -- -D warnings"
[tasks."lint:docs"]
run = "rumdl check"
[tasks."test"]
depends = ["test:code", "test:docs"]
[tasks."test:code"]
run = "cargo nextest run --workspace --all-features --no-tests warn"
[tasks."test:code:integration"]
# see also: "agent:test:code:integration"
# `--test-threads 1` because integration tests must be run sequentially
run = "mise run test:code -- --ignore-default-filter --max-fail 1 --test-threads 1 'integration_tests::'"
[tasks."test:code:slow"]
# see also: "agent:test:code:slow"
# `--test-threads` is omitted because slow tests may be run in parallel
run = "mise run test:code -- --ignore-default-filter --max-fail 1 'slow_tests::'"
[tasks."test:docs"]
run = "cargo test --workspace --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:agents"]
[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 --workspace --all-targets --all-features --fix --allow-dirty --allow-staged
cargo clippy --workspace --all-targets --all-features -- -D warnings
"""
[tasks."fix:code:style"]
run = "cargo fmt --all"
[tasks."fix:docs"]
# `rumdl check --fix` may modify any file, so we need to stage all markdown files.
# use `rumdl check --fix` instead of `rumdl fmt` because `rumdl check --fix` exits with 1 if errors remain (since v0.1.0)
# use a quoted git pathspec so ignored files (e.g. `*.local.md`) don't fail the task.
run = """
rumdl check --fix
git add -- '*.md'
"""
[tasks."fix:agents"]
run = """
#!/usr/bin/env bash
set -euo pipefail
mise run gen:agents
if [ -f AGENTS.md ]; then
# add AGENTS.md manually because it may not have been staged
git add AGENTS.md
fi
"""
[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 = "touch README.md && chmod 0644 README.md && ./README.ts --output README.md"
[tasks."gen:agents"]
run = "touch AGENTS.md && chmod 0644 AGENTS.md && ./AGENTS.ts --output AGENTS.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")
# `--no-git-sort-by-changes` stabilizes file order across invocations
repomix \
--include src,tests,examples \
--no-file-summary \
--no-directory-structure \
--no-git-sort-by-changes \
--header-text "$header" \
--output "$file" \
{{arg(name="rest")}} \
"$@" \
$dir
"""
[tasks."agent:docs:list"]
run = "[ -d .agents/docs ] && find .agents/docs -type f -print || true"
quiet = true
[tasks."agent:on:stop"]
depends = ["fix", "agent:test"]
[tasks."agent:test"]
depends = ["agent:test:code", "agent:test:code:integration", "agent:test:code:slow", "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"
[tasks."agent:test:code:integration"]
# see also: "test:code:integration"
# `--test-threads 1` because integration tests must be run sequentially
run = "mise run agent:test:code -- --ignore-default-filter --max-fail 1 --test-threads 1 'integration_tests::'"
[tasks."agent:test:code:slow"]
# see also: "test:code:slow"
# `--test-threads` is omitted because slow tests may be run in parallel
run = "mise run agent:test:code -- --ignore-default-filter --max-fail 1 'slow_tests::'"