Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(git): support parse git messages that have prefix emoji #146

Merged
merged 2 commits into from
Mar 6, 2024

Conversation

Jannchie
Copy link
Contributor

@Jannchie Jannchie commented Sep 11, 2023

🔗 Linked issue

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Although not part of the conventionalcommits standard, it is common practice for git messages to be prefixed with emoji.
This PR allows parsing prefixed string emoji (e.g., :bug:) and Unicode emoji (e.g., 🐞).
I ran unit tests to make sure it wouldn't affect the original parsing. I also wrote the appropriate unit tests for emoji parsing.

Need for discussion
Theoretically, unless someone uses emoji to prevent commits from being added to the changelog, it's senseless. So I just modified the original regex.
If we must obey conventionalcommits, we may need to expose the regex to config.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

test/git.test.ts Outdated Show resolved Hide resolved
Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems fine to me - wdyt @pi0?

Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@pi0 pi0 merged commit 4c800a7 into unjs:main Mar 6, 2024
2 checks passed
@Jannchie Jannchie deleted the feat/raw-git-message-emoji branch March 6, 2024 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Raw commit emoji support
3 participants