mirror of
https://github.com/sotashimozono/obsidian-remote-ssh.git
synced 2026-07-22 17:10:32 +00:00
Previous commit34e0e34over-corrected by skipping commitlint on every next → main promotion PR, hiding a future class of CC violations sneaking through admin-bypass direct pushes. Properly: - commitlint workflow back to skipping ONLY sync PRs (head_ref=main). Promotion PRs (head=next, base=main) lint the full aggregate again. - commitlint.config.mjs grows an ignores predicate for the one historical commit (888977d) whose 'merge:' prefix isn't a CC type. That commit landed via admin bypass before stricter branch protection was in place. Acknowledged + scoped opt-out, not a relaxed rule. Follow-up needed: tighten branch protection on main + next to disallow admin bypass so this class of leak can't happen again.
65 lines
2.2 KiB
JavaScript
65 lines
2.2 KiB
JavaScript
// Phase D-α — Conventional Commits config for commitlint.
|
||
//
|
||
// Extends the standard `@commitlint/config-conventional` ruleset
|
||
// (Angular spec) with two repo-specific tweaks:
|
||
//
|
||
// 1. **Wider subject-case** — the standard config rejects
|
||
// anything but lower-case subjects. This repo's existing
|
||
// history happily mixes "Phase C.M3 — …" and other
|
||
// mixed-case subjects, so we relax `subject-case` to accept
|
||
// any case as long as the type/scope/subject shape is right.
|
||
//
|
||
// 2. **Wider header-max-length** — the standard cap is 100
|
||
// chars; our convention prefixes versions like
|
||
// `(0.4.48)` to commit subjects, plus em-dashes and
|
||
// Conventional Commits scopes can push us past 100. Bump to
|
||
// 144 to give the existing style room to breathe.
|
||
//
|
||
// Allowed types come from the existing repo history (collected by
|
||
// `git log --format=%s | grep -oE '^[a-z]+' | sort -u`):
|
||
//
|
||
// build / chore / ci / docs / feat / fix / perf / refactor /
|
||
// revert / style / test
|
||
//
|
||
// Plus `release` for any future "release v…" commits the
|
||
// release-on-merge workflow may emit.
|
||
|
||
export default {
|
||
extends: ['@commitlint/config-conventional'],
|
||
rules: {
|
||
'subject-case': [0],
|
||
'header-max-length': [2, 'always', 144],
|
||
'type-enum': [
|
||
2,
|
||
'always',
|
||
[
|
||
'build',
|
||
'chore',
|
||
'ci',
|
||
'docs',
|
||
'feat',
|
||
'fix',
|
||
'perf',
|
||
'refactor',
|
||
'revert',
|
||
'style',
|
||
'test',
|
||
'release',
|
||
],
|
||
],
|
||
// Scopes are free-form (plugin / server / proto / deploy /
|
||
// ci / etc) — don't restrict via `scope-enum` because new
|
||
// scopes appear naturally as the codebase grows.
|
||
'scope-empty': [0],
|
||
},
|
||
// Historical opt-out: one bootstrap commit (`888977d`) landed on
|
||
// `next` via admin bypass before stricter branch protection was in
|
||
// place. Its `merge:` prefix isn't a CC type. We acknowledge the
|
||
// leak by ignoring this specific commit message rather than relaxing
|
||
// type-enum (which would invite future "merge:" misuse) and rather
|
||
// than skipping commitlint on the entire promotion PR (which would
|
||
// hide future leaks).
|
||
ignores: [
|
||
(msg) => msg.startsWith('merge: bring main 1.0.43 promotion commit into next'),
|
||
],
|
||
};
|