ci(commitlint): 470 — gate Conventional Commits type at PR time - #106
Draft
randomdevpete wants to merge 1 commit into
Draft
ci(commitlint): 470 — gate Conventional Commits type at PR time#106randomdevpete wants to merge 1 commit into
randomdevpete wants to merge 1 commit into
Conversation
Adds commitlint.config.cjs, wired into a new commitlint CI job that lints every commit a PR adds over its base against @commitlint/config-conventional's type-enum/type-case/type-empty rules. An untyped or miscased commit (`Style:`) now fails before it can reach master; commit-analyzer's type-to-bump mapping otherwise silently drops such commits from every release. Line-length and subject-case rules are disabled — they flag this project's normal prose, not the type prefix. Documents the new gate in docs/release-strategy.md alongside the existing release-cadence docs. Ticket: 470
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds commitlint enforcement at PR time so untyped and miscased commits cannot reach master. The CI job runs only on pull_request events and checks the exact range the PR adds, using
@commitlint/config-conventional'stype-enum,type-caseandtype-emptyrules — the same type set semantic-release's commit-analyzer recognises.Style exceptions left standing
Four rules from
@commitlint/config-conventionalare disabled incommitlint.config.cjsbecause they would flag this project's normal prose patterns rather than genuine issues:header-max-length: The longest current commit header is 101 characters (e.g.refactor(demos): source is always shown - drop the accordion, add a filename heading linked to GitHub). Disabling lets legitimate long subjects through.body-max-line-length/footer-max-line-length: Disabled to allow long lines when quoting documentation or file paths.subject-case: Disabled to allow proper nouns naturally appearing in subjects (e.g.feat(foo): Add GitHub support— the capitalised "GitHub" would otherwise violate lowercase enforcement).No local commit-msg hook
Deliberately omitted. The
branch-base.sh inithook in<root>/TODOS/scripts/installs a sharedcommit-msghook that appends theTicket:trailer, required for fork-point tracking in every worktree. Composing a second commitlint hook locally was judged riskier than it is worth, and every landing goes through a PR anyway, where the CI job gates the format. The hook remains in CI only.Producer's validation
fix(paper-kit): 760 — state the flat-piece origin and require flat pieces for surfaces✓chore(release): 2.6.0 [skip ci]✓