class HamlLint::Reporter::ProgressReporter

Outputs files as they are output as a simple symbol, then outputs a summary of each lint.

Constants

DOT

Public Instance Methods

display_report(report) click to toggle source
# File lib/haml_lint/reporter/progress_reporter.rb, line 13
def display_report(report)
  lints = report.lints

  log.log("\n\nOffenses:\n", true) if lints.any?
  lints.each { |lint| print_lint(lint) }

  print_summary(report)
end
finished_file(_file, lints) click to toggle source
# File lib/haml_lint/reporter/progress_reporter.rb, line 22
def finished_file(_file, lints)
  report_file_as_mark(lints)
end
start(files) click to toggle source
# File lib/haml_lint/reporter/progress_reporter.rb, line 26
def start(files)
  log.log("Inspecting #{pluralize('file', count: files.size)}", true)
end

Private Instance Methods

dot() click to toggle source
# File lib/haml_lint/reporter/progress_reporter.rb, line 32
def dot
  @dot ||= Rainbow(DOT).green
end
report_file_as_mark(lints) click to toggle source
# File lib/haml_lint/reporter/progress_reporter.rb, line 36
def report_file_as_mark(lints)
  mark =
    if lints.empty?
      dot
    else
      worst_lint = lints.max_by(&:severity)
      worst_lint.severity.mark_with_color
    end

  log.log(mark, false)
end