class Overcommit::Hook::PreCommit::HamlLint

Runs `haml-lint` against any modified HAML files.

@see github.com/brigade/haml-lint/

Constants

MESSAGE_TYPE_CATEGORIZER

Public Instance Methods

run() click to toggle source
# File lib/overcommit/hook/pre_commit/haml_lint.rb, line 12
def run
  result = execute(command, args: applicable_files)
  return :pass if result.success?

  extract_messages(
    result.stdout.split("\n"),
    /^(?<file>(?:\w:)?[^:]+):(?<line>\d+)[^ ]* (?<type>[^ ]+)/,
    MESSAGE_TYPE_CATEGORIZER,
  )
end