Class: Danger::ShiphawkPlugin

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

Overview

Run Ruby files through Rubocop. Results are passed out in a hash with errors/warnings

Examples:

Specifying custom config file.


shiphawk_plugin.checkup

See Also:

  • ShipHawk/danger-shiphawk-plugin

Instance Method Summary collapse

Instance Method Details

#checkup(options = {}) ⇒ void

This method returns an undefined value.

Runs Ruby files through Rubocop. Generates a list of errors/warnings

Parameters:

  • options (Hash) (defaults to: {})


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/danger_plugin.rb', line 23

def checkup(options = {})
  @files = options.fetch(:files, 'all')
  @config = options.fetch(:config, nil)
  @limit_of_warnings = options.fetch(:limit_of_warnings, 10)
  @autofix_hint_threshold = options.fetch(:autofix_hint_threshold, 50)

  return if offenses.empty?

  message_detailed_report
  message_compact_report
  message_hint
  message_autofix

  nil
end