Class: SCSSLint::Reporter::JSONReporter
- Inherits:
-
SCSSLint::Reporter
- Object
- SCSSLint::Reporter
- SCSSLint::Reporter::JSONReporter
- Defined in:
- lib/scss_lint/reporter/json_reporter.rb
Overview
Reports lints in a JSON format.
Instance Attribute Summary
Attributes inherited from SCSSLint::Reporter
Instance Method Summary collapse
Methods inherited from SCSSLint::Reporter
Constructor Details
This class inherits a constructor from SCSSLint::Reporter
Instance Method Details
#report_lints ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# 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 = {} issue['linter'] = lint.linter.name if lint.linter issue['line'] = lint.location.line issue['column'] = lint.location.column issue['length'] = lint.location.length issue['severity'] = lint.severity issue['reason'] = lint.description issue end end JSON.pretty_generate(output) end |