Conversation
|
The current matching rules are slightly different from conventional commits |
| expect(isValidCommitMessage("🚧 fix: menu must open on shortcut press")).toBe(false); | ||
| expect(isValidCommitMessage("fix(menus): menu must open on shortcut press")).toBe(true); | ||
| expect(isValidCommitMessage("🚧 fix(menus): menu must open on shortcut press")).toBe(true); | ||
| expect(isValidCommitMessage("🚧 fix(menus): menu must open on shortcut press")).toBe(false); |
There was a problem hiding this comment.
I feel that adding emojis to commit messages should be fine as long as the rest of the commit messages adheres to the conventional commits semantics.
There was a problem hiding this comment.
I think this plugin should match the spec as close as possible and I'm not sure emojis are supported: https://www.conventionalcommits.org/en/v1.0.0/#specification
| .replace(/[^a-z]/g, ""); // Only leave [a-z] characters. | ||
|
|
||
| return availableTypes.includes(possiblyValidCommitType); | ||
| let pattern = /^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: \S+([\s\S]*)/ |
There was a problem hiding this comment.
I'd rather the DEFAULT_COMMIT_TYPES be as it is and use
commitPrefixes = DEFAULT_COMMIT_TYPES.join("|");
to build the pattern. This makes it easier to extend the list of valid commit prefixes and improves readability.
There was a problem hiding this comment.
I think it's worth noting this change is also not backwards compatible as the allowed types are no longer supported. I don't think this is a desirable change and if it were to proceed the PR should updated to feat! as it's a breaking change.
I believe it's possible to update the regex without removing the existing capabilities.
No description provided.