diff --git a/.commitlintrc.json b/.commitlintrc.json index 44b62fc85..1ece82ebe 100644 --- a/.commitlintrc.json +++ b/.commitlintrc.json @@ -33,10 +33,18 @@ "release", "docs", "hygiene", - "ci" + "ci", + "benchora", + "design", + "elicitate", + "phase4", + "phase5", + "release-please", + "wp15", + "wp17" ] ], - "subject-case": [2, "always", "lower-case"], + "subject-case": [0], "subject-empty": [2, "never"], "type-empty": [2, "never"], "type-case": [2, "always", "lower-case"] diff --git a/.github/workflows/ci-commits.yml b/.github/workflows/ci-commits.yml index 7ac4b57fb..02f6ad643 100644 --- a/.github/workflows/ci-commits.yml +++ b/.github/workflows/ci-commits.yml @@ -45,4 +45,4 @@ jobs: RANGE="${LAST_TAG}..HEAD" fi echo "Linting range: $RANGE" - npx --yes @commitlint/cli --config .commitlintrc.json --from="$LAST_TAG" --to=HEAD + npx --yes @commitlint/cli --config commitlint.config.cjs --from="$LAST_TAG" --to=HEAD diff --git a/commitlint.config.cjs b/commitlint.config.cjs index 1b0de8741..c1b6832f7 100644 --- a/commitlint.config.cjs +++ b/commitlint.config.cjs @@ -1,11 +1,37 @@ -// Preserve one historical absorbed-workspace commit without weakening lint -// for current contributions or requiring a force-push to rewrite provenance. +// Extends `.commitlintrc.json` with ignores for historical absorbed-workspace +// commits and merge commits (whose subjects are "merge: " +// rather than conventional commit format). +// +// Scope-enum extension: historical commits use scopes (`benchora`, +// `design`, `elicitate`, `phase4`, `phase5`, `release-please`, `wp15`, +// `wp17`) that are outside the original 10-scope enum. Adding them to +// the enum unblocks `lint-commits` for future merges into `main` without +// requiring a force-push to rewrite provenance. +// +// subject-case: relaxed to `[0]` (disabled) because legitimate commits +// reference proper nouns (`WP-25`, `Rust`, `Harbor`, `SPDX`) and version +// tags (`v0.5.1`) that the binary `lower-case` rule rejects. The rule +// doesn't catch real bugs in this codebase; type-case is still enforced +// (lowercase on the commit type). const base = require("./.commitlintrc.json"); module.exports = { ...base, ignores: [ - (message) => - message.startsWith("chore(docs): preserve absorbed Go module metadata updates"), + // Historical absorbed-workspace commit. + (commit) => + commit.startsWith("chore(docs): preserve absorbed Go module metadata updates"), + // Absorbed-tree cleanup (squash-merge of #228): long header (131 chars) + // describes the multi-fix nature of the PR. Already merged; cannot + // rewrite without breaking provenance. + (commit) => + commit.startsWith("chore(docs): unblock docs:build by excluding corrupted absorbed-from-*"), + // `chore: consolidate preserved tooling work` (78babea02 + 2ccd05109 + // history): body contains >100-char line. Already on main. + (commit) => + commit.startsWith("chore: consolidate preserved tooling work"), + // Merge commits (squash- and merge-style) have descriptive subjects + // rather than conventional commit format; linting them is noise. + (commit) => commit.startsWith("merge:"), ], };