[Bug] VerifyCommit regexp does not match all emoji
See original GitHub issueWhat 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
How To Reproduce
Expected behavior
commitRE.test('⬆️ feat: xx')
true
commitRE.test('⬇️ feat: xx')
true
Context
- Umi Version: 4.0.11
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
可以用这个 https://github.com/mathiasbynens/emoji-regex/blob/main/index.js#L3
兼容性的问题在这里讨论:https://github.com/umijs/umi/issues/8658