Sha256: edae76dc50f82496eba9ff0d169727cfab1e9a0b13d7ee1a1c05e1f04114c07f
Contents?: true
Size: 1.01 KB
Versions: 236
Compression:
Stored size: 1.01 KB
Contents
# frozen_string_literal: true module RuboCop module Formatter # This formatter displays the report data in format that's # easy to process in the Emacs text editor. # The output is machine-parsable. class EmacsStyleFormatter < BaseFormatter def file_finished(file, offenses) offenses.each do |o| output.printf( "%<path>s:%<line>d:%<column>d: %<severity>s: %<message>s\n", path: file, line: o.line, column: o.real_column, severity: o.severity.code, message: message(o) ) end end private def message(offense) message = if offense.corrected_with_todo? "[Todo] #{offense.message}" elsif offense.corrected? "[Corrected] #{offense.message}" elsif offense.correctable? "[Correctable] #{offense.message}" else offense.message end message.tr("\n", ' ') end end end end
Version data entries
236 entries across 227 versions & 21 rubygems