Skip to content

chore: document comment rules and enforce commit message shape - #2706

Open
balzss wants to merge 1 commit into
masterfrom
chore/commit-comment-wording
Open

chore: document comment rules and enforce commit message shape#2706
balzss wants to merge 1 commit into
masterfrom
chore/commit-comment-wording

Conversation

@balzss

@balzss balzss commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a Code comments section to CLAUDE.md (and a human-facing version in the contributor docs): explain why not what, one line, never reference the change itself.
  • Fix commitlint.config.js's parserOpts.headerPattern, which couldn't match a scoped subject like fix(ui-button): ..., so subject-max-length had been applying to nothing. Set it to 72 and add body-max-lines / body-no-changelog.
  • Add a PreToolUse hook (scripts/claude/check-commit-message.mjs, 20 unit tests) that gives Claude the same feedback before a commit is attempted.
  • Add /tidy for reviewing comment and commit wording in a working diff, and drop the robot attribution line from commit messages.

Test Plan

  • Sanity-check the thresholds against your own recent commits: git log -50 --format='%H' | while read h; do git show -s --format='%s%n%n%b' $h | npx commitlint || echo "^ $h"; done. Expect only over-long subjects to fail.
  • Worth a look: subject-max-length: 72 fails ~10% of the last 200 commits on master (all genuinely sprawling subjects). Raising it to 80 halves that, if the team would rather.

Fixes INSTUI-5174

🤖 Generated with Claude Code

commitlint's headerPattern could not match a scoped subject like
`fix(ui-button): ...`, so subject-max-length never applied to anything.
Dropping it lets the conventional parser run, which the new subject and
body limits rely on. Limits are calibrated against this repo's history:
they clear the heaviest real commit and catch changelog-shaped bodies.

Co-Authored-By: Claude <noreply@anthropic.com>
@balzss balzss self-assigned this Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://instructure.design/pr-preview/pr-2706/

Built to branch gh-pages at 2026-09-03 11:25 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Visual regression report

Cypress suite: ✅ Passing

Visual diff:No changes.

Status Count
Unchanged 96
Changed 0
New 0
Removed 0

Accessibility (axe): ✅ No violations.

📊 View full report — click a screenshot's ⚠ badge to see each violation boxed on the image, with the offending element named and contrast failures shown as color swatches.

Baselines come from the visual-baselines branch. They refresh on every merge to master. The Cypress suite line covers the a11y and console-error assertions — a ❌ there means the suite found real issues even if the visual diff is clean.

github-actions Bot pushed a commit that referenced this pull request Sep 3, 2026
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