gitmoji-commit-workflow icon indicating copy to clipboard operation
gitmoji-commit-workflow copied to clipboard

Wrong emoji for ci according to gitmoji

Open zorgick opened this issue 4 years ago • 2 comments

Currently there is a wrench emoji:

https://github.com/arvinxx/gitmoji-commit-workflow/blob/c986d43c8e4a20a947a66a44881528655e1fa218/packages/changelog/src/transformer/typeDisplayName.ts#L36

But gitmoji uses this symbol for adding ci 👷

zorgick avatar Jun 16 '21 20:06 zorgick

Also stumbled across this. Fixed by using this: npm install --save-dev [email protected]

jlalmes avatar Jul 28 '21 10:07 jlalmes

Encountered more issues with this package. Ended up creating my own Gitmoji commitlint plugin - it's super simple.

Run npm i -D gitmojis, create commitlint.config.js, paste code below & you're done!

const { gitmojis } = require('gitmojis');

module.exports = {
  rules: {
    'gitmoji-rule': [2, 'always'],
  },
  plugins: [{
    rules: {
      'gitmoji-rule': ({ header }) => {
        const commit = header.trim();
        const [commitEmoji, ...rest] = commit.split(' ');
        const commitMessage = rest.join(' ').trim();
        if (!commitMessage) {
          return [false, 'Commit message is required.'];
        }
        if (!commitEmoji) {
          return [false, 'Commit emoji is required.'];
        }
        const gitmoji = gitmojis.find((_gitmoji) => _gitmoji.emoji === commitEmoji);
        if (!gitmoji) {
          return [false, 'Valid Gitmoji is required.'];
        }
        if (commitMessage.length <= 6) {
          return [false, 'Commit message must be over 6 characters'];
        }
        return [true];
      },
    },
  }],
};

jlalmes avatar Aug 03 '21 17:08 jlalmes