fork-dev / Tracker

Bug and issue tracker for Fork for Mac
505 stars 12 forks source link

Syntax highlight of conventional commit prefix not applied when scope contains space #2187

Open FrancoisBeaune opened 3 weeks ago

FrancoisBeaune commented 3 weeks ago

This works fine:

feat(Engine): Add a feature to the engine

But this doesn't (the prefix isn't rendered in bold):

feat(Hydra Delegate): Add a feature to the Hydra delegate

DanPristupov commented 3 weeks ago

Supporting spaces is not possible because it would make a lot of false positives. For example:

Merge branch 'master' of github.com:facebook/react
Provide `grunt npm:test` for verifying NPM package functionality.
Recommend Node v0.10.0 due to https://github.com/isaacs/npm/issues/2907
Merge branch 'rm-wrapup' of github.com:chenglou/react into rm-wrapup
FrancoisBeaune commented 3 weeks ago

Not sure to understand your example as it doesn't contain parentheses.

FrancoisBeaune commented 3 weeks ago

To be clear, all I'm suggesting is that spaces should be authorized in the scope part of the Conventional Commits prefix.

In other words, the regex for syntax highlighting Conventional Commits prefixes should be something like:

^(feat|fix|chore|docs|style|refactor|perf|test|build|ci|revert|other)(\([^\)]+\))?:\s(.+)$