question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add a "semver" field for each emoji

See original GitHub issue

Summary

I would like to see a doc (ideally part of website, but maybe just something checked into the repo) that lays out how various emojis should map to conventional-commits.

Why?

There are many tools today that can parse conventional commits. I often would like to propose to authors of these tools to support conventional commits or gitmoji, but how to do so is pretty wishy-washy (compared to the very formal definition of conventional-commits).

For example, I’d probably suggest “💥 Drop node v8 support” be parsed equivalently to “feat!: Drop node v8 support”, “✨ Add a new button” be parsed equivalently to “feat: Add a new button”, “🐛 Fix something” be parsed as “fix: Fix something”, and then everything else just also gets “fix:”.

(This isn’t ideal, because there are a lot of obvious mappings, like “📝 Add a new paragraph” is clearly intended to be “doc: Add a new paragraph”. If we mapped out that relationship, it would be easier to propose support to tool authors.)

Why bother if you can just use both conventional-commits and gitmoji?

I’ve seen this, but I don’t like it. A good example is the https://github.com/vivaxy/gacp project, which creates commit messages that follow conventional-commits standard and contain gitmoji emojis.

I have two issues with this:

  1. It’s double-accounting. Commits like feat: :sparkles: add a feature and BREAKING CHANGE: :boom: make a change are just saying the exact same thing twice in different ways, defeating the whole purpose of using the emojis.

  2. It looks really bad. If the emoji can’t be the very first character, it ruins the effect of an all-gitmoji repo (where the commits are lined up and easily parseable). If combining gitmoji and conventional-commits resulted in :sparkles: feat: add a feature, I guess that would be better, but look at the gacp project link above to see how hard it is to even find the emoji when it is not lined up in the commit message.

Could conventional-commit change to support gitmoji?

Maybe. I find it very doubtful, but could conventional-commit make a change to their rules that says:

You can prefix any <type> with a phrase surrounded by colons.

This would let :boom: feat!: Big API change be a valid conventional-commit message, and fixes my Complaint (2). But it’s still double-accounting.

For this reason, I think that even if conventional-commits would be willing to bend to accomodate prefixed emojis, it’s not the best case. The best case would be to craft a formalized way to interpret gitmoji, so that asking a tool author to support gitmoji is just like asking a tool to output YAML as well as JSON, etc.

Any thoughts? Pros/cons?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:50 (26 by maintainers)

github_iconTop GitHub Comments

3reactions
nkmr-jpcommented, Oct 18, 2020

Hello ! I wrote a script that adds a semver field to gitmojis.json. Until the semver field is officially added, I think this will be useful. It’s easy to edit with a yaml file.

# semver.yml
semver:
  major: [ boom ]
  minor: [ sparkles ]
  patch: [ bug, ambulance ]

genelate gitmojis.json file with semver field

$ cat build/dist/gitmojis.json | jq '.gitmojis[] | select(.name=="sparkles")'
{
  "emoji": "✨",
  "entity": "&#x2728;",
  "code": ":sparkles:",
  "description": "Introduce new features.",
  "name": "sparkles",
  "semver": "minor"
}

https://github.com/nkmr-jp/gitmoji-semver

3reactions
frinyvonnickcommented, Jun 2, 2020

On gitmoji-changelog we grouped the commits using emojies into categories like added, breaking changes, … Here is our configuration file. It could be useful to have this semver property to put commits into some categories. For example emojies of type major should go into breaking changes category. But it won’t replace totally our configuration file.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The struggle of using native emoji on the web
The first major problem is that, although emoji are released by the Unicode Consortium at a yearly cadence, OSes don't always update in...
Read more >
How are you writing a commit message?
What is nice with gitmoji is that it uses emojis' names so you can grep "sparkles" to get all commits introducing new features...
Read more >
Configuration — python-semantic-release 7.32.2 documentation
Each location has priority over the ones listed above it. ... Parser for commits using one or more emojis as tags in the...
Read more >
ember-emojione
ember install ember-emojione bower install -S ... This text field accepts a value with a text from the wikiPageText property:
Read more >
emoji-vue - npm Package Health Analysis | Snyk
Add emojis to your vuejs project For more information about how to use this package ... Snyk scans all the packages in your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found