Class: Pronto::Haml
- Inherits:
-
Runner
- Object
- Runner
- Pronto::Haml
- Defined in:
- lib/pronto/haml.rb
Instance Method Summary collapse
Instance Method Details
#inspect(patch) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/pronto/haml.rb', line 15 def inspect(patch) lints = runner.run(files: [patch.new_file_full_path.to_s], reporter: reporter).lints lints.map do |lint| patch.added_lines.select { |line| line.new_lineno == lint.line } .map { |line| (lint, line) } end end |
#new_message(lint, line) ⇒ Object
23 24 25 26 |
# File 'lib/pronto/haml.rb', line 23 def (lint, line) path = line.patch.delta.new_file[:path] Message.new(path, line, lint.severity.name, lint., nil, self.class) end |
#run ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/pronto/haml.rb', line 6 def run return [] unless @patches @patches.select { |patch| patch.additions > 0 } .select { |patch| haml_file?(patch.new_file_full_path) } .map { |patch| inspect(patch) } .flatten.compact end |