From 00b9d4be4bff3b3f64edf163768af71c99bceed1 Mon Sep 17 00:00:00 2001 From: Piotr Kuczynski Date: Tue, 19 Apr 2022 22:38:17 +0200 Subject: chore: prefer string templates over string concatenation (#732) --- scripts/verifyCommit.ts | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'scripts/verifyCommit.ts') diff --git a/scripts/verifyCommit.ts b/scripts/verifyCommit.ts index e2c4ae70..11f22ab4 100644 --- a/scripts/verifyCommit.ts +++ b/scripts/verifyCommit.ts @@ -18,16 +18,22 @@ const isMergeCommit = msg.startsWith('Merge remote-tracking-branch'); if (!isMergeCommit && !releaseRE.test(msg) && !commitRE.test(msg)) { console.log(); + console.error( ` ${colors.bgRed(colors.white(' ERROR '))} ${colors.red( `invalid commit message format.` - )}\n\n` + - colors.red( - ` Proper commit message format is required for automated changelog generation. Examples:\n\n` - ) + - ` ${colors.green(`feat: add 'comments' option`)}\n` + - ` ${colors.green(`fix: handle events on blur (close #28)`)}\n\n` + - colors.red(` See .github/commit-convention.md for more details.\n`) + )} + + ${colors.red( + `Proper commit message format is required for automated changelog generation. Examples:` + )} + + ${colors.green(`feat: add 'comments' option`)} + ${colors.green(`fix: handle events on blur (close #28)`)} + + ${colors.red(`See .github/commit-convention.md for more details.`)} +` ); + process.exit(1); } -- cgit v1.2.3