Unable to commit when type-enum is overridden
See original GitHub issueI’m not able to do a commit when I override the type-enum
rule in commitlint.config.js
.
When I don’t override the type-enum
rule a commit is not blocked.
Expected Behavior
The commit should be done.
Current Behavior
When I do a commit with using an approved type, I still get an error message:
echo 'feat(hello): bar' | commitlint
⧗ input: feat(hello): bar
✖ type must be one of [feat,fix,docs,style,refactor,test,revert,content] [type-enum]
✖ found 1 problems, 0 warnings
ⓘ Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint
Affected packages
- cli
- core
- prompt
- config-angular
Possible Solution
Steps to Reproduce (for bugs)
- Create commitlint.config.js with the config I put above
- Run commitlint and see the magic happen
commitlint.config.js
```js module.exports = { extends: ['@commitlint/config-conventional'], rules: { 'type-enum': [ 2, 'always', [ [ 'feat', 'fix', 'docs', 'style', 'refactor', 'test', 'revert', 'content', // For articles, tutorials, etc... ], ], ], }, } ```Context
I would like to create a custom type for articles and tutorials on my blog.
Your Environment
Executable | Version |
---|---|
commitlint --version |
@commitlint/cli@11.0.0 |
git --version |
git version 2.21.1 (Apple Git-122.3) |
node --version |
v15.5.0 |
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
java - Can I extend a class and override enclosed enum type?
You can't extend enum . enums are essentially a final class. However, enums can implement, so combined with generics, you get:
Read more >How to Write Good Commit Messages with Commitlint
This would require me to override the type-enum rule in the conventional commits convention. You should get the above output.
Read more >commitlint - Lint commit messages
Lint from stdin echo 'foo: bar' | commitlint ⧗ input: foo: bar ✖ type must ... fix, perf, refactor, revert, style, test] [type-enum]...
Read more >C++ Core Guidelines - GitHub Pages
The C++ Core Guidelines are a set of tried-and-true guidelines, rules, and best practices about coding in C++.
Read more >Hibernate ORM 5.4.33.Final User Guide - Red Hat on GitHub
Hibernate supports the mapping of Java enums as basic value types in a number of different ... which was not set until the...
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
@johanvergeer @escapedcat this is not a bug, your configuration is incorrect, as enum values you must provide array, not array of arrays
@armano2 thanks for you answer, it helped me to understad how I can extend the commitlint rules and also thanks for @johanvergeer