danger-apple_swift_format 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f075411a9894c1cf228b475effd8a2a2985960336244826f417f8de5b4b54d56
4
- data.tar.gz: 7b4d4a58170fbb90b330c0ece2142873952294c45c3337c7ac9e9c47921b3e28
3
+ metadata.gz: 0d9866693ffef34aaa5aa15cf8120536b709c05dc03e1474181dbbaeba832935
4
+ data.tar.gz: 6cfc1eae862197407afb47d5c9723307b091124f494865c2a92454ca42a55aa9
5
5
  SHA512:
6
- metadata.gz: 1a024a85dc4c2b1f65d0c28f714d2d525146063460598c6194233d7869243637767f0fdc277d2caa4ee79082e1ca5af120efeb05ce6b3f737d9d8f9dd8bff0ac
7
- data.tar.gz: 7a6858fc4e3e24e078576751a488004da93b14c8bbc3e90e7ba59892f47d898c443e6de323ab04aced26afa5b27d8156c5afd00bbfd31c51426d56fb13e528ca
6
+ metadata.gz: 548ba2163a772b7c2e5587f9c85b6f5dee71e1f08026cc673c209b5d47069b41c9942fd3fb1d61b00d38b09a7262c5d16f58d87038a575310f29b53116828766
7
+ data.tar.gz: ba523a13f515ae46a20febd2e050614d2eb93d969388b331cb8dd7274c68a12f49f19af8d6aa53b51301beafad915b2bd23bde9133ff8b8c929d8de8b57a54da
@@ -0,0 +1 @@
1
+ 2.6.6
data/Dangerfile CHANGED
@@ -1,3 +1,4 @@
1
1
  swift_format.binary_path = ".build/x86_64-apple-macosx/release/swift-format"
2
2
  swift_format.configuration = "swift-format.json"
3
3
  swift_format.lint(["example/example.swift", "Dangerfile"])
4
+ swift_format.format(["example/example.swift", "Dangerfile"])
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- danger-apple_swift_format (0.0.4)
4
+ danger-apple_swift_format (0.0.5)
5
5
  danger-plugin-api (~> 1.0)
6
6
 
7
7
  GEM
@@ -1,3 +1,3 @@
1
1
  module SwiftFormat
2
- VERSION = "0.0.4".freeze
2
+ VERSION = "0.0.5".freeze
3
3
  end
@@ -40,16 +40,14 @@ module Danger
40
40
  # run swift-format format
41
41
  # @return [Array<String>]
42
42
  #
43
- def format(files, in_place = false)
44
- in_place_option = "-i"
45
- in_place_option = '' if !in_place
46
-
43
+ def format(files)
47
44
  target = target_file(files)
48
45
  return if target.empty?
49
46
 
50
- o, e, s = Open3.capture3("#{binary_path} format -r #{in_place_option} --configuration #{configuration} #{target}")
51
- return if e == ''
52
- warn e
47
+ `#{binary_path} format -r -i --configuration #{configuration} #{target}`
48
+ o, e, s = Open3.capture3("git diff #{target}")
49
+ return if o == ''
50
+ warn o
53
51
  end
54
52
 
55
53
  def target_file(files)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-apple_swift_format
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - kaito watanabe
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-14 00:00:00.000000000 Z
11
+ date: 2020-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: danger-plugin-api
@@ -159,6 +159,7 @@ extra_rdoc_files: []
159
159
  files:
160
160
  - ".gitignore"
161
161
  - ".rubocop.yml"
162
+ - ".ruby-version"
162
163
  - ".travis.yml"
163
164
  - Dangerfile
164
165
  - Gemfile
@@ -182,7 +183,7 @@ homepage: https://github.com/marumemomo/danger-swift_format
182
183
  licenses:
183
184
  - MIT
184
185
  metadata: {}
185
- post_install_message:
186
+ post_install_message:
186
187
  rdoc_options: []
187
188
  require_paths:
188
189
  - lib
@@ -198,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
198
199
  version: '0'
199
200
  requirements: []
200
201
  rubygems_version: 3.0.3
201
- signing_key:
202
+ signing_key:
202
203
  specification_version: 4
203
204
  summary: danger plugin for apple/swift-format.
204
205
  test_files: