danger-apple_swift_format 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Dangerfile +1 -1
- data/Gemfile.lock +1 -1
- data/lib/swift_format/gem_version.rb +1 -1
- data/lib/swift_format/plugin.rb +12 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f075411a9894c1cf228b475effd8a2a2985960336244826f417f8de5b4b54d56
|
4
|
+
data.tar.gz: 7b4d4a58170fbb90b330c0ece2142873952294c45c3337c7ac9e9c47921b3e28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a024a85dc4c2b1f65d0c28f714d2d525146063460598c6194233d7869243637767f0fdc277d2caa4ee79082e1ca5af120efeb05ce6b3f737d9d8f9dd8bff0ac
|
7
|
+
data.tar.gz: 7a6858fc4e3e24e078576751a488004da93b14c8bbc3e90e7ba59892f47d898c443e6de323ab04aced26afa5b27d8156c5afd00bbfd31c51426d56fb13e528ca
|
data/Dangerfile
CHANGED
data/Gemfile.lock
CHANGED
data/lib/swift_format/plugin.rb
CHANGED
@@ -29,7 +29,10 @@ module Danger
|
|
29
29
|
# @return [Array<String>]
|
30
30
|
#
|
31
31
|
def lint(files)
|
32
|
-
|
32
|
+
target = target_file(files)
|
33
|
+
return if target.empty?
|
34
|
+
|
35
|
+
o, e, s = Open3.capture3("#{binary_path} lint -r --configuration #{configuration} #{target}")
|
33
36
|
return if e == ''
|
34
37
|
warn e
|
35
38
|
end
|
@@ -40,7 +43,11 @@ module Danger
|
|
40
43
|
def format(files, in_place = false)
|
41
44
|
in_place_option = "-i"
|
42
45
|
in_place_option = '' if !in_place
|
43
|
-
|
46
|
+
|
47
|
+
target = target_file(files)
|
48
|
+
return if target.empty?
|
49
|
+
|
50
|
+
o, e, s = Open3.capture3("#{binary_path} format -r #{in_place_option} --configuration #{configuration} #{target}")
|
44
51
|
return if e == ''
|
45
52
|
warn e
|
46
53
|
end
|
@@ -48,10 +55,10 @@ module Danger
|
|
48
55
|
def target_file(files)
|
49
56
|
target_files = []
|
50
57
|
|
51
|
-
if files.instance_of?(
|
52
|
-
target_files = files
|
53
|
-
elsif files.instance_of?(String)
|
58
|
+
if files.instance_of?(String)
|
54
59
|
target_files = files.split(' ')
|
60
|
+
else
|
61
|
+
target_files = files
|
55
62
|
end
|
56
63
|
|
57
64
|
target_files.select { |f| f.include? '.swift' } .join(' ')
|