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.

[Bug] VerifyCommit regexp does not match all emoji

See original GitHub issue

What happens?

const emoji = `(((\ud83c[\udf00-\udfff])|(\ud83d[\udc00-\ude4f\ude80-\udeff])|[\u2600-\u2B55]) )?`;
const scope = ['feat', 'fix', 'docs', 'style', 'refactor', 'perf', 'test', 'workflow', 'build', 'ci', 'chore', 'types', 'wip', 'release', 'dep', 'deps', 'example', 'examples', 'merge', 'revert'];
const commitRE = new RegExp(`^((${emoji}(${scope.join('|')})(\\(.+\\))?:)|(Merge|Revert|Version)) .{1,50}`, 'i');

commitRE.test('⬆️ feat: xx')
false
commitRE.test('🚨 feat: xx')
true
commitRE.test('♻ feat: xx')
false
commitRE.test('♻ feat: xx')
true
commitRE.test('🎉 feat: xx')
true
commitRE.test('⬇️ feat: xx')
false

Mini Showcase Repository(REQUIRED)

https://www.regextester.com/106421

/(\ud83c[\udf00-\udfff])|(\ud83d[\udc00-\ude4f\ude80-\udeff])|[\u2600-\u2B55]/ // 3038

/(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/ // 4683
image

How To Reproduce

Expected behavior

commitRE.test('⬆️ feat: xx')
true
commitRE.test('⬇️ feat: xx')
true

Context

  • Umi Version: 4.0.11

https://github.com/umijs/umi/blob/95c0f75aa03a972ec2a3d1c23fadfb471a7950af/packages/preset-umi/src/commands/verify-commit.ts#L39-L71

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
fz6mcommented, Aug 9, 2022
0reactions
fz6mcommented, Aug 9, 2022

兼容性的问题在这里讨论:https://github.com/umijs/umi/issues/8658

Read more comments on GitHub >

github_iconTop Results From Across the Web

emoji-regex - npm
A regular expression to match all Emoji-only symbols as per the Unicode Standard.. Latest version: 10.2.1, last published: 3 months ago.
Read more >
git push error(does not match the regular-expression)
Your repo has some constraints about the commit messages it accepts. You need to match some regex (RR|IR|US|BUG|VUL)(\d{13 ...
Read more >
Gitlint - Joris Roovers
Gitlint is a git commit message linter written in python: it checks your commit messages for style. Great for use as a commit-msg...
Read more >
pcre2pattern specification
If the current matching point is at the end of the subject string, all of them fail, because there is no character to...
Read more >
Config Cheat Sheet - Docs
Disabled repo units will not be added to new repositories regardless if it ... match committers (This matches GitHub and will force Gitea...
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