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_auto_correct: 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_auto_correct: false) ⇒ Report
rubocop:disable Metrics/ParameterLists
108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/rubocop/formatter/simple_text_formatter.rb', line 108 def initialize( file_count, offense_count, correction_count, correctable_count, rainbow, safe_auto_correct: false ) @file_count = file_count @offense_count = offense_count @correction_count = correction_count @correctable_count = correctable_count @rainbow = rainbow @safe_auto_correct = safe_auto_correct end |
Instance Method Details
#summary ⇒ Object
rubocop:enable Metrics/ParameterLists
121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/rubocop/formatter/simple_text_formatter.rb', line 121 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 |