More descriptive error messages
See original GitHub issueIt would be beneficial to developers workflow to not have to interpret what the error means.
Current Behavior
Currently this is what we are seeing
husky > npm run -s commitmsg (node v6.11.3)
⧗ input: should fail
✖ message may not be empty [subject-empty]
✖ type may not be empty [type-empty]
✖ found 2 problems, 0 warnings
husky > commit-msg hook failed (add --no-verify to bypass)
Expected Behavior
Something to this effect seems like a better output to me …
husky > npm run -s commitmsg (node v6.11.3)
**Format**
type[(scope)]: subject
[body]
[footer]
**Acceptable Values***
- Types: 'build' , 'chore' , 'ci' , 'docs' , 'feat' , 'etc...'
- Scopes: 'ANY' *MUST be lower-case*
- Subject: 'ANY' *MUST NOT be pascal-case sentence-case or camel-case*
- Body: 'Any' *etc ...*
- Footer: 'Any' *etc ...*
⧗ input: should fail
✖ message may not be empty [subject-empty]
✖ type may not be empty [type-empty]
✖ found 2 problems, 0 warnings
husky > commit-msg hook failed (add --no-verify to bypass)
Also being consitent with the following:
message may not be empty [subject-empty]
SHOULD BE
subject may not be empty [subject-empty]
Affected packages
- [ x] cli
- [ x] core
- [ x] prompt
- [ x] config-angular
Possible Solution
Simply add more information to the output messages.
Context
Workflow
Issue Analytics
- State:
- Created 6 years ago
- Reactions:22
- Comments:17 (3 by maintainers)
Top Results From Across the Web
Descriptive Error Messages - DevIQ
When something unexpected or exceptional happens in a software application, usually an error message is displayed to the user and/or logged somewhere for...
Read more >Error Messages: Examples, Best Practices & Common Mistakes
4 common mistakes with error messages · 1. Ambiguity · 2. Condescending language/blaming the user · 3. Poor placement of error messages ·...
Read more >Best 10 Examples And Guidelines For Error Messages
Here are ten basic guidelines to help you create the most effective error messaging for your users. Click here to see all of...
Read more >How to Write Good Error Messages - UX Planet
Be concise and write a short description that is meaningful for user and ... Short and meaningful error messages are more understandable.
Read more >More descriptive JavaScript console error messages
Give developers more descriptive error messages · Provide developers with a suggested solution to resolve the error · Avoid popups for displaying ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@marionebl Just adding my two cents here.
I was stuck for 5 minutes trying to fix a commit message in some project I was contributing to until I watched the termcast / gif on marionebl.github.io/commitlint. Then I knew what went wrong. I think a simple note telling users:
…would go a long way, and we don’t have to bloat the error output while drawing some attention to your website at the same time.
You could even spice it up a bit if you want:
Cheers! 👋
Agree, adding this to an open source project and contributors will face difficulties understanding why commit fail if they did not read the CONTRIBUTE.md. It will be nice to add a configurable message append to the error messages and pointing people to read the guides