-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support BREAKING CHANGE in body #30
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,49 +42,53 @@ in sync with the written specification on conventionalcommits.org. | |
|
||
```ebnf | ||
/* See: https://tools.ietf.org/html/rfc3629#section-4 */ | ||
<UTF8-char> ::= "Placeholder for UTF-8 grammar" | ||
<UTF8-octets> ::= <UTF8char>+ | ||
|
||
<CR> ::= "0x000D" | ||
<LF> ::= "0x000A" | ||
<newline> ::= [<CR>], <LF> | ||
<parens> ::= "(" | ")" | ||
<ZWNBSP> ::= "U+FEFF" | ||
<TAB> ::= "U+0009" | ||
<VT> ::= "U+000B" | ||
<FF> ::= "U+000C" | ||
<SP> ::= "U+0020" | ||
<NBSP> ::= "U+00A0" | ||
<UTF8-char> ::= "Placeholder for UTF-8 grammar" | ||
<UTF8-octets> ::= <UTF8char>+ | ||
|
||
<CR> ::= "0x000D" | ||
<LF> ::= "0x000A" | ||
<newline> ::= [<CR>], <LF> | ||
<parens> ::= "(" | ")" | ||
<ZWNBSP> ::= "U+FEFF" | ||
<TAB> ::= "U+0009" | ||
<VT> ::= "U+000B" | ||
<FF> ::= "U+000C" | ||
<SP> ::= "U+0020" | ||
<NBSP> ::= "U+00A0" | ||
/* See: https://www.ecma-international.org/ecma-262/11.0/index.html#sec-white-space */ | ||
<USP> ::= "Any other Unicode 'Space_Separator' code point" | ||
<USP> ::= "Any other Unicode 'Space_Separator' code point" | ||
/* Any non-newline whitespace: */ | ||
<whitespace> ::= <ZWNBSP> | <TAB> | <VT> | <FF> | <SP> | <NBSP> | <USP> | ||
|
||
<message> ::= <summary>, <newline>+, <body>, <newline>*, <footer>+ | ||
| <summary>, <newline>*, <footer>+ | ||
| <summary>, <newline>* | ||
|
||
<summary> ::= <type>, "(", <scope>, ")", ["!"], ":", <whitespace>*, <text> | ||
| <type>, ["!"], ":", <whitespace>*, <text> | ||
<type> ::= <any UTF8-octets except newline or parens or ":" or "!:" or whitespace>+ | ||
<scope> ::= <any UTF8-octets except newline or parens>+ | ||
<text> ::= <any UTF8-octets except newline>* | ||
|
||
/* | ||
* Note: if the first <body> node starts with "BREAKING CHANGE:" this should | ||
* be treated by parsers as a breaking change marker upstream: | ||
*/ | ||
<body> ::= [<any text except pre-footer>], <newline>, <body>* | ||
| [<any text except pre-footer>] | ||
/* Note: <pre-footer> is used during parsing, but never returned in the AST. */ | ||
<pre-footer> ::= <newline>*, <footer>+ | ||
|
||
<footer> ::= <token>, <separator>, <whitespace>*, <value>, [<newline>] | ||
<token> ::= "BREAKING CHANGE" | ||
| <type>, "(" <scope> ")", ["!"] | ||
| <type>, ["!"] | ||
<separator> ::= ":" | " #" | ||
<value> ::= <text>, <continuation>+ | ||
| <text> | ||
<continuation> ::= <newline>, <whitespace>+, <text> | ||
<whitespace> ::= <ZWNBSP> | <TAB> | <VT> | <FF> | <SP> | <NBSP> | <USP> | ||
|
||
<message> ::= <summary>, <newline>+, <body>, <newline>*, <footer>+ | ||
| <summary>, <newline>*, <footer>+ | ||
| <summary>, <newline>* | ||
|
||
/* "!" should be added to the AST as a <breaking-change> node with the value "!" */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added note that |
||
<summary> ::= <type>, "(", <scope>, ")", ["!"], ":", <whitespace>*, <text> | ||
| <type>, ["!"], ":", <whitespace>*, <text> | ||
<type> ::= <any UTF8-octets except newline or parens or ":" or "!:" or whitespace>+ | ||
<scope> ::= <any UTF8-octets except newline or parens>+ | ||
<text> ::= <any UTF8-octets except newline>* | ||
|
||
|
||
<body> ::= [<any body-text except pre-footer>], <newline>, <body>* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. introduced a |
||
| [<any body-text except pre-footer>] | ||
/* For convenience the <breaking-change>, <separator>, <whitespace>, and | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note for implementers that we don't want to add a |
||
* <text> tokens of <body-text> should be appended as children to <body> */ | ||
<body-text> ::= [<breaking-change>, ":", <whitespace>*], text | ||
/* Note: <pre-footer> is used during parsing, but not returned in the AST. */ | ||
<pre-footer> ::= <newline>*, <footer>+ | ||
|
||
<footer> ::= <token>, <separator>, <whitespace>*, <value>, [<newline>] | ||
/* "!" should be added to the AST as a <breaking-change> node with the value "!" */ | ||
<token> ::= <breaking-change> | ||
| <type>, "(" <scope> ")", ["!"] | ||
| <type>, ["!"] | ||
<separator> ::= ":" | " #" | ||
<value> ::= <text>, <continuation>+ | ||
| <text> | ||
<continuation> ::= <newline>, <whitespace>+, <text> | ||
|
||
<breaking-change> ::= "BREAKING CHANGE" | "BREAKING-CHANGE" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The text on conventionalcommits.org indicates that we should support |
||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding the
breaking-change
node forced me to indent for consistency.