CtrlK
BlogDocsLog inGet started
Tessl Logo
PluginPublic

trysac/commit-msg-lint

Check and fix commit messages against Conventional Commits 1.0.0 with ten rules (C001-C010) and safe auto-fix suggestions. Use when the user asks to write, review or validate a commit message, or to set up commit message rules.

Quality

95%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Low

Low-risk findings worth noting

Overview
Quality
Evals
Security
Files

rules.mdreferences/

Rules C001-C010

Findings are printed sorted by line, then rule id, as C00x name: message (line N).

Grammar

<type>[(scope)][!]: <description>

[body]

[footer(s)]
  • Header: type letters only, optional scope in parentheses (no nested parentheses), optional !, a colon, one space, then a description that starts with a non-space character.
  • Footers are the last paragraph when every entry starts with a token followed by : or #. A token is BREAKING CHANGE or a word made of letters, digits and - (for example Refs: #12, Closes #12).
  • A message is breaking when the header has ! or a footer token is BREAKING CHANGE or BREAKING-CHANGE.

Cleaning before linting

CRLF is converted to LF; everything from a git scissors line (# ---- >8 ----) onward is dropped; lines starting with # are dropped; trailing blank lines are stripped. An empty result is C001. Headers starting with Merge , Revert ", fixup! or squash! produce no findings by default.

C001 invalid_header

The first line does not match the grammar. When C001 fires, only C001 and C007 are evaluated.

  • bad: Updated the parser | good: fix: handle empty input in the parser
  • bad: feat add parser (no colon) | good: feat: add parser

C002 type_not_allowed

The type (compared in lowercase) is not in the configured list. Default list: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert.

  • bad: feature: add login | good: feat: add login

C003 type_case

  • bad: Fix: correct rounding | good: fix: correct rounding

C004 header_too_long

The header is longer than --max-header code points (default 72). Move detail to the body.

  • bad: a 90-character header | good: shorten the description and put the rest after a blank line

C005 description_period

  • bad: fix: correct rounding. | good: fix: correct rounding

C006 empty_scope

  • bad: feat(): add parser | good: feat(parser): add parser or feat: add parser

C007 missing_blank_line

The second line of the message must be blank when a body or footer follows.

bad:                       good:
fix: correct rounding      fix: correct rounding
Rounds half up now.
                           Rounds half up now.

C008 breaking_token

A line in the last paragraph that reads like a breaking-change footer (breaking change:, Breaking-Change #1, in any case) but is not exactly BREAKING CHANGE or BREAKING-CHANGE.

  • bad: Breaking change: v1 removed | good: BREAKING CHANGE: v1 removed

C009 scope_not_allowed

Only when --scopes is given: the scope is not in the list.

C010 scope_required

Only with --require-scope: the header has no scope.

Safe suggestions

A suggestion is printed only when applying these fixes, in order, makes the message lint clean: map type alias and lowercase it; add the missing space after the colon; drop one trailing period; insert the blank line after the header. If the result still has findings, no suggestion is made. Aliases: feature to feat, bugfix to fix, fixes to fix, doc to docs, tests to test.

Limits

Input is limited to 65,536 bytes. Only the header, footers and blank-line structure are checked; the quality of the description and body is a human judgement.

references

SKILL.md

tile.json