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

Question about emoji linting #162

Open
Axedyson opened this issue Aug 24, 2021 · 1 comment
Open

Question about emoji linting #162

Axedyson opened this issue Aug 24, 2021 · 1 comment

Comments

@Axedyson
Copy link

Axedyson commented Aug 24, 2021

Is there any way or do you know some tool that can lint commits to ensure that they have emojis in them? I know commitlint exist and that you can implement that in a CI environment, but is there something that can validate not just conventional commits but with emojis placed between type(scope): and the description...?

@Axedyson Axedyson reopened this Jan 23, 2022
@vhscom
Copy link

vhscom commented Jan 23, 2022

Dug in a little more and see the CLI is linting with the regex here:

https://github.com/folke/devmoji/blob/master/src/cli.ts#L27

It can be modified slightly to check for the emoji:

^(?<type>:?[a-z-]+)(?:\((?<scope>[a-z-0-9]+)\))?(!?):\s+(📦️|✨)(?<description>.*)

Suppose the emoji could be included in a file as an allowed list and run in a separate check using the unicode points. That's what I'd do anyway. But I haven't looked into it that deeply.

For the morbidly curious I saw there's a proposal for tc39 to update regex in JS to check for an emojis. And here's a related library which might be of interest if updating the regex.

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

No branches or pull requests

2 participants