Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe committed Dec 18, 2020
0 parents commit cfb18f6
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## Conventional Commits Parser

Reference implementation of Conventional Commits specification.

## The Grammar

```bnf
# See: https://tools.ietf.org/html/rfc3629#section-4
<UTF8-octets> ::= 1*<UTF8-char>
<CR> ::= "0x000D"
<LF> ::= "0x000A"
<newline> ::= <CR>? <LF>
<parens> ::= "(" | ")"
<ZWNBSP> ::= "U+FEFF"
<TAB> ::= "U+0009"
<VT> ::= "U+000B"
<FF> ::= "U+000C"
<SP> ::= "U+000C"
<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"
<whitespace> ::= <ZWNBSP> | <TAB> | <VT> | <FF> | <SP> | <NBSP> | <USP>
<message> ::= <summary> <newline> <newline> 1*<footer>
| <summary> <newline> <newline> <body> <newline> <newline> 1*<footer>
| <summary> <newline> <newline> <body>
| <summary>
<summary> ::= <type> "(" <scope> ")" ":" <summary-text>
| <type> ":" <summary-text>
<type> ::= 1*<any UTF8-octets except newline or parens or ":" or whitespace>
<scope> ::= 1*<any UTF8-octets except newline or parens>
<summary-text> ::= 1*<any UTF8-octets except newline>
<footer> ::= <token> ":" <value>
<token> ::= <type> "(" <scope> ")"
| <type>
| "BREAKING CHANGE"
<value> ::= <summary-text> 1*<continuation>
| <summary-text>
<continuation> ::= <newline> <whitespace> <summary-text>
<body> ::= 1*<body-text>
<body-text> ::= <newline>? <summary-text>
```
24 changes: 24 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "@conventional-commits/parser",
"version": "1.0.0",
"description": "reference implementation of conventionalcommits.org spec",
"main": "index.js",
"scripts": {
"test": "c8 mocha test.js"
},
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/conventional-commits/parser.git"
},
"keywords": [
"parser",
"conventional",
"commits"
],
"author": "Ben Coe <[email protected]>",
"license": "ISC",
"bugs": {
"url": "https://github.com/conventional-commits/parser/issues"
},
"homepage": "https://github.com/conventional-commits/parser#readme"
}

0 comments on commit cfb18f6

Please sign in to comment.