Skip to content

Commit

Permalink
refactor: rename config property
Browse files Browse the repository at this point in the history
  • Loading branch information
lekterable committed Jul 23, 2021
1 parent cb54471 commit b80d365
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/config/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Object {
"changelog",
],
"lineFormat": "* %message% %hash% %hash%",
"miscFormat": "## Misc",
"miscHeader": "## Misc",
"releaseHeader": "## Release version - @%version%",
"unreleasedHeader": "## **Unreleased**",
}
Expand Down Expand Up @@ -54,7 +54,7 @@ Object {
"changelog",
],
"lineFormat": "- %message% %hash%",
"miscFormat": "## Misc",
"miscHeader": "## Misc",
"releaseHeader": "# %version%",
"unreleasedHeader": "# Latest",
}
Expand Down
8 changes: 4 additions & 4 deletions src/config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ const defaultConfig = {
unreleasedHeader: '# Latest',
releaseHeader: '# %version%',
breakingHeader: '## BREAKING',
miscHeader: '## Misc',
lineFormat: '- %message% %hash%',
ignoredScopes: ['changelog'],
groups: [
{ name: '## Features', change: 'minor', types: ['feat', 'feature'] },
{ name: '## Fixes', change: 'patch', types: ['fix'] }
],
miscFormat: '## Misc',
lineFormat: '- %message% %hash%',
ignoredScopes: ['changelog']
]
}

export default defaultConfig
6 changes: 3 additions & 3 deletions src/config/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ describe('Config', () => {

it('should return config with overrides', () => {
const overrides = {
breakingHeader: '# BREAKING',
lineFormat: '* %message% %hash% %hash%',
unreleasedHeader: '## **Unreleased**',
releaseHeader: '## Release version - @%version%'
releaseHeader: '## Release version - @%version%',
breakingHeader: '# BREAKING',
lineFormat: '* %message% %hash% %hash%'
}
const { config } = new Config(overrides)

Expand Down
2 changes: 1 addition & 1 deletion src/utils/changelog/generate-changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const generateChangelog = (groupedCommits, version, config) => {
return generateLine({ message, hash }, config) + space
})

const header = matchingGroup ? matchingGroup.name : config.miscFormat
const header = matchingGroup ? matchingGroup.name : config.miscHeader
const isBreaking = type === 'breaking'

const groupHeader = isBreaking ? config.breakingHeader : header
Expand Down

0 comments on commit b80d365

Please sign in to comment.