Github/Gitlab issue ID support (in subject)
See original GitHub issueExpected Behavior
Github/Gitlab issue ID (e.g. #123
, #6778
) can be added as references into subject.
Current Behavior
subject-case
now only allows characters
[
'lower-case', // default
'upper-case', // UPPERCASE
'camel-case', // camelCase
'kebab-case', // kebab-case
'pascal-case', // PascalCase
'sentence-case', // Sentence case
'snake-case', // snake_case
'start-case', // Start Case
]
Affected packages
- cli
- core
- prompt
Possible Solution
Add regex
pattern supports to subject-case
, for now, I have to disable subject-case
which doesn’t make sense.
commitlint.config.js
{
"commitlint": {
"extends": [
"@commitlint/config-conventional"
],
"parserPreset": {
"parserOpts": {
"issuePrefixes": [
"#"
]
}
},
"rules": {
"references-empty": [2,"never"],
"subject-case": [0,"never"],
"subject-empty": [2, "never"]
}
}
}
Context
Your Environment
Executable | Version |
---|---|
commitlint --version |
v7.0.0 |
git --version |
v2.15.2 |
node --version |
v10.6.0 |
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Manage issues - GitLab Docs
On the top bar, select Main menu > Projects and find your project. On the left sidebar, select Issues > List. In the...
Read more >VCS Integration | YouTrack Server Documentation - JetBrains
YouTrack supports direct integration with GitHub, GitLab and Bitbucket. ... Reference an issue ID in a commit message when you push changes ...
Read more >DevSecOps/CoCoa CLI - IBM Cloud Docs
If --close-resolved-issues flag is set, the command searches for open issues with the same tool, subject and the incident ID as the current...
Read more >Feature #31989: Inline issue auto complete (#) in ... - Redmine
The attached patch adds support for inline issue auto complete in fields with ... the subject (or at least some keywords from the...
Read more >Top 100+ Git Interview Questions and Answers [2023 Edition]
Uncover the top 75+ Git interview question that will help you prepare ... GitHub, GitLab and Bitbucket are examples of git repository ______ ......
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
Being able to do this by allowing regular expressions seems like a good solution. Alternately, being able to provide a function (instead of array/string) to the
value
part of the config…I’ve created a plugin
commitlint-plugin-function-rules
, which can be used to write functions for rule values, allowing you to use a regex to specify the allowed values, and much more. I think the issue potentially could be resolved with a function rule and a regex for thesubject-case
rule (namedfunction-rules/subject-case
using the plugin).I hope this helps!