Skip to content

ci: lint every commit in a pull request, not only its title - #1104

Merged
dougborg merged 1 commit into
mainfrom
ci/lint-every-commit
Sep 24, 2026
Merged

dougborg merged 1 commit into
mainfrom
ci/lint-every-commit

Conversation

@dougborg

Copy link
Copy Markdown
Owner

Summary

The owner's merge rule is now rebase merges only, with linear history: no squash merges and no merge commits (dougborg/dougborg-dot-net#511). With rebase, every commit in a pull request lands on main as written, and release-please derives versions and changelogs for client and mcp from each one. Today nothing lints commit messages here; malformed types just silently skip a bump.

  • Commit check: adds .github/workflows/commitlint.yml (workflow Commit conventions, job Conventional commits). It runs @commitlint/cli 21.2.3 (pinned) over base..head of the pull request, using only the checkout (v7.0.1) and setup-node (v7.0.0) SHAs already pinned in ci.yml. Top-level permissions: {}, job-level contents: read, persist-credentials: false.
  • Linter config: .commitlintrc.json extends @commitlint/config-conventional with a type list matching the changelog-sections in release-please-config.json (build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test). Body and footer line length are unlimited, because Dependabot bodies carry release notes.
  • Dependabot: every entry now uses prefix: chore with include: scope, so commits read chore(deps): bump … / chore(deps-dev): bump … instead of the double-scoped chore(deps)(deps): …. The ecosystem is still visible from the labels.
  • Auto-merge: dependabot-auto-merge.yml now runs gh pr merge --auto --rebase instead of --squash. The existing guard is unchanged: it only acts when both the PR author and the event sender are dependabot[bot] (ID 49699333), so a manually rebased head (which loses the bot's verified signature) stays under manual review, and fetch-metadata keeps commit verification on. The workflows README documents the new job and the --rebase switch; the repo's mdformat hook also rewrapped three existing paragraphs in that README.

Signed commits: nothing in this repository requires them. The only ruleset (Protect Main) has deletion, non_fast_forward, required_linear_history, pull_request, copilot_code_review, required_status_checks; there is no classic branch protection (so no required_signatures). Rebase merges are therefore not blocked by a signature rule.

After this merges and the check is green, dougborg/dougborg-dot-net#511 switches this repository and its Protect Main ruleset to rebase-only, and adds Conventional commits as a required check.

Test plan

  • commitlint over the whole history (1,184 commits): 63 commits with errors, 34 with warnings only (footer-leading-blank). Errors are historical and informational: subject-case 34, header-max-length 18, type-empty/subject-empty 13 (non-Conventional subjects), type-enum 1.
  • A Dependabot-style chore(deps): bump x from 1 to 2 message with a >100-character body line passes; a bare "Update the readme" fails
  • actionlint, zizmor 1.25.2, and pre-commit (mdformat, yamllint, pytest) pass on the changed files
  • The new Conventional commits job passes on this PR

🤖 Generated with Claude Code

main now takes rebase merges only, with linear history. Every commit in a
pull request lands on main as written, and release-please derives version
bumps and changelogs from each one, so each commit must be a Conventional
Commit.

Add a Conventional commits job that runs a pinned @commitlint/cli over the
pull request's base..head range. .commitlintrc.json extends
config-conventional with the changelog types from release-please-config.json
and no body or footer line limit, because Dependabot bodies carry release
notes.

Dependabot now uses the plain chore prefix with its scope, giving
chore(deps): and chore(deps-dev): instead of chore(deps)(deps):, and the
auto-merge workflow enables rebase auto-merge instead of squash.

mdformat also rewraps a few existing lines in the workflows README.

Refs dougborg/dougborg-dot-net#511

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@dougborg
dougborg merged commit 3fc60ad into main Sep 24, 2026
21 checks passed
@dougborg
dougborg deleted the ci/lint-every-commit branch September 24, 2026 00:00
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