Class: RuboBot::RuboCop::Formatter::OffenseCountFormatter
- Inherits:
-
RuboCop::Formatter::OffenseCountFormatter
- Object
- RuboCop::Formatter::OffenseCountFormatter
- RuboBot::RuboCop::Formatter::OffenseCountFormatter
- 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
-
#offense_counts ⇒ Object
readonly
Returns the value of attribute offense_counts.
Instance Method Summary collapse
-
#initialize(output, options = {}) ⇒ OffenseCountFormatter
constructor
A new instance of OffenseCountFormatter.
- #started(target_files) ⇒ Object
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, = {}) @output = StringIO.new @options = end |
Instance Attribute Details
#offense_counts ⇒ Object (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 |