Using Exclamation Mark for Breaking Change Confuses Parser
See original GitHub issueIt appears that the conventional-commits-parser
package doesn’t directly support the exclamation mark demarcation for noting a breaking change in a commit. Parsing the following commit measage:
chore!: drop node 8 support
Will yield a node with the following structure:
{
type: null,
scope: null,
subject: null,
merge: null,
header: 'chore!: drop node 8 support',
body: null,
footer: null,
notes: [],
references: [],
mentions: [],
revert: null,
hash: 'd0059c44727bd0562db42aedeed60713b698c264',
breaking: false
}
A notable number of properties are left null
in addition to not recognizing the !
indicating a breaking change. Support for !
is noted in the first item in the Specification https://www.conventionalcommits.org/en/v1.0.0/#specification.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:27
- Comments:10
Top Results From Across the Web
Anthony Fu on Twitter: "The issue: https://t.co/2lZkzXtw1V" / Twitter
Kinda surprised to see that conventional-changelog, the most popular changelog generator, does NOT support using exclamation marks for breaking changes ...
Read more >Really Break Grammar Rules on Websites: Part 2
Break Rule #5: Use Exclamation Points Judiciously. Wordsmiths have baptized the exclamation point (!) a cheap attempt at forcing excitement upon ...
Read more >Exclamation point breaks field queries - Elasticsearch
I just noticed that a field query that includes an exclamation point ("! ... If you don't want to use the lucene query...
Read more >Can't use exclamation mark (!) in bash? - Unix Stack Exchange
You might try to directly escape it with a backslash ( \ ) before the character (eg: "http://example.org/\!132" ). However, even though a...
Read more >Exclamation Mark Uses & Examples - Video & Lesson Transcript
Understand the meaning of an exclamation mark in text with examples ... The punctuation at the end of a sentence can completely change...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I solved this by supplying the parser function with the second
options
parameter. The options argument includes the fieldsheaderPattern: /^(\w*)(?:\((.*)\))?!?: (.*)$/
andbreakingHeaderPattern: /^(\w*)(?:\((.*)\))?!: (.*)$/
which seemingly solved the issue. I got these options from the “conventional-changelog-conventionalcommits” package, i.e.resulting with COMMIT as
chore!: drop node 8 support
in this:Exclamation works perfectly with
conventionalcommits
preset: