conventional-changelog/standard-version

How to change the commit convention so that changelog gets generated?

Opened this issue · 1 comments

I have a commit convention like '[JIRA Ticket ID] fix|chore|feat: commit message'. Using commitlint I have made the commit convention. How can I use standard version so that CHANGELOG.md will be generated using this convention?

@stevemao

module.exports = {
    parserPreset: {
      parserOpts: {
        headerPattern: /^\[(\w+-\d+)\] (\w+): (.+)/,
        headerCorrespondence: ["scope", "type", "subject"],
      },
    },
    plugins: [
      {
        rules: {
          "header-match-team-pattern": (parsed) => {
            const { type, scope, subject } = parsed;
            console.log(parsed);
            if (type === null && scope === null && subject === null) {
              return [
                false,
                "header must be in format '[JIRA ID]? [type] subject'",
              ];
            }
            return [true, ""];
          },
          "scope-type-enum": (parsed, _when, expectedValue) => {
            const { type} = parsed;
            if (type && !expectedValue.includes(type)) {
              return [
                false,
                `type must be one of ${expectedValue}`,
              ];
            }
            return [true, ""];
          },
        },
      },
    ],
    rules: {
      "header-match-team-pattern": [2, "always"],
      "scope-type-enum": [2, "always", ["fix", "feat","chore"]], // custom rule defined in plugins
    },
  };

this is my commitlint.config.js file