-
Notifications
You must be signed in to change notification settings - Fork 934
How to validate github issues / jira issues #237
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
You can do this via the // commitlint.config.js
module.exports = {
'references-empty': [2, 'never']
}; This checks for the presence of any "reference", which depends on
When validating JIRA ticket numbers you'll want to configure an issuePrefix:
This create the following results:
This question crops up often enough to warrant documentation. |
does not have the desired effect in my repo at least not when i use it for the commit msg hook from husky |
Please provide the config you use and input examples with the expected commitlint output. |
@Anzumana This is not actionable for me without more information. I'll close tomorrow if there is no news on this. |
my config was just
and using this
did not result in the output you posted above. ( Before that i tried a few more extensive configurations ) |
Please post what in/output you see in your terminal session here. |
Same issue here.
Config:
|
@cevatkerim rules definitions have to be wrapped into a // commitlint.config.js
module.exports = {
parserPreset: {
parserOpts: {
issuePrefixes: ['PROJ-']
}
},
rules: {
'references-empty': [2, 'never']
}
};
|
@Anzumana Could you try again with |
so i just passed it into vim and ran the command. |
sidenote: initially i though the best way for checking if someone used an issue prefix would be in the body of the commit msg. since commits could be related to multiple issues at the same time and then one would probably want a clean "type: subject" git log --oneline the output will not be clogged with issues in the subject line that don't help you debugging. But thats just a personal preference and either way the solution that we can get working would be find with me. |
Reading your first example more closely: Have you tried renaming |
will try that today and then report back |
I just had the same issue. This works:
Example project can be found here: I hope this solves it for you as well. |
Is it also possible to configure so that this would be accepted:
|
@Anzumana you got feedback on this? If it works for you I would close this.
Therefor commit messages should be structured as follows:
Issues numbers usually are being added to the |
Hello, i'm looking for a solution to enable references checking only when the scope is feat or fix. |
@Anzumana you seem to be happy :) @mebibou @belamrani for more options regarding parsing commit messages have a look at the conventionalCommitsParser Options If your questions are still open feel free to ask them in the commitlint room on slack. |
@Anzumana @belamrani @mebibou I created a plugin and a config special for JIRA commit messages style commitlint-jira |
Hey,
i am currently looking into how i could validate that a commit msg does include a github issue number or a jira issue number.
We currently do this with validate-commit-msg
since that package is supposed to be deprecated i was wondering how i am supposed to do something similar with commitlint.
The text was updated successfully, but these errors were encountered: