Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

commitlint --edit does not change commit message once you enter a invalid commit message #3985

Open
1 of 4 tasks
alpzaf opened this issue Mar 19, 2024 · 1 comment
Open
1 of 4 tasks

Comments

@alpzaf
Copy link

alpzaf commented Mar 19, 2024

Steps to Reproduce

When you command git commit -m "updates foo" it fails as expected but when you try to fix commit message like "fix: update foo" it gives also an error but with old commit message like "updates foo"

Current Behavior

image

Expected Behavior

So it must change the input with new one.

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

No response

Context

No response

commitlint --version

@commitlint/cli: 19.2.1

git --version

v2.32.1 (Apple Git-133)

node --version

v20.9.0

@manubuer
Copy link

Workaround: do the commit with the fixed message, get the error, go to commitlint.config.js and include in the list of allowed types your misspelled type. (For example: I misspelled "fiy: foo" instead of "fix: foo", so I added "fiy"). Do your corrected commit and the commit will pass.

module.exports = { extends: ["@commitlint/config-conventional"], rules: { "type-enum": [ 2, "always", [ "feat", "fix", "fiy", ..., ..., ], ], "header-max-length": [2, "always", 400], }, };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants