diff --git a/CHANGELOG.md b/CHANGELOG.md index dc4d1e3..1b3b114 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# Latest + +## Features + +- make changelog groups configurable [a2ec46eb](https://github.com/lekterable/perfekt/commit/a2ec46eb9e962a79a9153300adc2229af182d4a6) + # 1.1.0 ## Features diff --git a/src/index.js b/src/index.js index 0896b52..6f559f7 100644 --- a/src/index.js +++ b/src/index.js @@ -9,7 +9,8 @@ export const defaultConfig = { ['## Features', 'feat', 'feature'], ['## Fixes', 'fix'] ], - lineFormat: '- %message% %hash%' + lineFormat: '- %message% %hash%', + ignoredScopes: ['changelog'] } export const defaultChangelogOptions = { diff --git a/src/utils/misc.js b/src/utils/misc.js index 5cf13f9..7314444 100644 --- a/src/utils/misc.js +++ b/src/utils/misc.js @@ -18,7 +18,7 @@ export const groupCommits = (commits, config) => const normalizedScope = commitDetails.scope && commitDetails.scope.toLowerCase() - if (normalizedScope === 'changelog') return [...grouped] + if (config.ignoredScopes.includes(normalizedScope)) return [...grouped] if (normalizedScope === 'release') { const isLatest = isObjectEmpty(group) const release = { release: commit } diff --git a/src/utils/misc.test.js b/src/utils/misc.test.js index ad6513b..c380ba6 100644 --- a/src/utils/misc.test.js +++ b/src/utils/misc.test.js @@ -88,12 +88,14 @@ describe('misc', () => { ['## Feat', 'feat', 'feature'], ['## Fix', 'fix'], ['## Custom', 'custom'] - ] + ], + ignoredScopes: ['ignored'] } const mockedInput = [ 'b2f5901922505efbfb6dd684252e8df0cdffeeb2 chore!: generate changelog', '2ea04355c1e81c5088eeabc6e242fb1ade978524 chore!: version releases', 'bffc2f9e8da1c7ac133689bc9cd14494f3be08e3 refactor: extract line generating logic to function and promisify exec', + 'bffc2f9e8da1c7ac133689bc9cd14494f3be08e3 refactor(ignored): rewrite legacy code', 'aa805ce71ee103965ce3db46d4f6ed2658efd08d feat: add option to write to local CHANGELOG file', 'b2f5901922505efbfb6dd684252e8df0cdffeeb2 custom: make changelog customizable', 'f2191200bf7b6e5eec3d61fcef9eb756e0129cfb chore(release): 0.1.0',