From cdbb085f1d44409b1fb0bb18559793d894f06e64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Cruz?= Date: Thu, 21 Dec 2017 13:59:14 +0000 Subject: [PATCH] fix: ignore semver commits with chore type Closes #198 --- @commitlint/core/src/library/is-ignored.js | 1 + @commitlint/core/src/library/is-ignored.test.js | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/@commitlint/core/src/library/is-ignored.js b/@commitlint/core/src/library/is-ignored.js index b90f6b1ab9..9ef99f7220 100644 --- a/@commitlint/core/src/library/is-ignored.js +++ b/@commitlint/core/src/library/is-ignored.js @@ -12,6 +12,7 @@ const WILDCARDS = [ c .split('\n') .shift() + .replace(/^chore(\([^)]+\))?:/, '') .trim() ) ]; diff --git a/@commitlint/core/src/library/is-ignored.test.js b/@commitlint/core/src/library/is-ignored.test.js index 13ed035b2f..5c794d8584 100644 --- a/@commitlint/core/src/library/is-ignored.test.js +++ b/@commitlint/core/src/library/is-ignored.test.js @@ -68,6 +68,13 @@ test('should ignore npm semver commits', t => { VERSION_MESSAGES.forEach(message => t.true(isIgnored(message))); }); +test('should ignore npm semver commits with chore', t => { + VERSION_MESSAGES.forEach(message => t.true(isIgnored(`chore: ${message}`))); + VERSION_MESSAGES.forEach(message => + t.true(isIgnored(`chore(release): ${message}`)) + ); +}); + test('should ignore npm semver commits with footers', t => { AMENDED_VERSION_MESSAGES.forEach(message => t.true(isIgnored(message))); });