Class: RuboCop::Formatter::MarkdownFormatter
- Inherits:
-
BaseFormatter
- Object
- BaseFormatter
- RuboCop::Formatter::MarkdownFormatter
- Defined in:
- lib/rubocop/formatter/markdown_formatter.rb
Overview
This formatter displays the report data in markdown
Constant Summary
Constants included from PathUtil
Instance Attribute Summary collapse
-
#files ⇒ Object
readonly
Returns the value of attribute files.
-
#summary ⇒ Object
readonly
Returns the value of attribute summary.
Attributes inherited from BaseFormatter
Instance Method Summary collapse
- #file_finished(file, offenses) ⇒ Object
- #finished(inspected_files) ⇒ Object
-
#initialize(output, options = {}) ⇒ MarkdownFormatter
constructor
A new instance of MarkdownFormatter.
- #started(target_files) ⇒ Object
Methods included from PathUtil
absolute?, glob?, hidden_dir?, hidden_file?, hidden_file_in_not_hidden_dir?, match_path?, maybe_hidden_file?, relative_path, smart_path
Methods included from TextUtil
Methods inherited from BaseFormatter
Constructor Details
#initialize(output, options = {}) ⇒ MarkdownFormatter
Returns a new instance of MarkdownFormatter.
11 12 13 14 15 |
# File 'lib/rubocop/formatter/markdown_formatter.rb', line 11 def initialize(output, = {}) super @files = [] @summary = Struct.new(:offense_count, :inspected_files, :target_files).new(0) end |
Instance Attribute Details
#files ⇒ Object (readonly)
Returns the value of attribute files.
9 10 11 |
# File 'lib/rubocop/formatter/markdown_formatter.rb', line 9 def files @files end |
#summary ⇒ Object (readonly)
Returns the value of attribute summary.
9 10 11 |
# File 'lib/rubocop/formatter/markdown_formatter.rb', line 9 def summary @summary end |
Instance Method Details
#file_finished(file, offenses) ⇒ Object
21 22 23 24 |
# File 'lib/rubocop/formatter/markdown_formatter.rb', line 21 def file_finished(file, offenses) files << Struct.new(:path, :offenses).new(file, offenses) summary.offense_count += offenses.count end |
#finished(inspected_files) ⇒ Object
26 27 28 29 |
# File 'lib/rubocop/formatter/markdown_formatter.rb', line 26 def finished(inspected_files) summary.inspected_files = inspected_files render_markdown end |
#started(target_files) ⇒ Object
17 18 19 |
# File 'lib/rubocop/formatter/markdown_formatter.rb', line 17 def started(target_files) summary.target_files = target_files end |