opencommit icon indicating copy to clipboard operation
opencommit copied to clipboard

[Bug]: Invalid Conventional Commit format when using GitMojis

Open chrispoupart opened this issue 5 months ago • 0 comments

Opencommit Version

3.2.2

Node Version

22.8.0

NPM Version

10.8.2

What OS are you seeing the problem on?

Mac

What happened?

Currently, when using Conventional Commits with the Gitmoji feature, the Gitmojis are added to the beginning of the first line of the commit message, like this:

🎉 feat(README.md): add comprehensive documentation on how to install, use, contribute, license and contact the project

However, this is not compliant with a lot of other tools that rely on the conventional commit standard (semantic-release being a big one), because it is not compliant with the Conventional Commits spec.

Expected Behavior

Tools like the VSCode Conventional Commit Extension and their equivalents for other IDEs create compatible commits by moving the gitmoji to the description part of the message, which would make it look like this:

feat(README.md): 🎉 add comprehensive documentation on how to install, use, contribute, license and contact the project

Current Behavior

As per the above, the gitmoji at the beginning of the line breaks conventional commit parsing on other tools.

Possible Solution

Ideally, I think that changing this as the default behaviour when using the combination of gitmoji and conventional commits would make the most sense, as it mirrors the other tools already on the market.

Barring that, a configuration option allowing people to switch between the formats would be helpful.

I'm happy try my hand at a PR if this is a change that you are interested in.

Steps to Reproduce

No response

Relevant log output

No response

chrispoupart avatar Sep 12 '24 18:09 chrispoupart