Files
max-sixty__worktrunk/.pre-commit-config.yaml
Maximilian Roos 8e405bced9 docs: rebuild the site with Astro and Starlight (#3866)
The docs now build with Astro and Starlight instead of Zola. This
removes the Tera 2 migration blocker from #3827 while keeping the
published routes, anchors, generated references, metadata, and crawler
URLs stable. It replaces the approach closed in #3840.

## What changed

- Move the site into Starlight, with a custom Worktrunk homepage and a
shared copper, gold, paper, and ink design system.
- Keep generated docs as portable Markdown. The Rust sync pipeline no
longer needs Zola shortcodes, template escaping, ANSI-to-HTML
conversion, or reverse transforms for skill and README output.
- Preserve terminal semantics and command-only copying, add responsive
handling for short wide tables, retain stable heading IDs, and give
repeated command-reference headings useful search labels.
- Move docs CI and publishing to Node, Astro, and built-site contract
tests. The tests cover public routes, links, assets, metadata,
navigation, tables, terminal frames, and compatibility aliases.
- Record demo themes from isolated environments, add a mobile core demo,
and test the recording contract. The matching mobile assets are
published in `max-sixty/worktrunk-assets`.

Closes #3827.

## Verification

- `cargo run -- hook pre-merge --yes` (4,660 tests)
- `npm --prefix docs run check`
- `npm --prefix docs test` (9 tests)
- `npm --prefix docs run build` (16 pages)
- `npm --prefix docs run test:site` (12 tests)
- `pytest docs/demos/tests/test_recording.py` (4 tests)

> _This was written by Codex on behalf of max-sixty_
2026-08-22 00:01:58 -07:00

95 lines
3.8 KiB
YAML

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: end-of-file-fixer
exclude: '.*\.snap$|^vendor/'
- id: check-yaml
- id: mixed-line-ending
exclude: '^vendor/'
- id: trailing-whitespace
# rustfmt handles rust files, and in snapshots we expect trailing spaces.
exclude: '.*\.(rs|snap)$|^vendor/'
# pre-commit autoupdate reverts to mutable v1 tag; update manually
- repo: https://github.com/crate-ci/typos
rev: v1
hooks:
- id: typos
# https://github.com/crate-ci/typos/issues/347
pass_filenames: false
- repo: https://github.com/r0x0d/pre-commit-rust
rev: v1.0.1
hooks:
- id: fmt
exclude: '^vendor/'
- repo: https://github.com/r0x0d/pre-commit-rust
rev: v1.0.1
hooks:
- id: clippy
args: ["--all-targets", "--all-features", "--", "-D", "warnings"]
# pre-commit autoupdate reverts to mutable nightly tag; update manually
- repo: https://github.com/lycheeverse/lychee
rev: nightly
hooks:
# Check links using .config/lychee.toml exclusions. Build the docs first
# so root-relative site links resolve against docs/dist.
# Uses lychee-system (requires `cargo install lychee`) to avoid /bin/bash dependency on Windows
#
# Manual stage only: link health depends on external sites (429s,
# bot-blocking, link rot), so it runs as the `link-check` job in the
# nightly workflow, not on every commit/PR.
- id: lychee-system
stages: [manual]
files: '\.(md|txt)$'
args:
- --config=.config/lychee.toml
- repo: local
hooks:
- id: cargo-lock
name: cargo-lock
description: Ensure Cargo.lock is in sync with Cargo.toml
language: system
entry: cargo check --locked
pass_filenames: false
files: (Cargo\.toml|Cargo\.lock)$
- id: no-dbg
name: no-dbg
description: We shouldn't merge code with `dbg!` in
language: pygrep
types: ["rust"]
entry: "dbg!"
- id: no-manual-ansi
name: no-manual-ansi
description: Use anstyle/osc8/strip-ansi-escapes instead of manual ANSI codes
language: pygrep
types: ["rust"]
entry: '\\x1b\['
# format.rs strips ANSI codes injected by wrap_ansi crate
# picker tests verify ANSI dimming behavior
# src/testing: validate_ansi_codes tests raw escape sequences
exclude: '^(tests/|.*_test\.rs$|src/styling/(mod|format)\.rs$|src/commands/picker/|src/testing/|vendor/)'
- id: no-std-canonicalize-in-tests
name: no-std-canonicalize-in-tests
description: Use dunce::canonicalize in tests to avoid Windows \\?\ prefix issues
language: pygrep
entry: '\.canonicalize\(\)'
files: '^tests/'
- id: no-direct-cmd-output
name: no-direct-cmd-output
description: Use shell_exec::Cmd instead of cmd.output() for consistent logging
language: pygrep
types: ["rust"]
entry: '\.output\(\)'
# shell_exec.rs: defines Cmd which legitimately calls .output()
# picker: skim API's selected.output() is not Command::output()
# tests/benches: test utilities run commands directly
# src/config/{test,expansion,mod}.rs: TestRepo test fixtures use git init directly
# src/config/user/tests.rs: TestRepo test fixtures use git init directly
# src/styling/mod.rs: terminal width detection probes should be silent/quick
exclude: '^(src/shell_exec\.rs|src/commands/picker/|src/config/(test|expansion|mod)\.rs|src/config/user/tests\.rs|src/styling/mod\.rs|src/testing/|tests/|benches/)'
ci:
# pre-commit.ci doesn't have Rust toolchain, so skip Rust-specific hooks.
skip: [fmt, clippy, cargo-lock]
autoupdate_commit_msg: "chore: pre-commit autoupdate"