Class: Danger::DangerRubocopJunitParser

Inherits:
Plugin
  • Object
show all
Defined in:
lib/rubocop_junit_parser/plugin.rb

Overview

This is your plugin class. Any attributes or methods you expose here will be available from within your Dangerfile.

To be published on the Danger plugins site, you will need to have the public interface documented. Danger uses [YARD](yardoc.org/) for generating documentation from your plugin source, and you can verify by running ‘danger plugins lint` or `bundle exec rake spec`.

You should replace these comments with a public description of your library.

Examples:

Process the rubocop results sending inline comments to the Githup PR


rubocop_junit_parser.results_path = 'path/to/results'
rubocop_junit_parser.process

See Also:

  • Fernandez/danger-rubocop_junit_parser

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#results_pathString

Path to your json formatted rubocop results

Returns:

  • (String)


25
26
27
# File 'lib/rubocop_junit_parser/plugin.rb', line 25

def results_path
  @results_path
end

Instance Method Details

#processvoid

This method returns an undefined value.

Process the rubocop results from the path specified and sends inline comments to the Github PR



32
33
34
35
# File 'lib/rubocop_junit_parser/plugin.rb', line 32

def process
  return if results_path.nil?
  failures.each { |result| send_comment(result) }
end