Skip to content

feat(rules): cargo-locked makes every Cargo command in recipes, workflows and t3.json pass --locked - #38

Draft
PiquelChips wants to merge 1 commit into
feat/rule-layoutfrom
feat/rule-cargo-locked
Draft

PiquelChips wants to merge 1 commit into
feat/rule-layoutfrom
feat/rule-cargo-locked

Conversation

@PiquelChips

@PiquelChips PiquelChips commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Stacked on #37; part of a stack adding the standard's rules over manifests, config files, workflows, recipes and docs. Rebased onto #13's head c4a57df.

What and why

TC4: a Cargo command without --locked may rewrite Cargo.lock in CI or under an agent. cargo xtask is covered by layout's alias; the rest need a check.

  • Scans every justfile, *.just, .github YAML file and t3.json for cargo build, check, clippy, doc, llvm-cov, nextest, publish, run and test without --locked (or --frozen).
  • A command runs from cargo to the next &&, ||, ; or |, across lines ending in \. # lines are skipped, +toolchain is understood, and so are just's @/- prefixes.
  • --fix inserts --locked after the subcommand (after run for cargo nextest run), one fix per line naming it, since apply_all drops fixes with the same description.
  • These files aren't TOML, so Fix gains a second edit beside the toml_edit one: Fix::line replaces a line of a non-TOML file. TOML files still go through toml_edit only.
  • A TextFile loader for the files rules read line by line.

Measured

piqueld sourceorigin DirkEngine
Violations 7 0 0

Measured read-only at origin/main: piqueld a17710f52, sourceorigin e99cc0e6b, DirkEngine 07e8ba44.

piqueld's 7 are all cargo run in its justfile. The inventory's other 13 were cargo xtask (now layout's alias) or comments.

Testing

  • New fixture tests: locked, unlocked, +nightly, continued lines, ;/&& chains, a comment, a workflow block and t3.json; a script outside the scanned files is ignored. The fix's output is compared line by line.
  • At this commit: Clippy with -D warnings, cargo nextest run --workspace and cargo xtask standard pass with a clean tree; just readme regenerated the rules list.
  • At the stack's tip: just check-changed origin/feat/readme-standard passes (fmt-check, audit, unused, standard, lint, doc, test, doc-test, package).

Checklist

  • The crate's README (its documentation on docs.rs) shows the change, and a repository's xtask can still follow it.
  • A change to the public API is noted for the next release, with what each repository's xtask must change. (A new rule: each repository fixes its violations (cargo xtask standard --fix where a fix exists) or adds a deviation with its reason.)
  • just check-changed passes.

Note

Written by Claude Opus 5.5 in Claude Code (via T3 Code)

@PiquelChips
PiquelChips force-pushed the feat/rule-cargo-locked branch from 0643754 to f1232f2 Compare November 22, 2026 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant