Sha256: a218af49556f3c14d98b1262ac1044268ed5a145d3208ac26ca3284ecdaf721f
Contents?: true
Size: 426 Bytes
Versions: 10
Compression:
Stored size: 426 Bytes
Contents
require 'yaml' module Overcommit::Hook::PreCommit # Checks the syntax of any modified YAML files. class YamlSyntax < Base def run output = [] applicable_files.each do |file| begin YAML.load_file(file) rescue ArgumentError => e output << "#{e.message} parsing #{file}" end end return :pass if output.empty? [:fail, output] end end end
Version data entries
10 entries across 10 versions & 2 rubygems