Skip to content

Enforce the changelog entry length cap - #163

Merged
wallstop merged 2 commits into
mainfrom
t159-changelog-length-lint
Oct 10, 2026
Merged

wallstop merged 2 commits into
mainfrom
t159-changelog-length-lint

Conversation

@wallstop

@wallstop wallstop commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

DISCLOSURE: LLM-GENERATED TEXT

Why: The 300-rendered-character entry cap was guidance only, so nothing failed when an entry drifted past it.

What:

  • Add a lint that measures [Unreleased] entries as rendered text.
  • Exclude issue references and inline link targets from the count.
  • Fail closed on a missing or duplicated [Unreleased] section.
  • Wire the lint into the ladder, pre-commit, and llm-lint CI.

Fixes #159

Type of Change

  • New feature (non-breaking change that adds functionality)

Checklist

  • I have added tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have updated the CHANGELOG for user-facing changes
  • My changes do not introduce breaking changes, or breaking changes are documented

Note

Low Risk
Adds CI/pre-commit tooling and tests only; no runtime or release artifact behavior changes beyond blocking over-long changelog drafts.

Overview
Turns the existing 300 rendered-character cap for CHANGELOG.md [Unreleased] entries from documentation into an enforced check via new scripts/lint-changelog-length.js.

The linter measures rendered text (joined wraps, stripped emphasis/code markers) and does not count issue references (#123, (#123)) or inline link URLs; it only scans [Unreleased], and fails closed if that section is missing or duplicated. It is hooked into pre-commit (on CHANGELOG.md), llm-lint CI, npm run lint:changelog-length, and lint:llm:full, with PowerShell self-tests covering boundary cases and exclusions. Agent docs (ship-changes, .llm/context.md) now point contributors at npm run lint:changelog-length.

Reviewed by Cursor Bugbot for commit 5f3e450. Bugbot is set up for automated code reviews on this repo. Configure here.

The changelog style caps entries at one or two sentences (300 rendered
characters, issue references and link targets excluded), but nothing
checked the cap, so it stayed remembered rather than enforced. The new
lint measures each '[Unreleased]' entry as rendered text: soft-wrapped
lines join, emphasis and code markers strip, and inline link targets
plus issue references drop. Released sections stay unmeasured because
they are immutable history. The check fails closed on a missing or
duplicated '[Unreleased]' heading, so a renamed heading cannot silence
the cap, and passes on the empty section a release rotation leaves.

Wiring: package.json (lint:changelog-length, lint:llm:full), the
pre-commit hook, the .llm/context.md validation ladder, and a step in
llm-lint.yml on both OSes. The self-test pins the rendered lengths of
every exclusion shape by hand count, the 300/301 cap boundary, the
released-section exemption, and the fail-closed section guards.

Validation: fixtures pass and fail as designed, run-all.ps1 24/24 test
files, Prettier and .llm lints clean, npm pack succeeds. No C# changed,
so the Unity suites carry over from 73b8beb (EditMode 357/357, PlayMode
15/15).

Refs #159.
Markdown starts entries with -, *, +, 1., or 1); the lint read only -,
so an entry behind any other marker sat outside the cap instead of
failing it - the vacuous-pass direction. Entries now start at every
marker shape, and the failure report slices each marker at its own
width. Ordered non-1 markers cannot interrupt a paragraph in Markdown,
so the only loss is a contrived unindented continuation, which the
previous reading also joined, not split.

Two self-test cases pin the shape: three markers yield three measured
entries, and an ordered entry as the only content fails the cap instead
of passing ignored.

Validation: the changelog-length suite passes 18/18 cases and
run-all.ps1 passes 24/24 files; the repository lint stays clean.

Refs #159.
@wallstop
wallstop merged commit b28f7e7 into main Oct 10, 2026
3 checks passed
@wallstop
wallstop deleted the t159-changelog-length-lint branch October 10, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a changelog entry length lint (300 rendered characters)

1 participant