Sha256: d0016b3584fedae67446f931478bfc216f808e600bcef2b5c691d113df2040e4

Contents?: true

Size: 688 Bytes

Versions: 6

Compression:

Stored size: 688 Bytes

Contents

module SCSSLint
  # Reports a single line per lint.
  class Reporter::DefaultReporter < Reporter
    def report_lints
      return unless lints.any?

      lints.map do |lint|
        "#{location(lint)} #{type(lint)} #{message(lint)}"
      end.join("\n") + "\n"
    end

  private

    def location(lint)
      [
        log.cyan(lint.filename),
        log.magenta(lint.location.line.to_s),
        log.magenta(lint.location.column.to_s),
      ].join(':')
    end

    def type(lint)
      lint.error? ? log.red('[E]') : log.yellow('[W]')
    end

    def message(lint)
      linter_name = log.green("#{lint.linter.name}: ")
      "#{linter_name}#{lint.description}"
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
scss_lint-0.60.0 lib/scss_lint/reporter/default_reporter.rb
scss_lint-0.59.0 lib/scss_lint/reporter/default_reporter.rb
scss_lint-0.58.0 lib/scss_lint/reporter/default_reporter.rb
scss_lint-0.57.1 lib/scss_lint/reporter/default_reporter.rb
scss_lint-0.57.0 lib/scss_lint/reporter/default_reporter.rb
scss_lint-0.56.0 lib/scss_lint/reporter/default_reporter.rb