xtask: check documented switches are read #3539

Open
github-bot wants to merge 1 commit from github-bot/gh-3539 into main AGit
Owner

@⁠tharun-37 on GitHub · 2026-11-27 15:39 UTC · original
tharun-37:xtask/switch-docs-check → main · +336 −6 · 5 files · 1 commits · open

Adds cargo xtask check-switches and runs it from the pre-commit hook after the asset-policy check.

The checker extracts concrete VICTORY_* names from README.md and docs/**/*.md, then verifies each is passed to an environment read in Rust source (var, var_os, switch::on, env!, and the existing env_path/numbers helpers). Comments and writes such as set_var or .env(...) do not count. Wildcards and lowercase names are ignored, and duplicate doc mentions yield one diagnostic.

The current tree passes with 29 documented names. Six synthetic tests cover direct reads, helpers, comments, writes, similar names, duplicate mentions, and line-number reporting. No game data, generated files, shader names or hashes are involved.

Verification:

  • cargo test -p xtask: 13 passed, 0 failed.
  • cargo xtask check-switches: 29 names ok.
  • cargo clippy --workspace --all-targets --locked -- -D warnings passes.
  • cargo xtask policy: 192 files ok.
  • Full workspace tests still show the same 3 pre-existing victory-gpu failures.

Claim: #1633

AI-assisted (OpenCode).

**@⁠tharun-37** on GitHub · 2026-11-27 15:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/3539) `tharun-37:xtask/switch-docs-check` → `main` · +336 −6 · 5 files · 1 commits · open Adds `cargo xtask check-switches` and runs it from the pre-commit hook after the asset-policy check. The checker extracts concrete `VICTORY_*` names from `README.md` and `docs/**/*.md`, then verifies each is passed to an environment read in Rust source (`var`, `var_os`, `switch::on`, `env!`, and the existing `env_path`/`numbers` helpers). Comments and writes such as `set_var` or `.env(...)` do not count. Wildcards and lowercase names are ignored, and duplicate doc mentions yield one diagnostic. The current tree passes with 29 documented names. Six synthetic tests cover direct reads, helpers, comments, writes, similar names, duplicate mentions, and line-number reporting. No game data, generated files, shader names or hashes are involved. Verification: - `cargo test -p xtask`: 13 passed, 0 failed. - `cargo xtask check-switches`: 29 names ok. - `cargo clippy --workspace --all-targets --locked -- -D warnings` passes. - `cargo xtask policy`: 192 files ok. - Full workspace tests still show the same 3 pre-existing `victory-gpu` failures. Claim: https://git.gtahub.st/github/Marvisak--VIctory/issues/1633 AI-assisted (OpenCode).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 15:46:41 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3539/head:github-bot/gh-3539'
git switch 'github-bot/gh-3539'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3539'
git switch 'github-bot/gh-3539'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3539'
git switch 'github-bot/gh-3539'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3539'
git switch 'main'
git merge --squash 'github-bot/gh-3539'
git switch 'main'
git merge --ff-only 'github-bot/gh-3539'
git switch 'main'
git merge 'github-bot/gh-3539'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!3539
No description provided.