Skip to content

Commit 0759fc0

Browse files
feat(plugins): support async
1 parent 4cff46c commit 0759fc0

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/lint-commits.plugin.ts

+8-6
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ async function validateCommit(commitMeta, opts, customLintFunctions) {
2323
opts.rules,
2424
opts.parserPreset ? { parserOpts: opts.parserPreset.parserOpts } : {}
2525
);
26-
customLintFunctions.forEach(customLintFunction => {
27-
if (isIgnored(commitMeta.message)) {
28-
return;
29-
}
30-
customLintFunction(commitMeta.message, report);
31-
});
26+
await Promise.all(
27+
customLintFunctions.map(async customLintFunction => {
28+
if (isIgnored(commitMeta.message)) {
29+
return;
30+
}
31+
await customLintFunction(commitMeta.message, report);
32+
})
33+
);
3234
if (!report.valid) {
3335
const detail = commitMeta.commit.short ? ` ${commitMeta.commit.short}` : '';
3436
console.error('😞 Errors found with commit' + detail);

0 commit comments

Comments
 (0)