Class: RuboCop::Formatter::SimpleTextFormatter::Report
- Inherits:
-
Object
- Object
- RuboCop::Formatter::SimpleTextFormatter::Report
- Includes:
- Colorizable, TextUtil
- Defined in:
- lib/rubocop/formatter/simple_text_formatter.rb
Overview
A helper class for building the report summary text.
Instance Method Summary collapse
-
#initialize(file_count, offense_count, correction_count, correctable_count, rainbow, safe_autocorrect: false) ⇒ Report
constructor
rubocop:disable Metrics/ParameterLists.
-
#summary ⇒ Object
rubocop:enable Metrics/ParameterLists.
Methods included from TextUtil
Methods included from Colorizable
Constructor Details
#initialize(file_count, offense_count, correction_count, correctable_count, rainbow, safe_autocorrect: false) ⇒ Report
rubocop:disable Metrics/ParameterLists
110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/rubocop/formatter/simple_text_formatter.rb', line 110 def initialize( file_count, offense_count, correction_count, correctable_count, rainbow, safe_autocorrect: false ) @file_count = file_count @offense_count = offense_count @correction_count = correction_count @correctable_count = correctable_count @rainbow = rainbow @safe_autocorrect = safe_autocorrect end |
Instance Method Details
#summary ⇒ Object
rubocop:enable Metrics/ParameterLists
123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/rubocop/formatter/simple_text_formatter.rb', line 123 def summary if @correction_count.positive? if @correctable_count.positive? "#{files} inspected, #{offenses} detected, #{corrections} corrected, " \ "#{correctable}" else "#{files} inspected, #{offenses} detected, #{corrections} corrected" end elsif @correctable_count.positive? "#{files} inspected, #{offenses} detected, #{correctable}" else "#{files} inspected, #{offenses} detected" end end |