commitlint icon indicating copy to clipboard operation
commitlint copied to clipboard

feat: how to get author info in commit log

Open BTYHunter opened this issue 2 years ago • 1 comments

Expected Behavior

My configuration

const Configuration = {
  rules: {
    'test': [2, 'always']
  },
  plugins: [
    {
      rules: {
        'test': (output) => {
          return handleMessage(output)
        }
      }
    }
  ]
}

Test result say

message:  {
  type: 'chore',
  scope: 'ci',
  subject: '123',
  merge: null,
  header: 'chore(ci): update 11 panel to v10',
  body: 'testaaa' +
    '\n' +
    'Code Source From: Self Code',
  footer: 'Jira: #',
  notes: [],
  references: [
    {
      action: null,
      owner: null,
      repository: null,
      issue: '12',
      raw: 'xx',
      prefix: '#'
    }
  ],
  mentions: [],
  revert: null,
  raw: 'chore(ci): update 11 panel to v10\n' +
    '\n' +
    '\n' +
    'Code Source From: Self Code\n' +
    '\n' +
    'Jira: asdf\n' +
    '\n' +
    '# Please enter the commit message for your changes. Lines starting\n' +
    "# with '#' will be ignored, and an empty message aborts the commit.\n" +
    '#\n' +
    '# On branch test\n' +
    ...
}

There is no author information in output (git log shows).

Current Behavior

No response

Affected packages

  • [ ] cli
  • [ ] core
  • [ ] prompt
  • [ ] config-angular

Possible Solution

No response

Context

No response

BTYHunter avatar Nov 03 '23 03:11 BTYHunter

I would also like this capability. It looks like a big breaking change though - basically everything will need to be re-worked to accept an object rather than a simple string.

My use case is being able to apply specific rules only for Renovatebot, while not permitting such things for all other committers.

mwgamble avatar Feb 21 '24 10:02 mwgamble