News for hackers. Stuff that matters.
Re:Show HN: GitCop – Automated Commit Message Validation for... by Gazler on Monday November 10, 2014 @06:19PM (#8587296)
Glad it made sense!

So the match is exact between the non %{..} characters. The idea for scope is the context of the commit, in my libraries I use the name of the class as the scope.

For example with the default format string:

    test string: "fix(User): ensure email address is required"
    format:      "%{type}(%{scope}): %{description}"
    [type: "fix", scope: "User", description: "ensure email address is required"]
So any literal characters are matched exactly and anything inside the capturing %{...} is assigned to that variable.

This does fall over in the following case:

    "fix():(User): ensure email address is required"
    "%{type}(%{scope}): %{description}"
    [type: "fix", scope: "):(User", description: "ensure email address is required"]
It is certainly a candidate for improvement in the future.

There are no comments on this comment yet.