Class: SCSSLint::Reporter::DefaultReporter

Inherits:
SCSSLint::Reporter show all
Defined in:
lib/scss_lint/reporter/default_reporter.rb

Overview

Reports a single line per lint.

Instance Attribute Summary

Attributes inherited from SCSSLint::Reporter

#lints

Instance Method Summary collapse

Methods inherited from SCSSLint::Reporter

#initialize

Constructor Details

This class inherits a constructor from SCSSLint::Reporter

Instance Method Details

#report_lintsObject



6
7
8
9
10
11
12
13
14
# File 'lib/scss_lint/reporter/default_reporter.rb', line 6

def report_lints
  if lints.any?
    lints.map do |lint|
      type = lint.error? ? '[E]'.red : '[W]'.yellow
      "#{lint.filename.cyan}:" << "#{lint.line}".magenta <<
                                  " #{type} #{lint.description}"
    end.join("\n") + "\n"
  end
end