class Pronto::Tailor::Wrapper

Attributes

patch[R]

Public Class Methods

new(patch) click to toggle source
# File lib/pronto/tailor/wrapper.rb, line 10
def initialize(patch)
  @patch = patch
end

Public Instance Methods

lint() click to toggle source
# File lib/pronto/tailor/wrapper.rb, line 14
def lint
  return [] if patch.nil?
  configuration = Configuration.new(ENV)
  path = patch.new_file_full_path.to_s
  stdout, stderr, _status = Open3.capture3(configuration.command_line_for_file(path))
  puts "WARN: pronto-tailor: #{stderr}" if stderr && stderr.size > 0
  return [] if stdout.nil? || stdout.size == 0
  OutputParser.new(path, stdout).parse
rescue => e
  puts "ERROR: pronto-tailor failed to process a diff: #{e}"
  []
end