-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathTaskfile.yml
More file actions
385 lines (326 loc) · 11.9 KB
/
Copy pathTaskfile.yml
File metadata and controls
385 lines (326 loc) · 11.9 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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
version: "3"
tasks:
default:
deps: [build]
build:
desc: Dev build
cmds:
- cargo build --workspace
build-release:
desc: Build release version
cmds:
- cargo build --release
test:
desc: Run all tests
cmds:
- cargo test --workspace
smoke-scripts:test:
desc: Test smoke-test source acquisition and project scanning scripts
cmds:
- python3 -m unittest tests/test_smoke_scripts.py
parser-properties:
desc: Run parser losslessness properties at nightly depth
env:
BADNESS_PROPERTY_CASES: 4096
cmds:
- cargo test -p badness-parser --test property_losslessness
fmt:
desc: Format the code
cmds:
- cargo fmt --all
fmt-check:
desc: Check formatting (CI)
cmds:
- cargo fmt --all -- --check
lint:
desc: Clippy with warnings as errors
cmds:
- cargo clippy --workspace --all-targets --all-features -- -D warnings
snapshots:
desc: Regenerate / accept insta snapshots
cmds:
- INSTA_UPDATE=always cargo test --workspace
parse-compat:
desc: Soft differential parse-concordance report vs texlab (writes PARSE_COMPAT.md)
cmds:
- cargo test -p badness-parser --test parse_compat -- --ignored --nocapture
bib-parse-compat:
desc: Soft differential BibTeX parse-concordance report vs texlab (writes BIB_PARSE_COMPAT.md)
cmds:
- cargo test -p badness-parser --test bib_parse_compat -- --ignored --nocapture
bib-fields:check:
desc: Check crates/badness-parser/data/bib_fields.json is in sync with biblatex's data model (blx-dm.def)
cmds:
- python3 scripts/gen_bib_fields.py
bib-fields:sync:
desc: Re-sync crates/badness-parser/data/bib_fields.json's mechanical facts from biblatex's data model
cmds:
- python3 scripts/gen_bib_fields.py --write
cwl:check:
desc: Check crates/badness-parser/data/cwl_signatures.json is in sync with the pinned TeXstudio CWL corpus
cmds:
- python3 scripts/gen_cwl_signatures.py
cwl:sync:
desc: Re-generate crates/badness-parser/data/cwl_signatures.json from the pinned TeXstudio CWL corpus
cmds:
- python3 scripts/gen_cwl_signatures.py --write
pkg-names:check:
desc: Check crates/badness-parser/data/{package,class}_names.txt are in sync with the pinned TeX Live tlpdb
cmds:
- python3 scripts/gen_package_names.py
pkg-names:sync:
desc: Re-generate crates/badness-parser/data/{package,class}_names.txt from the pinned TeX Live tlpdb
cmds:
- python3 scripts/gen_package_names.py --write
math-symbols:check:
desc: Check the generated math-symbol data and LPPL files against pinned unicode-math v0.8r
cmds:
- python3 scripts/gen_math_symbols.py
math-symbols:sync:
desc: Re-generate math-symbol data and LPPL files from pinned unicode-math v0.8r
cmds:
- python3 scripts/gen_math_symbols.py --write
aur:push:
desc: "Manually publish badness-bin to the AUR (CI fallback; args: [version] [pkgrel])"
cmds:
- ./scripts/aur_push.sh {{.CLI_ARGS}}
check:
desc: Core local checks, including the wasm build
deps: [fmt-check, lint, test, smoke-scripts:test, wasm]
wasm:
desc: Build the wasm-targeting crates for wasm32-unknown-unknown (local embeddability guard)
cmds:
- cargo build -p badness-parser -p badness-formatter -p badness-wasm --target wasm32-unknown-unknown
bench:
desc: Benchmark formatter speed vs tex-fmt & latexindent (writes benches/benchmark_results.json for the docs page)
cmds:
- ./benches/compare_format.sh --out benches/benchmark_results.json
bench:lsp:
desc: Compare LSP speed and whole-process-tree memory vs texlab (writes benches/memory_results.json for the docs page)
cmds:
- ./benches/compare_lsp_memory.sh --out benches/memory_results.json
bench:memory:
desc: Alias for bench:lsp
cmds:
- task: bench:lsp
bench:lsp-test:
desc: Test the external LSP harness and docs renderer
cmds:
- python3 -m unittest benches/test_lsp_memory_compare.py
- cargo test --manifest-path docs/doc-utils/Cargo.toml
bench:memory-test:
desc: Alias for bench:lsp-test
cmds:
- task: bench:lsp-test
bench:download:
desc: Fetch the real-world LaTeX corpus for the formatter benchmark
cmds:
- ./benches/documents/download.sh
gate-corpora:fetch:
desc: Clone/pin the trivia-invariant-layout gate corpora into corpora/ (latex3, latex2e, pgf, latexindent)
cmds:
- ./scripts/fetch_gate_corpora.sh
gate-corpora:check:
desc: Re-run both gates over the pinned corpora and diff the failure sets against tests/gate_baselines/ (two-sided ratchet)
cmds:
- cargo build --release
- ./scripts/check_gate_baselines.sh
reparse-corpora:check:
desc: Sweep seeded edits over the pinned corpora and diff the splice tallies against tests/reparse_baselines/ (two-sided ratchet)
cmds:
- ./scripts/check_reparse_baselines.sh
reparse-corpora:record:
desc: Re-record tests/reparse_baselines/ from a fresh sweep
env:
RECORD: "1"
cmds:
- ./scripts/check_reparse_baselines.sh
gate-corpora:strict-survey:
desc: "Survey strict trivia invariance over the pinned corpora and print a reproducer histogram (non-gating: strict is the end-state contract, so most files still fail)"
cmds:
- cargo build --release
- ./scripts/strict_trivia_survey.sh
typeset:check:
desc: Compile tests/typeset/*.tex before and after formatting and diff the typeset output (needs a TeX install; not run in CI)
cmds:
- cargo build --release
- ./scripts/check_typeset_stability.sh
bench:micro:
desc: In-process formatter micro-bench (parse vs format vs full, no startup floor)
cmds:
- cargo bench --bench formatting
bench:keystroke:
desc: In-process LSP keystroke bench (didChange splice -> salsa upsert -> parse)
cmds:
- cargo bench --bench keystroke
bench:keystroke-verbatim:
desc: The same, typing a line inside an injected lstlisting (protected-body tier)
env:
BADNESS_BENCH_SITE: verbatim
cmds:
- cargo bench --bench keystroke
bench:reparse:
desc: In-process incremental reparse bench (parser::reparse, timed directly, per tier)
cmds:
- cargo bench --bench reparse
bench:reparse-gate:
desc: Run the reparse bench with every case checked against its declared contract
env:
BADNESS_BENCH_ASSERT: "1"
cmds:
- cargo bench --bench reparse
bench:keystroke-gate:
desc: Run the keystroke bench with every row checked against its declared contract
env:
BADNESS_BENCH_ASSERT: "1"
cmds:
- cargo bench --bench keystroke
bench:lsp-memory:
desc: Reproduce retained LSP heap across query and project generations
cmds:
- cargo bench --bench lsp_memory
bench:lsp-memory-gate:
desc: Gate retained LSP heap against the paired-history controls
env:
BADNESS_MEMORY_ASSERT: "1"
cmds:
- cargo bench --bench lsp_memory
bench:gate:
desc: Run both incremental benchmark gates (reparse tiers + keystroke write phase)
cmds:
- task: bench:reparse-gate
- task: bench:keystroke-gate
bench:profile:
desc: Flamegraph the masters_dissertation per-byte hot paths (writes benches/flamegraph_masters.svg)
env:
BADNESS_BENCH_DOC: masters_dissertation.tex
BADNESS_BENCH_ITERATIONS: 60
cmds:
- cargo flamegraph --bench formatting -o benches/flamegraph_masters.svg
docs:
desc: Build the documentation book
deps: [docs:build]
docs:build:
desc: Build the mdBook docs into docs/book
deps: [docs:rules, playground:wasm]
dir: docs
cmds:
- mdbook build
- task: docs:canonical
- task: docs:sitemap
playground:wasm:
desc: Build the badness-wasm playground bundle into docs/src/playground/pkg
cmds:
- >-
wasm-pack build crates/badness-wasm --target web --release
--out-dir ../../docs/src/playground/pkg
playground:vendor:
desc: Rebuild the vendored CodeMirror bundle (commit the result)
dir: docs/playground-build
cmds:
- pnpm install
- pnpm run build
docs:rules:
desc: Regenerate the linter-rules reference from rule metadata
cmds:
- cargo run --quiet --example docgen
docs:canonical:
desc: Inject <link rel="canonical"> into each rendered page
dir: docs
cmds:
- >-
cargo run --quiet --manifest-path doc-utils/Cargo.toml --bin canonical --
book https://badness.dev/
docs:sitemap:
desc: Generate docs/book/sitemap.xml from the rendered book
dir: docs
cmds:
- >-
cargo run --quiet --manifest-path doc-utils/Cargo.toml --bin sitemap --
book https://badness.dev/
docs:serve:
desc: Serve the docs locally with live reload
dir: docs
cmds:
- mdbook serve --open
docs:clean:
desc: Remove built docs
dir: docs
cmds:
- mdbook clean
brand:
desc: Build all brand artifacts (logo, wordmark, OG card) — PDF + PNG
deps: [brand:logo, brand:wordmark, brand:og]
brand:logo:
desc: Build the logo (tight, light + dark) and icon (padded square) renders and copy them to all consumers
dir: branding
cmds:
# Tight transparent mark (light): README header, docs header.
- pdflatex -interaction=nonstopmode -halt-on-error logo.tex >/dev/null
- magick -density 600 logo.pdf -background none -strip logo.png
- dvisvgm --pdf logo.pdf -o logo.svg >/dev/null
# Tight transparent mark (dark): README header via <picture>.
- pdflatex -interaction=nonstopmode -halt-on-error -jobname=logo-dark '\def\bnDarkMode{1}\input{logo.tex}' >/dev/null
- magick -density 600 logo-dark.pdf -background none -strip logo-dark.png
- dvisvgm --pdf logo-dark.pdf -o logo-dark.svg >/dev/null
# Padded square icon on a filled background, for raw-display slots
# (favicon, marketplace icon) — margin ~14% of the side keeps the mark
# clear of rounded-corner masks.
- pdflatex -interaction=nonstopmode -halt-on-error -jobname=icon '\def\bnCanvasSize{6.5}\def\bnCanvasMargin{0.925}\def\bnFillBg{1}\input{logo.tex}' >/dev/null
- dvisvgm --pdf icon.pdf -o icon.svg >/dev/null
- magick -density 600 icon.pdf -strip -resize 256x256 icon.png
# Distribute to consumers (the Taskfile is the only distributor —
# never hand-copy these).
- cp logo.svg ../docs/src/images/logo.svg
- cp logo-dark.svg ../docs/src/images/logo-dark.svg
- cp icon.svg ../docs/theme/favicon.svg
- magick -density 600 icon.pdf -strip -resize 32x32 ../docs/theme/favicon.png
- cp icon.png ../editors/code/icon.png
sources:
- logo.tex
- _common.tex
generates:
- logo.pdf
- logo.png
- logo.svg
- logo-dark.pdf
- logo-dark.png
- logo-dark.svg
- icon.pdf
- icon.png
- icon.svg
- ../docs/src/images/logo.svg
- ../docs/src/images/logo-dark.svg
- ../docs/theme/favicon.svg
- ../docs/theme/favicon.png
- ../editors/code/icon.png
brand:wordmark:
desc: Build wordmark.pdf + wordmark.png
dir: branding
cmds:
- pdflatex -interaction=nonstopmode -halt-on-error wordmark.tex >/dev/null
- magick -density 600 wordmark.pdf -background none -strip wordmark.png
sources:
- wordmark.tex
- _common.tex
generates:
- wordmark.pdf
- wordmark.png
brand:og:
desc: Build og.pdf + og.png (1200x630)
dir: branding
cmds:
- pdflatex -interaction=nonstopmode -halt-on-error og.tex >/dev/null
# 1200pt @ 72dpi base, scale 2x to 144dpi for crisp social preview.
- magick -density 144 og.pdf -strip og.png
sources:
- og.tex
- _common.tex
generates:
- og.pdf
- og.png
brand:clean:
desc: Remove built brand artifacts and LaTeX scratch files
dir: branding
cmds:
- rm -f *.pdf *.png *.svg *.aux *.log *.out