Error when using a type that has a dash ("-") [bug]
See original GitHub issueExpected Behavior
commitlint should accept types with dashes in them.
Current Behavior
It gives the errors “subject may not be empty” and “type may not be empty”, neither of which is true.
Affected packages
- cli
- core
- prompt
- config-angular
Steps to Reproduce (for bugs)
echo "vim-patch: the type is not empty" | npx commitlint --config commitlint.config.js
returns
⧗ input: vim-patch: the type is not empty
✖ 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
commitlint.config.js
module.exports = { rules: { 'body-leading-blank': [1, 'always'], 'body-max-line-length': [2, 'always', 100], 'footer-leading-blank': [1, 'always'], 'footer-max-line-length': [2, 'always', 100], 'header-max-length': [2, 'always', 100], 'scope-case': [2, 'always', 'lower-case'], 'subject-case': [ 2, 'never', ['sentence-case', 'start-case', 'pascal-case', 'upper-case'], ], 'subject-empty': [2, 'never'], 'subject-full-stop': [2, 'never', '.'], 'type-case': [2, 'always', 'lower-case'], 'type-empty': [2, 'never'], 'type-enum': [ 2, 'always', [ 'build', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'test', 'vim-patch', ], ], }, };
Context
I contribute to the neovim project. We would like to introduce a type called vim-patch
since many of our automation scripts depend on the commits having exactly that string.
Your Environment
Executable | Version |
---|---|
commitlint --version |
@commitlint/cli@13.1.0, @commitlint/cli@7.6.1 |
git --version |
2.32.0 |
node --version |
v16.5.0 |
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Troubleshooting App Deployment Errors - Dash Python
This troubleshooting guide describes errors that you may encounter when deploying apps to Dash Enterprise as well as steps to resolve them.
Read more >python - Dash suppress_callback_exceptions not working
I have tried each way individually and using all of them as uncommented lines of code. No matter the combination of methods I...
Read more >BUG in Azure Data Factory -> Set Variable -> Add dynamic ...
Hi,. I am attempting to set a variable by referring to an element inside a json array. The array element has dashes (-)...
Read more >Syntax Error - an overview | ScienceDirect Topics
If this type of error is typed in a script or function using the Editor, ... There are many possible syntax errors—you will...
Read more >MSE Dash MP4 video playback throw decoding error at very ...
This bug has been stale for more than a year. I've added the label StaleMediaBug and in two weeks will archive all such...
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
@dundargoc happy to hear that Neovim is using commitlint in their CI. Not so happy to here you are having issues. The issue is that the header fails to parse, we are looking for any word at the start of the commit. You can override this to look for anything that is not a
(
,)
or:
in theparserOpts.headerPattern
. An example config is below, hope this fixes the issue for you.commitlint.config.js
There are a few other issues around the same thing that we are looking to fix. This will take a bit of time to get the fix in, tested and released, so you can use the above config in the short term.
Ref: #2674, #880, #1221
Yea please 👍