danger-swiftformat 0.3.6 → 0.4.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
  SHA256:
3
- metadata.gz: c019348c6586dcccab4aabbff014fa92dec4df2f565d26e74a96f9367bfe7811
4
- data.tar.gz: 6050777f756457b86ee678234ce240c6c2384b56bb6274f3ba16e114b38f17b2
3
+ metadata.gz: 1e4ff2c06c4f47af744f1ecc4900ec266670fd93c20180b0aedd39a808f3c54c
4
+ data.tar.gz: 96433fecb5ba65121988850db61de14cd990d30f05146764e918766e006b7daf
5
5
  SHA512:
6
- metadata.gz: 224c878701f4aacb85f89c6cc91bb8212b8bd1abe415afa20cb4a044b4f41d55f0a8d556a363ed05b5177b9ed1244f0fbad7d8c8b42ed7fcdc45a07d53cf12fe
7
- data.tar.gz: 25e5e1b98d1c1aac2a275ea038a75317e0383c72c009259c89e0f45c573f8c0a95f83004c9982bdffea5de2b1f2abeaddfb0dab402c426988b517e07c5eeee1f
6
+ metadata.gz: '093e955e3ad8c198b162e557746ab18fc572ef5d99f856d0c054db05d402a1e4f1b48d3c4f6c39b5cc88d30fdc4e4fd05cefc3cd3bd64339c06a3146546aee28'
7
+ data.tar.gz: 29b8270dcc22adbd1e84c2dd128c0f5c5c4f60bd52349480cc8896087edfbc3abd1a9c0c7ad52b2a6571c5e863a3831e3b8ad4b1363410f3d448c12c5c66122b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- danger-swiftformat (0.3.6)
4
+ danger-swiftformat (0.4.0)
5
5
  danger-plugin-api (~> 1.0)
6
6
 
7
7
  GEM
@@ -19,7 +19,7 @@ GEM
19
19
  colored2 (3.1.2)
20
20
  cork (0.3.0)
21
21
  colored2 (~> 3.1)
22
- danger (5.6.6)
22
+ danger (5.11.0)
23
23
  claide (~> 1.0)
24
24
  claide-plugins (>= 0.9.2)
25
25
  colored2 (~> 3.1)
@@ -34,7 +34,7 @@ GEM
34
34
  danger-plugin-api (1.0.0)
35
35
  danger (> 2.0)
36
36
  diff-lcs (1.3)
37
- faraday (0.15.2)
37
+ faraday (0.15.4)
38
38
  multipart-post (>= 1.2, < 3)
39
39
  faraday-http-cache (1.3.1)
40
40
  faraday (~> 0.8)
@@ -70,7 +70,7 @@ GEM
70
70
  notiffany (0.1.1)
71
71
  nenv (~> 0.1)
72
72
  shellany (~> 0.0)
73
- octokit (4.12.0)
73
+ octokit (4.13.0)
74
74
  sawyer (~> 0.8.0, >= 0.5.3)
75
75
  open4 (1.3.4)
76
76
  parallel (1.12.1)
@@ -135,4 +135,4 @@ DEPENDENCIES
135
135
  yard (~> 0.9)
136
136
 
137
137
  BUNDLED WITH
138
- 1.16.4
138
+ 1.17.2
@@ -4,9 +4,7 @@ require "shellwords"
4
4
  module Danger
5
5
  class Cmd
6
6
  def self.run(cmd)
7
- stdout, _stderr, _status = Open3.capture3(cmd.shelljoin)
8
-
9
- stdout.strip.no_color
7
+ Open3.capture3(cmd.shelljoin)
10
8
  end
11
9
  end
12
10
  end
@@ -1,3 +1,3 @@
1
1
  module Swiftformat
2
- VERSION = "0.3.6".freeze
2
+ VERSION = "0.4.0".freeze
3
3
  end
@@ -14,8 +14,18 @@ module Danger
14
14
  cmd = [@path] + files
15
15
  cmd << additional_args.split unless additional_args.nil? || additional_args.empty?
16
16
  cmd << %w(--dryrun --verbose)
17
- output = Cmd.run(cmd.flatten)
18
- raise "error running swiftformat: empty output" if output.empty?
17
+ stdout, stderr, status = Cmd.run(cmd.flatten)
18
+
19
+ output = stdout.empty? ? stderr : stdout
20
+ raise "Error running SwiftFormat: Empty output." unless output
21
+
22
+ output = output.strip.no_color
23
+
24
+ if status && !status.success?
25
+ raise "Error running SwiftFormat:\nError: #{output}"
26
+ else
27
+ raise "Error running SwiftFormat: Empty output." if output.empty?
28
+ end
19
29
 
20
30
  process(output)
21
31
  end
@@ -81,7 +81,7 @@ RSpec.describe Danger::SwiftFormat do
81
81
  .with(%w(swiftformat . --dryrun --verbose))
82
82
  .and_return("")
83
83
 
84
- expect { @sut.check_format(%w(.)) }.to raise_error("error running swiftformat: empty output")
84
+ expect { @sut.check_format(%w(.)) }.to raise_error("Error running SwiftFormat: Empty output.")
85
85
  end
86
86
 
87
87
  it "should support nil additional command line arguments" do
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.3.6
4
+ version: 0.4.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: 2018-09-12 00:00:00.000000000 Z
11
+ date: 2019-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: danger-plugin-api
@@ -198,8 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
198
198
  - !ruby/object:Gem::Version
199
199
  version: '0'
200
200
  requirements: []
201
- rubyforge_project:
202
- rubygems_version: 2.7.6
201
+ rubygems_version: 3.0.1
203
202
  signing_key:
204
203
  specification_version: 4
205
204
  summary: A danger plugin for checking Swift formatting using SwiftFormat.