Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
test allowed types removal
Browse files Browse the repository at this point in the history
Signed-off-by: Zadkiel Aharonian <hello@zadkiel.fr>
  • Loading branch information
aslafy-z authored Jan 13, 2024
1 parent a0b8510 commit e6da597
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/validateTitle.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}.`
);
}
};

0 comments on commit e6da597

Please sign in to comment.