danger-swiftformat 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 878adc127e7cfa90ea5e96b3fcbd1c6cf9ea66c3
4
- data.tar.gz: d7acc8b4be1678a16af24585e187729e99066a05
3
+ metadata.gz: 1437a0e4028a1bb64f0627d4bc16e15bb8ab73e7
4
+ data.tar.gz: dbad08332fa993cd805425cc88557dbde5524e67
5
5
  SHA512:
6
- metadata.gz: e9a04d379f2619634d565702e7fbffced3b67759b2a486132d6900420277089b3c570a0d1aeb886a9bd04718f7a2df9e4d8cb8e3a860332c99c82bca79a61778
7
- data.tar.gz: 016ef2f96e85863824e34dc1e0a420244e39430557e961f6b877831ec6c631239b92e984057f2b86d6f1db2f74fcb9216df7498724e1225c6b85b83bf6ddc4df
6
+ metadata.gz: 8314e9c66a55238c9923d80bc249ef6c5c0a7f86cb60a6bb7c5ccf951df51ac584565f4e2015e7499a42bd0f757c6108d1e122cad7880e480e10e3a47e385eca
7
+ data.tar.gz: 8c9a45515e26efa9cfb60f871b13c9e10a8755ad5979bb295309c1c05d0380401b79fbd52d8e294be2f01c0e049621b44e9f698aa49ff1977a882cccce0e106b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- danger-swiftformat (0.2.0)
4
+ danger-swiftformat (0.3.0)
5
5
  danger-plugin-api (~> 1.0)
6
6
 
7
7
  GEM
@@ -1,3 +1,3 @@
1
1
  module Swiftformat
2
- VERSION = "0.2.0".freeze
2
+ VERSION = "0.3.0".freeze
3
3
  end
@@ -10,7 +10,7 @@ module Danger
10
10
 
11
11
  def check_format(files, additional_args = "")
12
12
  cmd = [@path] + files
13
- cmd << additional_args.split unless additional_args.empty?
13
+ cmd << additional_args.split unless additional_args.nil? || additional_args.empty?
14
14
  cmd << %w(--dryrun --verbose)
15
15
  output = Cmd.run(cmd.flatten)
16
16
  raise "error running swiftformat: empty output" if output.empty?
@@ -84,6 +84,21 @@ RSpec.describe Danger::SwiftFormat do
84
84
  expect { @sut.check_format(%w(.)) }.to raise_error("error running swiftformat: empty output")
85
85
  end
86
86
 
87
+ it "should support nil additional command line arguments" do
88
+ expect(@cmd).to receive(:run)
89
+ .with(%w(swiftformat . --dryrun --verbose))
90
+ .and_return(fixture("swiftformat_output.txt"))
91
+
92
+ output = {
93
+ errors: [],
94
+ stats: {
95
+ run_time: "0.08"
96
+ }
97
+ }
98
+
99
+ expect(@sut.check_format(%w(.), nil)).to eq(output)
100
+ end
101
+
87
102
  it "should support additional command line arguments" do
88
103
  expect(@cmd).to receive(:run)
89
104
  .with(%w(swiftformat . --self insert --indent tab --dryrun --verbose))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-swiftformat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vincent Garrigues
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-21 00:00:00.000000000 Z
11
+ date: 2018-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: danger-plugin-api