daa248388f
GitHub's "Create a merge commit" merge option builds the commit message
from the PR body. When the body contains markdown lists or blank lines
(e.g. PR #4113 → merge 5ed233f01), commitlint parses subsequent
paragraphs as additional commit subjects and fails with subject-empty /
type-empty.
Two-layer fix:
- commitlint.config.js: ignore standard "Merge " prefixed messages.
- static_quality.yml: guard the push-path `--last` step with a
parent-count check so true merge commits (which keep the PR-title
header and thus don't match the "Merge " prefix) are skipped
before commitlint runs at all.
18 lines
791 B
JavaScript
18 lines
791 B
JavaScript
module.exports = {
|
|
extends: ["@commitlint/config-conventional"],
|
|
// Skip standard git merge commits (e.g. "Merge pull request #N",
|
|
// "Merge branch '...'"). The push-path workflow additionally guards
|
|
// `--last` with a parent-count check so GitHub "Create a merge commit"
|
|
// style merges (which take their message from the PR body and can
|
|
// therefore contain markdown lists that parse as empty subjects) are
|
|
// skipped before commitlint even runs.
|
|
ignores: [(message) => /^Merge /.test(message)],
|
|
rules: {
|
|
"subject-case": [0],
|
|
// GitHub merge commits append " (#NNNN)" which eats 8+ chars.
|
|
// With scoped conventional prefixes like "fix(runtime): ...",
|
|
// 100 chars is too tight. 120 gives enough room.
|
|
"header-max-length": [2, "always", 120],
|
|
},
|
|
};
|