Skip to content

feat(pr-checks): no-co-authors fails on Co-authored-by trailers in the description or commits - #23

Draft
PiquelChips wants to merge 1 commit into
feat/pr-check-bodyfrom
feat/pr-check-co-authors
Draft

PiquelChips wants to merge 1 commit into
feat/pr-check-bodyfrom
feat/pr-check-co-authors

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

What and why

The standard forbids Co-authored-by trailers, but tools add them by default, and nothing catches one before it reaches main. This adds no-co-authors (G4) to the pull request checks of #21.

  • What fails: a line starting with co-authored-by:, in any case, in the description or in any commit message. The commit messages come from pulls.listCommits, paginated.
  • Comments count: the description is checked as written, HTML comments included, because a squash merge may copy the description into the commit on main.
  • Fix:
    • for the description, delete the line;
    • for a commit, the finding names the short SHA and subject, and says to reword it with git rebase -i and push with --force-with-lease.
  • The crate's README lists the check. No new input.

Testing

  • 3 new Node tests (26 in all):
    • a clean pull request whose prose mentions the phrase passes;
    • a trailer in the description fails, including inside a comment and in another case;
    • only the commits with trailers are named.
  • just check-changed origin/feat/pr-check-body passes.
  • Dogfood: this pull request's own PR run checks its commit and this description.

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-co-authors branch from d55c68a to 456981e Compare November 22, 2026 20:25
…e description or commits

no-co-authors (G4) reads the description and every commit message through
the API and names each trailer it finds with how to remove it.
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