di-sukharev / di-sukharev/opencommit

[Bug]: Invalid Conventional Commit format when using GitMojis

Open
#417 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
7.5k
Forks
445
Avg merge
18m
Merged PRs (30d)
2

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named in the issue. Start by locating the commit-message formatting path that combines Conventional Commits with GitMojis, then inspect the existing tests or add a focused case for the reported format. Done means generated messages remain Conventional Commit-compatible while retaining the Gitmoji in the description.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, javascript
Domain
cli, developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
57/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.