Class: Danger::DangerWCC::YarnDeduplicate

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/wcc/yarn_deduplicate.rb

Constant Summary collapse

DEFAULT_OPTIONS =
{
  lockfile: 'yarn.lock',
  severity: :warn
}.freeze

Instance Method Summary collapse

Methods included from Utils

#diff_strings, #each_addition_in_diff, #each_file_in_diff, #each_line_in_diff, #find_file_in_diff, #find_in_diff, #format_links_as_markdown, #issue, #logger, #parsed_diffs, #plugin, #run, #run_and_diff, #with_revision

Constructor Details

#initialize(plugin, options = {}) ⇒ YarnDeduplicate

Returns a new instance of YarnDeduplicate.



19
20
21
22
# File 'lib/wcc/yarn_deduplicate.rb', line 19

def initialize(plugin, options = {})
  @plugin = plugin
  @options = DEFAULT_OPTIONS.merge(options)
end

Instance Method Details

#performObject



24
25
26
27
28
29
30
# File 'lib/wcc/yarn_deduplicate.rb', line 24

def perform
  diff = run_yarn_deduplicate_diff

  each_addition_in_diff(diff) do |line|
    add_deduplicate_warning(line)
  end
end

#yarn_infoObject



14
15
16
17
# File 'lib/wcc/yarn_deduplicate.rb', line 14

def yarn_info
  @yarn_info ||=
    Danger::DangerWCC::Util::YarnInfo.new(self, @options)
end