Skip to content

Commit

Permalink
fix: ignore empty commit messages conventional-changelog#615
Browse files Browse the repository at this point in the history
bypass rules for completely empty commit messages (only of blank
lines/comments in message)
  • Loading branch information
Carl Tompkins authored and marionebl committed Feb 18, 2020
1 parent 9d14792 commit b8a5515
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions @commitlint/lint/src/lint.ts
Expand Up @@ -35,6 +35,21 @@ export default async function lint(

// Parse the commit message
const parsed = await parse(message, undefined, opts.parserOpts);

if (
parsed.header === null &&
parsed.body === null &&
parsed.footer === null
) {
// Commit is empty, skip
return {
valid: true,
errors: [],
warnings: [],
input: message
};
}

const allRules: Map<string, Rule<unknown> | Rule<never>> = new Map(
Object.entries(defaultRules)
);
Expand Down

0 comments on commit b8a5515

Please sign in to comment.