Gherciu/commitlint-jira

Compatibility with conventional changelog

yyynnn opened this issue ยท 6 comments

This package is not compatible with cz-conventional-changelog-with-jira or @digitalroute/cz-conventional-changelog-for-jira. Is the a way to befried them?

@yyynnn Can you pls provide an error log???

How can I use basic commitlint conventional-config with jira-config.

I need to obligate my developers to have commit in for of:

feat: PRJ-1111: subject of a change or at least feat (PRJ-1111): subject of a change. But problem with PRJ in (scope) is that scope is not obligatory by conventional commit spec.

Or is there any other way to make people commit both type: and JIRA task-id: ?

How can I use basic commitlint conventional-config with jira-config.

I need to obligate my developers to have commit in for of:

feat: PRJ-1111: subject of a change or at least feat (PRJ-1111): subject of a change. But problem with PRJ in (scope) is that scope is not obligatory by conventional commit spec.

Or is there any other way to make people commit both type: and JIRA task-id: ?

Did you ever find a solution for this? I'm looking to do the same as your first example but no idea how!

@GeorgeBugackov @cloud-context at the moment is not possible to use this format with commit-lint jira feat: PRJ-1111: subject of a change......Because Jira tickets have inside the task type (bug, feat etc.) ....so from my opinion it makes no sense to add feat: prefix......
In order to add this feature is needed a lot of changes in the ticket parser code........unfortunately I have a full-time job now so I don't have time .........
But I will accept any PR related to that....Thanks

If someone still searching simple solution for feat(PRJ-1111): subject of a change format
(@GeorgeBugackov)
I found for my team this commitlint.config.js setup works ok:

const { rules: jiraRules } = require('commitlint-plugin-jira-rules');
const { rules: configRules } = require('commitlint-config-jira');

// get list of jiraRules
const jiraMessageRules = Object.keys(jiraRules);

module.exports = {
    extends: ['@commitlint/config-conventional'],
    plugins: [
        {
            rules: {
                ...jiraMessageRules.reduce((acc, ruleKey) => {
                    acc[ruleKey] = function(input, when, options) {
                        // remove conventional commit context from message
                        const jiraMessage = `${input.scope}: ${input.subject}`;
                        return jiraRules[ruleKey]({ raw: jiraMessage }, when, options);
                    };
                    return acc;
                }, {})
            }
        }
    ],
    rules: {
        ...configRules,
        // your custom rules
        'jira-task-id-min-length': [2, 'never', 0],
        'jira-task-id-project-key': [2, 'always', ['PRJ', 'NO-JIRA']]
    }
};

#43

I needed this as well and made a solution #52