class SlimLint::Reporter::EmacsReporter
Outputs lints in format: {filename}:{line}:{column}: {kind}: {message}.
Public Instance Methods
display_report(report)
click to toggle source
# File lib/slim_lint/reporter/emacs_reporter.rb, line 6 def display_report(report) sorted_lints = report.lints.sort_by { |l| [l.filename, l.line] } sorted_lints.each do |lint| print_location(lint) print_type(lint) print_message(lint) end end
Private Instance Methods
print_location(lint)
click to toggle source
# File lib/slim_lint/reporter/emacs_reporter.rb, line 18 def print_location(lint) log.info lint.filename, false log.log ':', false log.bold lint.line, false log.log ':', false # TODO: change 1 to column number when linter will have this info. log.bold 1, false log.log ':', false end
print_message(lint)
click to toggle source
# File lib/slim_lint/reporter/emacs_reporter.rb, line 36 def print_message(lint) if lint.linter log.success("#{lint.linter.name}: ", false) end log.log lint.message end
print_type(lint)
click to toggle source
# File lib/slim_lint/reporter/emacs_reporter.rb, line 28 def print_type(lint) if lint.error? log.error ' E: ', false else log.warning ' W: ', false end end