Method: Overcommit::Hook::PreCommit::JsonSyntax#run
- Defined in:
- lib/overcommit/hook/pre_commit/json_syntax.rb
#run ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/overcommit/hook/pre_commit/json_syntax.rb', line 6 def run = [] applicable_files.each do |file| begin JSON.parse(IO.read(file)) rescue JSON::ParserError => e error = "#{e.} parsing #{file}" << Overcommit::Hook::Message.new(:error, file, nil, error) end end end |