feat: allow "Merge " commit messages

This is a message that's auto-generated by git. Can't do much about it unfortunately. Let's allow it.
This commit is contained in:
Adrian Smijulj 2021-03-26 19:15:39 +01:00
parent bfad0f127e
commit 646bcd692d

View file

@ -14,6 +14,13 @@ const DEFAULT_COMMIT_TYPES = [
]; ];
const isValidCommitMessage = (message, availableTypes = DEFAULT_COMMIT_TYPES): boolean => { const isValidCommitMessage = (message, availableTypes = DEFAULT_COMMIT_TYPES): boolean => {
// Exceptions.
// This is a message that's auto-generated by git. Can't do much about it unfortunately. Let's allow it.
if (message.startsWith('Merge ')) {
return true;
}
// Commit message doesn't fall into the exceptions group. Let's do the validation.
let [possiblyValidCommitType] = message.split(":"); let [possiblyValidCommitType] = message.split(":");
possiblyValidCommitType = possiblyValidCommitType.toLowerCase(); possiblyValidCommitType = possiblyValidCommitType.toLowerCase();