-
Notifications
You must be signed in to change notification settings - Fork 934
Error message if colon is missed is highly misleading #3045
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
Comments
With the caveat that I'm not a javascript dev so this code will almost certainly need a rewrite.
|
Thanks for opening this @RosieBaish |
I also face the same issue
Using the default config
|
@rahmatkurniawantiket this is a differnt issue I believe. Might be similar/related to this: #3492 (comment) Can you try if this works for you?: git commit -m 'feat: hello world' |
This was only resolved in my case/experience when I did 'feat(whatevertexthere): whatevertexhere'. |
hello @escapedcat , any update made on this pls? |
@escapedcat have tried both not working |
@rahmatkurniawantiket I do believe yours is a different issue than this. This issue is about missing a colon, yours seems to ti be different, yes? |
If you type a commit message but forget the colon after the type you get the error messages [subject-empty] and [type-empty] which are highly misleading.
It might be obvious to an expert user, but to a casual user it really wasn't.
Expected Behavior
echo "test(foo)
bar" | npx --no-install commitlint -V
⧗ input: test(foo)
bar
✖ subject may not be empty [subject-empty]
✖ type may not be empty [type-empty]
W warning - missing colon after scope [missing-colon]
✖ found 2 problems, 0 warnings
ⓘ Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint
Current Behavior
echo "test(foo)
bar" | npx --no-install commitlint -V
⧗ input: test(foo)
bar
✖ subject may not be empty [subject-empty]
✖ type may not be empty [type-empty]
✖ found 2 problems, 0 warnings
ⓘ Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint
Affected packages
Possible Solution
An additional warning message for any commit which matches the following
Steps to Reproduce (for bugs)
rvb@rosie-laptop:~/standby$ echo "test(foo)
bar" | npx --no-install commitlint -V
⧗ input: test(foo)
bar
✖ subject may not be empty [subject-empty]
✖ type may not be empty [type-empty]
✖ found 2 problems, 0 warnings
ⓘ Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint
$ echo "test(foo) bar
desc" | npx --no-install commitlint -V
⧗ input: test(foo) bar
desc
✖ subject may not be empty [subject-empty]
✖ type may not be empty [type-empty]
✖ found 2 problems, 0 warnings
ⓘ Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint
$ echo "test(foo): bar
desc" | npx --no-install commitlint -V
⧗ input: test(foo): bar
✔ found 0 problems, 0 warnings
Your Environment
npx --no-install commitlint -v
@commitlint/[email protected]
$ uname -a
Linux <removed> 5.13.0-30-generic #33~20.04.1-Ubuntu SMP Mon Feb 7 14:25:10 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.4 LTS"
commitlint --version
git --version
node --version
The text was updated successfully, but these errors were encountered: