Skip to content

feat(rules): deny-config denies unknown sources and wildcards, and needs a reason for each ignored advisory - #47

Draft
PiquelChips wants to merge 1 commit into
feat/rule-workspace-dependenciesfrom
feat/rule-deny-config
Draft

PiquelChips wants to merge 1 commit into
feat/rule-workspace-dependenciesfrom
feat/rule-deny-config

Conversation

@PiquelChips

@PiquelChips PiquelChips commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

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

DP4: deny.toml keeps crates to crates.io, rejects * requirements, allows a list of licenses, and says why each ignored advisory doesn't apply. cargo-deny has a reason field for that, so the comment becomes data.

  • [sources] sets unknown-registry and unknown-git, and [bans] wildcards, to "deny".
  • [licenses] allow isn't empty.
  • Every [advisories] ignore entry is { id = "…", reason = "…" }.
  • --fix sets the three to "deny" (under their table, or appending it). A reason needs judgement.
  • This repository's deny.toml comment now asks for the reason field.
  • Fixes go through toml_edit; a missing setting is reported at its table's line.

Measured

piqueld sourceorigin DirkEngine
Violations 0 0 2

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

DirkEngine's two ignores are bare IDs with a comment.

Testing

  • New fixture test: a bare ID, an empty allowlist, wildcards = "warn" and a missing unknown-git; after the fix, only the two judgement calls are left.
  • 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-deny-config branch from bf6c8bb to a44caf2 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