Skip to content

feat(rules): anyhow-edges keeps anyhow out of libraries that aren't a binary's edge - #48

Draft
PiquelChips wants to merge 1 commit into
feat/rule-deny-configfrom
feat/rule-anyhow-edges
Draft

PiquelChips wants to merge 1 commit into
feat/rule-deny-configfrom
feat/rule-anyhow-edges

Conversation

@PiquelChips

@PiquelChips PiquelChips commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

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

E2's manifest half: anyhow belongs at a binary's edge; libraries return typed errors. The Dylint half (.context on every ?) isn't in this stack.

  • A crate with a library may not have a normal dependency on anyhow, unless standard.toml's new anyhow-crates lists it as an edge. Binary-only crates (xtask) and dev-dependencies pass.
  • Each listed name must be a workspace crate.
  • Dependency in the metadata now has its kind.
  • The README's standard.toml example now puts its top-level keys before [deviations]. Before, unsafe-modules sat after the table, so it would have parsed as a deviation.
  • A dependency's kind is an enum (DependencyKind), like the target kinds.

Measured

piqueld sourceorigin DirkEngine
Violations 4 0 8

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

  • piqueld: piqueld (the daemon's crate, which would be listed as an edge), piqueld-config, piqueld-docker, piqueld-store: the inventory's 3 plus the daemon.
  • DirkEngine: 8 crates, which its wider rule allows; it would list them.

Testing

  • New fixture test: a library, a listed library, a dev-dependency, a binary-only crate, and a listed name that is no crate.
  • 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. (standard.toml gains anyhow-crates (optional). Repositories list their edge libraries or fix them.)
  • just check-changed passes.

Note

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

@PiquelChips
PiquelChips force-pushed the feat/rule-anyhow-edges branch from 4519886 to d2dd4af 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