Skip to content

Commit

Permalink
fix(conventional-changelog-angular): revert pattern to not require a …
Browse files Browse the repository at this point in the history
  • Loading branch information
privatenumber committed Apr 24, 2024
1 parent c2c4b3a commit e5786cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/conventional-changelog-angular/src/parser.js
Expand Up @@ -7,7 +7,7 @@ export function createParserOpts () {
'subject'
],
noteKeywords: ['BREAKING CHANGE'],
revertPattern: /^(?:Revert|revert:)\s"?([\s\S]+?)"?\s*This reverts commit (\w*)\./i,
revertPattern: /^(?:Revert|revert:)\s"?([\s\S]+?)"?\s*This reverts commit (\w{7,40})\b/i,
revertCorrespondence: ['header', 'hash']
}
}
8 changes: 4 additions & 4 deletions packages/conventional-changelog-angular/test/index.spec.js
Expand Up @@ -58,8 +58,8 @@ setups([
testTools.gitCommit(['build(deps): bump @dummy/package from 7.1.2 to 8.0.0', 'BREAKING CHANGE: The Change is huge.'])
},
() => {
testTools.gitCommit(['Revert \\"feat: default revert format\\"', 'This reverts commit 1234.'])
testTools.gitCommit(['revert: feat: custom revert format', 'This reverts commit 5678.'])
testTools.gitCommit(['Revert \\"feat: default revert format\\"', 'This reverts commit 1234567.'])
testTools.gitCommit(['revert: feat: custom revert format', 'This reverts commit 5678910.'])
}
])

Expand Down Expand Up @@ -324,8 +324,8 @@ describe('conventional-changelog-angular', () => {
})) {
chunk = chunk.toString()

expect(chunk).toMatch(/custom revert format/)
expect(chunk).toMatch(/default revert format/)
expect(chunk).toMatch('custom revert format')
expect(chunk).toMatch('default revert format')
i++
}

Expand Down

0 comments on commit e5786cd

Please sign in to comment.