Class: RuboBot::RuboCop::Formatter::OffenseCountFormatter

Inherits:
RuboCop::Formatter::OffenseCountFormatter
  • Object
show all
Defined in:
lib/rubobot/rubocop/formatter/offense_count_formatter.rb

Overview

This formatter collects the list of offended cops with a count of how many offenses of their kind were found. Ordered by desc offense count. Does not print output.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(output, options = {}) ⇒ OffenseCountFormatter

Returns a new instance of OffenseCountFormatter.



14
15
16
17
# File 'lib/rubobot/rubocop/formatter/offense_count_formatter.rb', line 14

def initialize(output, options = {})
  @output = StringIO.new
  @options = options
end

Instance Attribute Details

#offense_countsObject (readonly)

Returns the value of attribute offense_counts.



12
13
14
# File 'lib/rubobot/rubocop/formatter/offense_count_formatter.rb', line 12

def offense_counts
  @offense_counts
end

Instance Method Details

#started(target_files) ⇒ Object



19
20
21
22
23
24
# File 'lib/rubobot/rubocop/formatter/offense_count_formatter.rb', line 19

def started(target_files)
  super
  @offense_counts = Hash.new(0)

  return unless output.tty?
end