conventional-commits / parser Goto Github PK
View Code? Open in Web Editor NEWreference implementation of conventionalcommits.org spec
License: ISC License
reference implementation of conventionalcommits.org spec
License: ISC License
It would make it much easier for upstream tooling to use this parser, if we provide a helper that converted the tree into conventional-changelog-parser format.
Most of the existing unist syntax trees have all nodes documented, like nlcst. Would be good to add this once we have the first version of the parser.
TypeScript is widely used within the JS/node ecosystem, would be good to add definitions when we have our first version. I can help with that π
Compare
<footer> ::= <token>, <separator>, <whitespace>*, <value>
/* "!" 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>
with https://git-scm.com/docs/git-interpret-trailers
The amount of ritual to setup a Node, update its value, and record its source position is becoming burdensome.
Let's introduce a Node builder that:
From: #15 (comment)
I feel like there will be tooling value in having this as as well
{ line: <line>, column: <column> }
on the error. Maybe before line 80 we could adderror.position = this.pos
?
Another helpful pattern I like to follow (used in node, which is good precedence I think) is to have distinct
.code
properties for these errors. If we were tooling around errors, checkingerr.code === 'EOF_ERROR
is much better thanerr.message.startsWith('unexpected token EOF at')
.
π Hi! I just was shown this repository - it looks great, thanks for making it. Really nice when tools publish reference implementations β€οΈ.
I don't see any meaningful maintenance activity since 2021. There are some issues or PRs that have been awaiting triage for a year or more, such as #42. So I'm hesitant to build on top of the published package or contribute if this repo is in a "frozen" state.
Is there >=1 maintainer who's still got time to work on this repo?
So that there's no lost information in the parse tree, we should create <whitespace>
and <newline>
tokens for spacing characters that fall outside of <text>
nodes.
Currently, the grammar only prevents the sequence !:
. So someone could have a type like He!!o
.
::= <any UTF8-octets except newline or parens or ":" or "!:" or whitespace>+
Personally, I would find this confusing to see but it also would greatly simplify this grammar rule to only be looking at characters rather than sequence of characters.
As per conventional commits specification v1.0.0 Β§8: βEach footer MUST consist of a word token, followed by either a :<space>
or <space>#
separator, followed by a string value.β
However, the reference grammar currently specifies:
<separator> ::= ":" | " #"
/* missing <space> ^^ */
This is similar to but distinct from #41. The inconsintency was pointed out in crate-ci/git-conventional#54.
I'm assuming this is not intended but I'm unsure if its worth specifying this out of scope.
To simplify parsing logic, we create multiple text
nodes when parsing body
, let's collapse these together into one Node:
Refs #11
Hello,
Not sure I am asking in the right place, I have juste created a rust parser crate.
I was wondering if there was a generic test suite to ensure my parser is compliant with the spec ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.