Skip to content

ci: raise the commit body line limit to 100 characters - #6743

Merged
otavio merged 1 commit into
masterfrom
chore/commit-msg-line-length-100
Jul 27, 2026
Merged

ci: raise the commit body line limit to 100 characters#6743
otavio merged 1 commit into
masterfrom
chore/commit-msg-line-length-100

Conversation

@otavio

@otavio otavio commented Jul 27, 2026

Copy link
Copy Markdown
Member

What

Raises the Check Line Length limit in Commit Message Check from 80 to 100
characters. The subject limit is unchanged at 80.

Why

The GHSA-c5cf-fr53-8wq4 commit failed the check on master
(run 30293820299),
with seven body lines wrapped at 81-82 characters.

The 80-character body limit sat in a dead zone. git log indents bodies by four
spaces, so an 80-column body already renders at 84 and wraps in a standard
terminal — the limit was neither the conventional 72 (chosen so 72+4 fits) nor
wide enough to be permissive. It was also too narrow to hold a long URL or an
advisory summary, and the body pattern has no exemption for unwrappable content,
unlike the title pattern which exempts Merge pull request.

The subject stays at 80 because GitHub truncates commit and pull request titles
well before that, so widening it would hide text rather than help.

Changes

  • .github/workflows/commit.yml: Check Line Length pattern {0,80} ->
    {0,100}, with the error message updated to match.

The companion change to the commit skill, which documents the same limit, is in
shellhub-io/claude. Without it the skill that writes commit messages and the
check that validates them would disagree.

Testing

Verified the old and new patterns against the actual GHSA commit body and
synthetic inputs, using re.fullmatch to match JavaScript $ semantics (the
pattern uses only [^\n] classes, no dot, so the engines agree):

Input 80 100
GHSA commit body FAIL PASS
body line of 99 - PASS
body line of 100 - PASS
body line of 101 - FAIL

The boundary is exact and the previously failing commit now passes.

Not addressed

Raising the limit does not touch three structural gaps found while investigating,
each of which would have let this failure happen at any limit:

  • The check runs on push to master, where a failure is unactionable — the
    commit is already merged and can only be fixed by rewriting history.
  • Advisory merges bypass the check entirely. The GHSA private fork has Actions
    disabled, so its PR reported no checks and the commit was first linted only
    after landing on public master.
  • There is no local enforcement (no hook, no commitlint config), so authors
    discover violations in CI, and the error names no specific line.

Replacing the six regex steps with commitlint would address all three with one
config shared by CI and a commit-msg hook. Out of scope here.

The 80-character body limit sat in a dead zone: git log indents bodies by
four spaces, so an 80-column body already wraps in a standard terminal,
and the limit was too narrow to hold a long URL or an advisory summary.
The GHSA-c5cf-fr53-8wq4 commit failed on seven lines wrapped at 82.

The subject stays at 80 — GitHub truncates commit and pull request titles
well before that, so widening it would only hide text.
@otavio
otavio requested a review from a team as a code owner July 27, 2026 18:52
@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown

Claude finished @otavio's task in 54s —— View job


Code Review Complete

Reviewed 1 file across code quality, security, testing, language patterns, and architecture — no new issues found. The code looks good as-is.

The change is a clean, single-purpose adjustment: the Check Line Length body pattern goes from {0,80} to {0,100} with the error message updated to match. The regex stays correct — ^[^\n]+(\n[^\n]{0,100})*$ leaves the subject line unbounded and caps each body line at 100 — the s flag remains inert (no . in the pattern), and the separate title-length checks are correctly left at 80. The PR description's boundary testing and rationale are sound.


To request another review round, comment /review.

@otavio
otavio merged commit c61e3d6 into master Jul 27, 2026
42 of 44 checks passed
@otavio
otavio deleted the chore/commit-msg-line-length-100 branch July 27, 2026 18:55
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.

1 participant