Class: Danger::DangerAdLicenselint

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

Overview

Lint license from pods in your Podfile This is done using the gem ad_licenselint

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

Examples:

Specifying options


ad_licenselint.lint_licenses(inline_mode: true)

See Also:

  • fabernovel/danger-ad_licenselint

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#verboseBoolean

Provides additional logging diagnostic information

Returns:

  • (Boolean)


22
23
24
# File 'lib/ad_licenselint/plugin.rb', line 22

def verbose
  @verbose
end

Instance Method Details

#lint_licenses(inline_mode: false) ⇒ void

This method returns an undefined value.

Lints licenses from pods in Podfile. Generates a ‘markdown` list of warnings either inline or globally.

Parameters:

  • inline_mode (Boolean) (defaults to: false)

    Create a review on the Podfile directly if set to true



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/ad_licenselint/plugin.rb', line 32

def lint_licenses(inline_mode: false)
  return if podfile_path.nil? || lockfile_path.nil?

  runner = ADLicenseLint::Runner.new({
    format: ADLicenseLint::Constant::MARKDOWN_FORMAT_OPTION,
    path: ".",
    all: false,
    only: get_modified_pods_from_diff
  })
  report = runner.create_report

  if inline_mode
    post_inline_messages(report)
  else
    post_global_message(runner.format(report))
  end
end