Vale CMS Need more than a rule playground? Explore
Asset Explorer

Commit

A commit message as a subject, a body, and trailers, each its own scope.

view textfsmgit Vale ≥ 3.21.0 Source

Getting started

Save the file as config/views/Commit.yml under your StylesPath, then:

[COMMIT_EDITMSG]
BasedOnStyles = Vale

View = Commit

Commit.yml

Pull named scopes out of a file Vale can’t otherwise parse.
# A commit message: a subject line, a blank line, a body, and trailers.
#
#   [COMMIT_EDITMSG]
#   BasedOnStyles = Vale
#   View = Commit
#
# Then, in a commit-msg hook: vale --path=COMMIT_EDITMSG < "$1"
engine: textfsm
template: |
  Value Subject (.+)
  Value List Body (.*)
  Value List Trailer ([A-Z][\w-]+: .+)

  Start
    ^${Subject} -> Body

  Body
    ^${Trailer}
    ^${Body}
scopes:
  - name: subject
    expr: Subject

  - name: body
    expr: Body
    type: md

  - name: trailer
    expr: Trailer