Skip to content

feat(pr-checks): new-dependency asks for a Dependencies section when a pull request adds one - #27

Draft
PiquelChips wants to merge 1 commit into
feat/pr-check-fix-has-testfrom
feat/pr-check-new-dependency
Draft

PiquelChips wants to merge 1 commit into
feat/pr-check-fix-has-testfrom
feat/pr-check-new-dependency

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

What and why

A new dependency or a cargo-deny exception should come with its reasons, as the tech-stack skill writes them. Until now one could slip in with a one-line diff to Cargo.toml. This adds new-dependency (DP8) to the pull request checks of #21.

  • What counts as added:
    • In the workspace's Cargo.toml, a dependency named in [workspace.dependencies] after the pull request but not before. Both the name = … form and the [workspace.dependencies.name] form count.
    • In deny.toml, an element in one of these arrays that wasn't there before: advisories.ignore, licenses.allow, licenses.exceptions, bans.skip, bans.skip-tree, sources.allow-git or sources.allow-registry. Inline arrays and [[array.tables]] both count.
    • Changing the version or features of an existing dependency doesn't count.
  • How: both files are read at the base and head commits through the API, and only when the pull request changes them, with the TOML reader from feat(pr-checks): a reusable workflow checks each pull request, starting with its title #21.
  • Fix: each addition is a finding at its file and line, asking for a ## Dependencies section in the description. Once that section has more than comments, the check passes. What it says is left to review.
  • The crate's README lists the check. No new input.

Testing

  • 6 new Node tests (37 in all):
    • both manifest forms, at the right lines, a multi-line inline table included;
    • edits to existing dependencies pass;
    • a new manifest counts every dependency;
    • deny.toml additions in arrays, arrays of tables and inline-table arrays;
    • a filled Dependencies section passes and an empty one doesn't;
    • an unchanged manifest isn't fetched.
  • just check-changed origin/feat/pr-check-fix-has-test passes.
  • Dogfood: this pull request's own PR run, which adds no dependency.

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. (No API change.)
  • just check-changed passes.

Note

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

@PiquelChips
PiquelChips force-pushed the feat/pr-check-fix-has-test branch from 1982583 to e0508d2 Compare November 22, 2026 20:25
@PiquelChips
PiquelChips force-pushed the feat/pr-check-new-dependency branch from a74e42a to 164cb39 Compare November 22, 2026 20:26
…a pull request adds one

new-dependency (DP8) compares the workspace's [workspace.dependencies] and
deny.toml's exception arrays before and after the pull request, through
the API, and points at each addition when the description has no
Dependencies section.
@PiquelChips
PiquelChips force-pushed the feat/pr-check-fix-has-test branch from e0508d2 to fc5d60b Compare November 22, 2026 22:13
@PiquelChips
PiquelChips force-pushed the feat/pr-check-new-dependency branch from 164cb39 to 58db183 Compare November 22, 2026 22:13
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