channable / hoff

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

Include a summary of command syntax upon parse error #270

Open isomorpheme opened 2 months ago

isomorpheme commented 2 months ago

269 adds a message linking to the README, since that already describes the syntax, but it would be nicer to have a one-line summary immediately in the message, without having to click a link - something like @prefix merge [on friday] [and deploy [SUBPROJECT] [to ENV]].

The question there is how to make sure it stays in sync with the actual parser; it's easy to forget to update a hardcoded string (and indeed, at time of writing, the README doesn't document the syntax for deploying specific subprojects). This might require switching the parsing setup away from plain parser combinators to something that's more introspectible.

As a nice-to-have, the summary could be tailored to the configuration of the repository, e.g. if multiple deploy environments aren't configured, omit the syntax for specifically targeting one.