From 646bcd692df4378d2f42bd245e2cefb66df8c16c Mon Sep 17 00:00:00 2001 From: Adrian Smijulj Date: Fri, 26 Mar 2021 19:15:39 +0100 Subject: [PATCH] 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. --- src/isValidCommitMesage.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/isValidCommitMesage.ts b/src/isValidCommitMesage.ts index b9b11f9..42b796d 100644 --- a/src/isValidCommitMesage.ts +++ b/src/isValidCommitMesage.ts @@ -14,6 +14,13 @@ const DEFAULT_COMMIT_TYPES = [ ]; 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(":"); possiblyValidCommitType = possiblyValidCommitType.toLowerCase();