Class: Danger::DangerTailor

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

Overview

Shows the build errors, warnings and violations generated from Tailor. You need [Tailor](tailor.sh) installed and generating a json file to use this plugin

Examples:

Showing summary


tailor -f json MyProject/ > tailor.json
danger-tailor.report 'tailor.json'

Filter out the pods before analyzing


danger-tailor.ignored_files = '**/Pods/**'
danger-tailor.report 'tailor.json'

See Also:

  • IntrepidPursuits/danger-tailor

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ignored_files[String]

A globbed string or array of strings which should match the files that you want to ignore warnings on. Defaults to nil. An example would be ‘’/Pods/‘` to ignore warnings in Pods that your project uses.

Returns:

  • ([String])

    ignored-files



31
32
33
# File 'lib/tailor/plugin.rb', line 31

def ignored_files
  @ignored_files
end

#project_rootString

The project root, which will be used to make the paths relative. Defaults to ‘pwd`.

Returns:

  • (String)

    project_root value



23
24
25
# File 'lib/tailor/plugin.rb', line 23

def project_root
  @project_root
end

#sticky_summaryBoolean

Defines if the test summary will be sticky or not. Defaults to ‘false`.

Returns:

  • (Boolean)

    sticky



36
37
38
# File 'lib/tailor/plugin.rb', line 36

def sticky_summary
  @sticky_summary
end

Instance Method Details

#report(file_path) ⇒ void

This method returns an undefined value.

Reads a file with JSON Xcode summary and reports it.

Parameters:

  • file_path (String)

    Path for Tailor summary in JSON format.



56
57
58
59
60
# File 'lib/tailor/plugin.rb', line 56

def report(file_path)
  raise 'Summary file not found' unless File.file?(file_path)
  tailor_summary = JSON.parse(File.read(file_path), symbolize_names: true)
  run_summary(tailor_summary)
end