Skip to content

Commit e35f798

Browse files
committed
feat(lint): allow for custom commit parser function
This change makes it possible to pass a custom function to the top level lint function, which is passed through to the parse function and consequently passed through to the parser exposed by convential-commits-parser. In linting it is important to parse content to be linted with a high level of fidelity so linting can be applied accurately. The default parser the is used, conventional-commits-parser makes many assumptions about the format of the commit to perform its parsing which leads to parsing errors and inaccuracies which in turn lead to many false positives in linting, and incorrect or invalid errors in additional confusing error messages. This change will allow end users utilize a more accurate parser for their linting purposes in the short term while issues with the default parser are reconciled Resolves: #4816
1 parent 1d4963d commit e35f798

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

@commitlint/lint/src/lint.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default async function lint(
3737
const parsed =
3838
message === ""
3939
? { header: null, body: null, footer: null }
40-
: await parse(message, undefined, opts.parserOpts);
40+
: await parse(message, opts.parser, opts.parserOpts);
4141

4242
if (parsed.header === null && parsed.body === null && parsed.footer === null) {
4343
// Commit is empty, skip

0 commit comments

Comments
 (0)