drop changelog gate's soft warning, keep 60-word hard cap
The 40-word warning never blocked a push, so eight bullets had drifted over it. A warning the gate emits and the process ignores just normalises drift, so it's gone — only the 60-word fail remains. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -55,7 +55,7 @@ Entries should be short imperative phrases that describe user-facing impact —
|
|||||||
|
|
||||||
### Be concise — this is the rule, not a suggestion
|
### Be concise — this is the rule, not a suggestion
|
||||||
|
|
||||||
CHANGELOG entries must be **one or two short sentences**. Strict ceiling: **40 words per bullet**, hard cap at 60. If you can't say it in one line wrapped at ~75 columns, you're writing the wrong document.
|
CHANGELOG entries must be **one or two short sentences**. Hard cap: **60 words per bullet** (enforced by `ci/changelog_gate.sh`). Aim for 30 or under; if you can't say it in one line wrapped at ~75 columns, you're writing the wrong document.
|
||||||
|
|
||||||
The CHANGELOG is read by humans scanning for what changed between two versions. It is **not** the place for the rationale, the probe results, the implementation detail, the behavior-change deep dive, or the "see also" cross-references. Those belong in:
|
The CHANGELOG is read by humans scanning for what changed between two versions. It is **not** the place for the rationale, the probe results, the implementation detail, the behavior-change deep dive, or the "see also" cross-references. Those belong in:
|
||||||
|
|
||||||
|
|||||||
@@ -111,6 +111,9 @@ heading, and (b) bumping `pubspec.yaml` `version:` in the same commit.
|
|||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
- Changelog gate is binary — dropped the soft 40-word warning, kept
|
||||||
|
the 60-word hard cap. Warnings that never blocked just normalised
|
||||||
|
drift.
|
||||||
- PTY spawning uses `posix_openpt` + `posix_spawn` instead of
|
- PTY spawning uses `posix_openpt` + `posix_spawn` instead of
|
||||||
`forkpty` — closes a ~5% deadlock window in the multithreaded Dart
|
`forkpty` — closes a ~5% deadlock window in the multithreaded Dart
|
||||||
VM (T-96, D-5 amended). Missing exe/cwd now throw `PtyException` at
|
VM (T-96, D-5 amended). Missing exe/cwd now throw `PtyException` at
|
||||||
|
|||||||
+10
-22
@@ -1,15 +1,14 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# CHANGELOG concision gate — enforces the per-bullet word caps from the
|
# CHANGELOG concision gate — enforces a single 60-word per-bullet hard
|
||||||
# git-commit skill (40 soft, 60 hard) across the `## [Unreleased]`
|
# cap on the `## [Unreleased]` section. Released sections are frozen
|
||||||
# section. Released sections are frozen and skipped (don't penalize
|
# and skipped (don't penalize historical entries pre-dating the rule).
|
||||||
# historical entries pre-dating the rule).
|
|
||||||
#
|
#
|
||||||
# A "bullet" is a markdown list item beginning with `- `, including any
|
# A "bullet" is a markdown list item beginning with `- `, including any
|
||||||
# indented continuation lines until the next bullet, blank line, or
|
# indented continuation lines until the next bullet, blank line, or
|
||||||
# heading. Word count is whitespace-tokenized.
|
# heading. Word count is whitespace-tokenized.
|
||||||
#
|
#
|
||||||
# Soft cap 40 → warn (non-zero exit only if HARD is also breached).
|
# A soft 40-word warning was tried earlier and dropped — warnings that
|
||||||
# Hard cap 60 → fail.
|
# never block a push just normalise drift, so the gate is now binary.
|
||||||
#
|
#
|
||||||
# Bypass: never. If the rule rejects something genuinely user-visible
|
# Bypass: never. If the rule rejects something genuinely user-visible
|
||||||
# that needs more context, the context belongs in the commit body or a
|
# that needs more context, the context belongs in the commit body or a
|
||||||
@@ -18,7 +17,6 @@ set -euo pipefail
|
|||||||
cd "$(dirname "$0")/.."
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
CHANGELOG=CHANGELOG.md
|
CHANGELOG=CHANGELOG.md
|
||||||
SOFT_CAP=40
|
|
||||||
HARD_CAP=60
|
HARD_CAP=60
|
||||||
|
|
||||||
if [[ ! -f "$CHANGELOG" ]]; then
|
if [[ ! -f "$CHANGELOG" ]]; then
|
||||||
@@ -26,24 +24,18 @@ if [[ ! -f "$CHANGELOG" ]]; then
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
awk -v soft="$SOFT_CAP" -v hard="$HARD_CAP" '
|
awk -v hard="$HARD_CAP" '
|
||||||
BEGIN { in_unreleased = 0; bullet = ""; bullet_start = 0; fail = 0; warn = 0 }
|
BEGIN { in_unreleased = 0; bullet = ""; bullet_start = 0; fail = 0 }
|
||||||
|
|
||||||
function check_bullet() {
|
function check_bullet() {
|
||||||
if (bullet == "") return
|
if (bullet == "") return
|
||||||
n = split(bullet, _words, /[[:space:]]+/)
|
# Trim the leading "- " marker, then tokenize on whitespace.
|
||||||
# split() counts a trailing empty token when the string starts/ends with
|
|
||||||
# whitespace; trim the leading "- " marker too.
|
|
||||||
gsub(/^- +/, "", bullet)
|
gsub(/^- +/, "", bullet)
|
||||||
n = split(bullet, _words, /[[:space:]]+/)
|
n = split(bullet, _words, /[[:space:]]+/)
|
||||||
if (n > hard) {
|
if (n > hard) {
|
||||||
printf "FAIL line %d: bullet is %d words (hard cap %d)\n", bullet_start, n, hard
|
printf "FAIL line %d: bullet is %d words (cap %d)\n", bullet_start, n, hard
|
||||||
printf " %s\n\n", substr(bullet, 1, 120) (length(bullet) > 120 ? "..." : "")
|
printf " %s\n\n", substr(bullet, 1, 120) (length(bullet) > 120 ? "..." : "")
|
||||||
fail++
|
fail++
|
||||||
} else if (n > soft) {
|
|
||||||
printf "WARN line %d: bullet is %d words (soft cap %d)\n", bullet_start, n, soft
|
|
||||||
printf " %s\n\n", substr(bullet, 1, 120) (length(bullet) > 120 ? "..." : "")
|
|
||||||
warn++
|
|
||||||
}
|
}
|
||||||
bullet = ""
|
bullet = ""
|
||||||
bullet_start = 0
|
bullet_start = 0
|
||||||
@@ -76,10 +68,6 @@ awk -v soft="$SOFT_CAP" -v hard="$HARD_CAP" '
|
|||||||
printf " See .claude/skills/git-commit/SKILL.md \"Be concise\".\n"
|
printf " See .claude/skills/git-commit/SKILL.md \"Be concise\".\n"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
if (warn > 0) {
|
printf "==> changelog gate OK\n"
|
||||||
printf "==> changelog gate OK with %d warning(s) over %d words.\n", warn, soft
|
|
||||||
} else {
|
|
||||||
printf "==> changelog gate OK\n"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
' "$CHANGELOG"
|
' "$CHANGELOG"
|
||||||
|
|||||||
Reference in New Issue
Block a user