Sha256: c0e9e63dc1abda39664fbe0668b25dad69c4ede7e4eef9d64d16c05084fd0d4f
Contents?: true
Size: 450 Bytes
Versions: 19
Compression:
Stored size: 450 Bytes
Contents
# frozen_string_literal: true module Overcommit::Hook::PreCommit # Checks the syntax of any modified YAML files. class YamlSyntax < Base def run messages = [] applicable_files.each do |file| begin YAML.load_file(file) rescue ArgumentError, Psych::SyntaxError => e messages << Overcommit::Hook::Message.new(:error, file, nil, e.message) end end messages end end end
Version data entries
19 entries across 19 versions & 2 rubygems