Skip to content

feat(pr-checks): lint-exceptions shows every exception a pull request adds and gates it on the owner's approval - #29

Draft
PiquelChips wants to merge 2 commits into
feat/pr-check-new-dependencyfrom
feat/pr-check-lint-exceptions
Draft

PiquelChips wants to merge 2 commits into
feat/pr-check-new-dependencyfrom
feat/pr-check-lint-exceptions

Conversation

@PiquelChips

@PiquelChips PiquelChips commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

What and why

An exception to a rule is fine when someone has decided it is, but today an #[expect], a raised budget.toml ceiling or a new standard.toml deviation can merge without the owner ever seeing it. This adds lint-exceptions (C11), the last of the pull request checks of #21. The point isn't to forbid exceptions. It's that a loosened rule is always seen.

  • What it lists:

    • each added line in a .rs file holding #[expect(, #![expect( or a cfg_attr(…, expect(…)), at its line in the new file;
    • each budget.toml ceiling raised or added;
    • each standard.toml deviation added, reworded or widened. A deviation can be scoped with paths and crates: a scope that gains a path or crate, or is dropped so the deviation applies everywhere, widens it. A narrower scope passes. The string, inline-table and [deviations.rule] forms all read the same.

    Lowered ceilings, removed attributes and deleted files don't count. A .rs file too large for GitHub to diff is flagged for a manual look.

  • Where: in the job summary, every time, as annotations on the lines.

  • The gate: the job fails until one of these:

    • a login in the new approvers input approves the latest commit. A later "changes requested" or a dismissal withdraws the approval, and an approval of an older commit doesn't count;
    • the pull request carries the approved-exception label.

    Once allowed, findings stay in the summary as notices. The caller workflow already re-runs on reviews and labels.

  • Report-only: enforce-lint-exceptions: false lists the exceptions without failing, so a repository can adopt the check before its backlog is approved.

  • Fix: each finding asks for the approval or the label, and says to write in the exception's reason why the rule is wrong there.

  • The crate's README lists the check and the two inputs. This repository's pr.yml sets the owner as approver and enforces the check.

Testing

  • 9 new Node tests (47 in all):
    • attribute forms and their line numbers from hunk headers;
    • removed lines, deleted files and non-Rust files;
    • a file too large to diff;
    • budget raises, new tables and lowered ceilings;
    • new, reworded and unchanged deviations, plus scoped ones that widen, narrow or drop their scope;
    • approvals: the owner's on the latest commit, followed by a comment, by someone else, stale, withdrawn and dismissed;
    • the label and report-only mode.
  • just check-changed origin/feat/pr-check-new-dependency passes.
  • Dogfood: this pull request's own PR run, which adds no exception.
  • Dogfood also caught a false positive in feat(pr-checks): pr-body checks the description fills the template and links issues in the repository's form #22's pr-body: issue links quoted in code were read as links. It's fixed there, and the stack is rebased on the fix.

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. Each repository passes approvers, and may start with enforce-lint-exceptions: false.)
  • just check-changed passes.

Note

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

… adds and gates it on the owner's approval

lint-exceptions (C11) lists added #[expect] attributes, raised budget.toml
ceilings and new or reworded standard.toml deviations in the job summary,
and fails until an approver approves the latest commit or the pull request
carries the approved-exception label. enforce-lint-exceptions: false only
reports them.
standard.toml's deviations may now be scoped with paths and crates: a
scope that gains an entry, or is dropped for everywhere, loosens the rule
like a new reason does, while a narrower scope passes.
@PiquelChips
PiquelChips force-pushed the feat/pr-check-new-dependency branch from 164cb39 to 58db183 Compare November 22, 2026 22:13
@PiquelChips
PiquelChips force-pushed the feat/pr-check-lint-exceptions branch from 8e564d3 to 1491337 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