Skip to content

refactor(rules): the rules read TOML files through one typed loader that keeps their lines - #35

Draft
PiquelChips wants to merge 1 commit into
feat/readme-standardfrom
refactor/toml-files
Draft

PiquelChips wants to merge 1 commit into
feat/readme-standardfrom
refactor/toml-files

Conversation

@PiquelChips

@PiquelChips PiquelChips commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Stacked on #13; 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

The next rules each read a TOML file (rust-toolchain.toml, rustfmt.toml, clippy.toml, deny.toml, the manifests…) and need a line for every violation. Today workspace-lints and budget each read, parse and track lines by hand.

  • TomlFile<T>: a file deserialized into the shape its rule needs, keeping its text, with line(&Spanned). load (missing is None) and require (missing is an error).
  • workspace-lints' manifests and [workspace.lints] move to manifest.rs (RootManifest, Manifest, Setting) and load through it; budget.toml too. --fix keeps its own toml_edit path.
  • No behaviour change.

Testing

  • 41 tests pass, Clippy is clean, and cargo xtask standard passes on this repository.
  • 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. (None: crate-private.)
  • just check-changed passes.

Note

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

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