From e6da597692fe8f8e34e2b9d848a8b9ddf4e2433d Mon Sep 17 00:00:00 2001 From: Zadkiel Aharonian Date: Sat, 13 Jan 2024 15:29:20 +0100 Subject: [PATCH] test allowed types removal Signed-off-by: Zadkiel Aharonian --- src/validateTitle.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/validateTitle.js b/src/validateTitle.js index 57b28a95..c4f135d3 100644 --- a/src/validateTitle.js +++ b/src/validateTitle.js @@ -13,23 +13,10 @@ module.exports = async function validateTitle(preset, title) { const { parserOpts } = conventionalChangelogConfig; const result = parser(title, parserOpts); - const allowedTypes = Object.keys(conventionalCommitTypes.types); - if (!result.type) { throw new Error( `No release type found in pull request title "${title}". The title should match the commit message format as specified by https://www.conventionalcommits.org/. The functionalities can also be altered by the selected preset plugin (${preset}). ` + - `\n\nPlease use one of these recognized types: ${allowedTypes.join( - ', ' - )}.` - ); - } - - if (!allowedTypes.includes(result.type)) { - throw new Error( - `Unknown release type "${result.type}" found in pull request title "${title}".` + - `\n\nPlease use one of these recognized types: ${allowedTypes.join( - ', ' - )}.` + `\n\nPlease see the parse result: ${result}.` ); } };