-
Notifications
You must be signed in to change notification settings - Fork 913
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
feat(core): Implement footer-contains rules #76
Conversation
Thanks a lot for the PR! Could you write a short description with examples for the use cases you had in mind? |
@marionebl I'd specifically like to enforce the presence of issue references in the footer with a rule like this:
|
I am on vacation till 3th Oct, will make an effort to merge it then! |
Thanks for your work. Checking for the presence of an issue ticket id is a common use case. I am reluctant to merge this, because
Pseudo code // commitlint.config.js
module.exports = {
parserPreset: './parser-preset',
rules: {
'references-empty': [2, 'never'],
// extended use case, check if id is present
'references-enum': getIssueIds().then((ids) => [2, 'always', ids])
}
}
// parser-preset
module.exports = {
paserOpts: {
issuePrefixes: ['PROJECT-']
}
}; What do you think? |
Thanks for your contribution. I'll released the alternative |
Hi guys, I realise this issue is closed but I noticed that this only seems to work if the ticket reference is placed on the Ideally I'd like to achieve: |
Hi @marionebl, thanks for that! I've followed the examples and I couldn't get it to work. Maybe you can help? // commitlint.config.js module.exports = {
'extends': [
'@commitlint/config-angular',
'@commitlint/config-lerna-scopes'
],
'parserPreset': './parser-preset',
'rules': {
'references-empty': [2, 'never'],
}
} // parser-preset.js module.exports = {
parserOpts: {
issuePrefixes: ['TEST-']
}
}; When I run echo "chore: TEST-1 Test Message" | ./node_modules/.bin/commitlint I get And when I add
Any thoughts? |
Let's take this to a distinct issue at #115 |
No description provided.