Class: Danger::DangerPronto

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

Overview

Lints files via Pronto through specified runners Results are displayed as a table in markdown

[Runners](github.com/mmozuras/pronto#runners)

Examples:

Lint files with Pronto and specified Pronto Runners


pronto.lint

See Also:

  • RestlessThinker/danger-pronto

Instance Method Summary collapse

Instance Method Details

#lint(files = nil) ⇒ void

This method returns an undefined value.

Runs files through Pronto. Generates a ‘markdown` list of warnings.

Parameters:

  • files (String) (defaults to: nil)

    A globbed string which should return the files that you want to run though, defaults to nil. If nil, modified and added files from the diff will be used.



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

def lint(files = nil)
  files_to_lint = fetch_files_to_lint(files)

  return if offending_files.empty?

  markdown offenses_message(offending_files)
end

#offending_files(files = nil) ⇒ Array<Object>

Gets the offending files from pronto

Returns:

  • (Array<Object>)

    Array of pronto warnings



34
35
36
37
# File 'lib/danger_pronto/plugin.rb', line 34

def offending_files(files = nil)
  files_to_lint = fetch_files_to_lint(files)
  pronto(files_to_lint)
end