lib/pronto/swiftlint_runner.rb in pronto-swiftlint-0.1.1 vs lib/pronto/swiftlint_runner.rb in pronto-swiftlint-0.2.0
- old
+ new
@@ -1,16 +1,16 @@
require 'pronto/swiftlint/wrapper'
require 'pronto'
module Pronto
class SwiftlintRunner < Runner
- def run(patches, _)
- return [] unless patches
+ def run
+ return [] unless @patches
offences = Swiftlint::Wrapper.new.lint
- patches.select { |p| p.additions > 0 }
+ @patches.select { |p| p.additions > 0 }
.select { |p| swift_file?(p.new_file_full_path) }
.map { |p| inspect(p, offences) }
.flatten
.compact
end
@@ -32,10 +32,10 @@
messages.compact
end
def new_message(offence, line)
path = line.patch.delta.new_file[:path]
- Message.new(path, line, offence[:level], offence[:message])
+ Message.new(path, line, offence[:level], offence[:message], nil, self.class)
end
def swift_file?(path)
%w(.swift).include?(File.extname(path))
end