class Overcommit::Hook::PreCommit::ErbLint

Runs ‘erblint` against any modified ERB files.

@see github.com/Shopify/erb-lint

Constants

MESSAGE_REGEX

Public Instance Methods

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

  extract_messages(
    result.stdout.split("\n\n")[1..],
    MESSAGE_REGEX
  )
end