Skip to content
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

Simplify parsing by preventing ! in Tyoe? #40

Open
epage opened this issue Oct 19, 2021 · 3 comments
Open

Simplify parsing by preventing ! in Tyoe? #40

epage opened this issue Oct 19, 2021 · 3 comments

Comments

@epage
Copy link

epage commented Oct 19, 2021

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.

@epage epage changed the title Simplify parsing by preventing ! in Typoe? Simplify parsing by preventing ! in Tyoe? Oct 19, 2021
@WillGibson
Copy link

Using ! in the type to indicate a breaking change is part of the Conventional Commit standard...

https://www.conventionalcommits.org/en/v1.0.0/?ref=blog.formacao.dev#commit-message-with--to-draw-attention-to-breaking-change

Why would we want to prevent it?

@epage
Copy link
Author

epage commented Feb 29, 2024

My suggestion is to make this change

- ::= <any UTF8-octets except newline or parens or ":" or "!:" or whitespace>+
+ ::= <any UTF8-octets except newline or parens or ":" or "!" or whitespace>+

The idea being that a message like:

He!!o: some message

is both odd (harder to parse by computer and human) and inconsistent in what it allows as you can't then do

He!!: some message

without there being a semantic change

@WillGibson
Copy link

As I understand it, indicating a breaking change is meant to be a single ! after the type, e.g. feat!: some commit message.

I ended up here by mistake though, the package I am needing to fiddle with is actually https://www.npmjs.com/package/conventional-commits-parser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants