Class: SCSSLint::Reporter::JSONReporter

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

Overview

Reports lints in a JSON format.

Instance Attribute Summary

Attributes inherited from SCSSLint::Reporter

#lints

Instance Method Summary collapse

Methods inherited from SCSSLint::Reporter

descendants, #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/json_reporter.rb', line 6

def report_lints
  output = {}
  lints.group_by(&:filename).each do |filename, file_lints|
    output[filename] = file_lints.map do |lint|
      issue_hash(lint)
    end
  end
  JSON.pretty_generate(output)
end