Skip to content

chore: deny unused licenses and license exceptions in cargo-deny - #3497

Merged
blackmwk merged 3 commits into
mainfrom
kevinjqliu-deny-unused-licenses
Oct 21, 2026
Merged

blackmwk merged 3 commits into
mainfrom
kevinjqliu-deny-unused-licenses

Conversation

@kevinjqliu

@kevinjqliu kevinjqliu commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

  • N/A (maintenance).

What changes are included in this PR?

Sets unused-allowed-license and unused-license-exception to deny (cargo-deny defaults both to warn), so unused allowed licenses and stale per-crate exceptions fail the check instead of slipping through.

Based on the change by @dannycjones in this earlier PR.

Are these changes tested?

Config-only. cargo deny check licenses passes (cargo-deny 0.19.9). An unused allowed license fails with license-not-encountered, and a stale exception fails with license-exception-not-encountered.

AI Disclosure

Prepared with Copilot (made the change and ran the checks); no areas of particular uncertainty.

Copilot AI balanced review requested due to automatic review settings October 20, 2026 21:07
@kevinjqliu kevinjqliu changed the title chore: deny unused licenses and license exceptions in cargo-deny chore: tighten cargo-deny checks Oct 20, 2026
@kevinjqliu kevinjqliu changed the title chore: tighten cargo-deny checks chore: deny unused licenses and license exceptions in cargo-deny Oct 20, 2026
@kevinjqliu
kevinjqliu force-pushed the kevinjqliu-deny-unused-licenses branch from 1b7baa5 to def242e Compare October 20, 2026 21:09
Co-authored-by: Daniel Carl Jones <[email protected]>
Co-authored-by: Copilot App <[email protected]>
@kevinjqliu
kevinjqliu force-pushed the kevinjqliu-deny-unused-licenses branch from def242e to cc039a5 Compare October 20, 2026 21:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

No open issues 🎉

What changed in this PR

Tightens cargo-deny license hygiene by failing the check when configured allowed licenses or per-crate license exceptions are no longer encountered, preventing stale entries from lingering unnoticed.

Changes:

  • Set unused-allowed-license to deny so unused entries in licenses.allow fail the check
  • Set unused-license-exception to deny so stale per-crate exceptions fail the check
File Description
deny.toml Makes unused allowed licenses and license exceptions fail cargo deny check licenses instead of warning

Review effort: Lite

Co-authored-by: Copilot App <[email protected]>
@kevinjqliu kevinjqliu mentioned this pull request Oct 20, 2026
3 tasks

@dannycjones dannycjones left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one comment, but I think we should ship with either config

Comment thread deny.toml
# https://www.apache.org/legal/resolved.html#category-a
"BSL-1.0",
]
unused-allowed-license = "deny"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking to simply leave them allowed, since its effectively the list of category A and its just churn to remove or add.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a stricter rule is better so that we could clean unnecessary items in time.

@blackmwk blackmwk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kevinjqliu for this pr!

@blackmwk
blackmwk added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit 8fbaf47 Oct 21, 2026
24 checks passed
@blackmwk
blackmwk deleted the kevinjqliu-deny-unused-licenses branch October 21, 2026 09:50
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.

4 participants