class Overcommit::Hook::PreCommit::XmlLint
Runs ‘xmllint` against any modified XML files.
Constants
- MESSAGE_REGEX
Public Instance Methods
Source
# File lib/overcommit/hook/pre_commit/xml_lint.rb, line 10 def run result = execute(command, args: applicable_files) output = result.stderr.chomp return :pass if result.success? && output.empty? # example message: # path/to/file.xml:1: parser error : Error message extract_messages( output.split("\n").grep(MESSAGE_REGEX), MESSAGE_REGEX ) end