Need AI Training/Help?CloudYeti.io/meet
MarkdownMe
Developer commit guide

Fix a Commitlint Conventional Commit Failure

Rewrite failed commitlint subjects into valid Conventional Commit messages with the right type, scope, subject, and breaking-change footer.

Direct answer

To fix a commitlint failure, rewrite the subject as `type(scope): imperative subject` using a known lowercase type, an optional lowercase scope, and a concise subject without a period. If the change is incompatible, add `!` after the type or scope and include a `BREAKING CHANGE:` footer. Paste the failed subject, the commitlint error, and what actually changed into the generator.

Open Conventional Commit Generator

When to use this

  • CI failed with commitlint or commit message validation.
  • Your commit subject is vague, missing a type, too long, or uses an invalid type.
  • You need to amend or squash commits before pushing or merging.

Steps

  1. Copy the failed commit subject and the commitlint error.
  2. Describe the actual code, docs, test, build, or CI change.
  3. Pick a valid Conventional Commit type and optional scope.
  4. Keep the subject imperative, lowercase after the colon, and short.
  5. Amend the commit or use the generated subject while squashing.

Example

Change context
commitlint failed: subject may not be empty, type may not be empty

Failed commit: updated auth stuff

Change: fixed refresh token expiry in AuthService and added a regression test.
Commit message
fix(auth): refresh expired session tokens

Common mistakes

  • Do not keep vague subjects like updated stuff or changes.
  • Do not uppercase the type or scope if your config expects lowercase.
  • Do not mark a breaking change unless users or callers must change something.

FAQ

Why did commitlint fail?
Common causes are missing type, invalid type, empty subject, uppercase type or scope, subject too long, or a malformed breaking-change footer.
How do I amend the failed commit?
After generating the corrected message, use `git commit --amend` for the latest commit or squash/reword during an interactive rebase if the bad commit is older.
Can commitlint require custom scopes?
Yes. Some repos restrict scopes. If your config does that, use one of the allowed scopes or omit scope when the config permits it.

Related Conventional Commit guides