channable / hoff

A gatekeeper for your commits
Apache License 2.0
41 stars 3 forks source link

Parser doesn't always backtrack #256

Closed Riscky closed 7 months ago

Riscky commented 7 months ago

I noticed that the Hoff parser doesn't backtrack when one of the environments or subprojects is a prefix of another.

For example, lets configure two environments staging and staging_new. One can now use @hoff merge and deploy to staging, but when one tries to use @hoff merge and deploy to staging_new, the parser fails to backtrack, and greets you with:

Unknown or invalid command found:

    comment:1:33:
      |
    1 | @OpsBotPrime merge and deploy to staging_new
      |                                         ^
    Merge commands may not be followed by anything other than a punctuation character ('.', ',', '!', '?', ':', ';').
Riscky commented 7 months ago

Fixed by #257