Class: RuboCop::Formatter::MarkdownFormatter Private
- Inherits:
-
BaseFormatter
- Object
- BaseFormatter
- RuboCop::Formatter::MarkdownFormatter
- Defined in:
- lib/rubocop/formatter/markdown_formatter.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
This formatter displays the report data in markdown
Constant Summary
Constants included from PathUtil
Instance Attribute Summary collapse
- #files ⇒ Object readonly private
- #summary ⇒ Object readonly private
Attributes inherited from BaseFormatter
Instance Method Summary collapse
- #file_finished(file, offenses) ⇒ Object private
- #finished(inspected_files) ⇒ Object private
-
#initialize(output, options = {}) ⇒ MarkdownFormatter
constructor
private
A new instance of MarkdownFormatter.
- #started(target_files) ⇒ Object private
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
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
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)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 |
# File 'lib/rubocop/formatter/markdown_formatter.rb', line 9 def files @files end |
#summary ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 |
# File 'lib/rubocop/formatter/markdown_formatter.rb', line 9 def summary @summary end |
Instance Method Details
#file_finished(file, offenses) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
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
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
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
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
17 18 19 |
# File 'lib/rubocop/formatter/markdown_formatter.rb', line 17 def started(target_files) summary.target_files = target_files end |