lib/swiftformat/swiftformat.rb in danger-swiftformat-0.0.3 vs lib/swiftformat/swiftformat.rb in danger-swiftformat-0.1.0

- old
+ new

@@ -6,11 +6,14 @@ def installed? Cmd.run([@path, "--version"]) end - def check_format(files) - output = Cmd.run([@path] + files + %w(--dryrun --verbose)) + def check_format(files, additional_args = "") + cmd = [@path] + files + cmd << additional_args.split unless additional_args.empty? + cmd << %w(--dryrun --verbose) + output = Cmd.run(cmd.flatten) raise "error running swiftformat: empty output" if output.empty? process(output) end private