Sha256: 1fe3ef00bee4ab06f33919099e5e4cefc27215543b8762b7ac3c8514baac770e
Contents?: true
Size: 706 Bytes
Versions: 37
Compression:
Stored size: 706 Bytes
Contents
require 'json' module SCSSLint # Reports lints in a JSON format. class Reporter::JSONReporter < Reporter 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 private def issue_hash(lint) { 'line' => lint.location.line, 'column' => lint.location.column, 'length' => lint.location.length, 'severity' => lint.severity, 'reason' => lint.description, }.tap do |hash| hash['linter'] = lint.linter.name if lint.linter end end end end
Version data entries
37 entries across 37 versions & 3 rubygems