danger-ikr-xcode_summary 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xcode_summary/gem_version.rb +1 -1
- data/lib/xcode_summary/plugin.rb +24 -10
- 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: 3cc3ecc5ea097f3d69852d4021d86e26c31c52f4a1f72437969addf8471c8e3f
|
4
|
+
data.tar.gz: a35b8f014bc3f719b0622e163e0ab79135483da613c506a1adabe1d9f0ff19fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8d47628e652b0ad1d2513cccd57f02e573c17b8213226f1a88937f6c12c5ab04dfa0ba4a97616f088c562d1b8ea2a2ecc975d6d25694013ff800e7c98965664
|
7
|
+
data.tar.gz: 11d4717315c848aca0042f9c09762c45cc8b31cd2c0b0e33015524add362f301a35cd415f3b5021480c8045e53deee2727da766ffb88141e34f16722fef32600
|
data/lib/xcode_summary/plugin.rb
CHANGED
@@ -21,6 +21,7 @@ module Danger
|
|
21
21
|
class DangerXcodeSummary < Plugin
|
22
22
|
Location = Struct.new(:file_name, :file_path, :line)
|
23
23
|
Result = Struct.new(:message, :location)
|
24
|
+
Warning = Struct.new(:message, :sticky, :location)
|
24
25
|
|
25
26
|
# The project root, which will be used to make the paths relative.
|
26
27
|
# Defaults to `pwd`.
|
@@ -134,12 +135,18 @@ module Danger
|
|
134
135
|
private
|
135
136
|
|
136
137
|
def format_summary(xcode_summary)
|
138
|
+
# Warning = Struct.new(:message, :sticky, :location)
|
139
|
+
all_warnings = []
|
137
140
|
xcode_summary.actions_invocation_record.actions.each do |action|
|
138
141
|
warnings(action).each do |result|
|
139
142
|
if inline_mode && result.location
|
140
|
-
warn(result.message, sticky: false, file: result.location.file_path, line: result.location.line)
|
143
|
+
# warn(result.message, sticky: false, file: result.location.file_path, line: result.location.line)
|
144
|
+
warning_object = Warning.new(result.message, false, result.location)
|
145
|
+
all_warnings << warning
|
141
146
|
else
|
142
|
-
warn(result.message, sticky: false)
|
147
|
+
# warn(result.message, sticky: false)
|
148
|
+
warning_object = Warning.new(result.message, false, nil)
|
149
|
+
all_warnings << warning
|
143
150
|
end
|
144
151
|
end
|
145
152
|
errors(action).each do |result|
|
@@ -158,6 +165,21 @@ module Danger
|
|
158
165
|
end
|
159
166
|
end
|
160
167
|
end
|
168
|
+
all_warnings = all_warnings.sort_by do |warning|
|
169
|
+
if warning.message.include?("is deprecated:")
|
170
|
+
1
|
171
|
+
else
|
172
|
+
0
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
all_warnings.each do |warning|
|
177
|
+
if inline_mode && warning.location
|
178
|
+
warn(warning.message, sticky: warning.sticky, file: warning.location.file_path, line: warning.location.line)
|
179
|
+
else
|
180
|
+
warn(result.message, sticky: warning.sticky)
|
181
|
+
end
|
182
|
+
end
|
161
183
|
end
|
162
184
|
|
163
185
|
def warnings(action)
|
@@ -171,14 +193,6 @@ module Danger
|
|
171
193
|
Result.new(format_warning(result), result.location)
|
172
194
|
end
|
173
195
|
warnings = warnings.uniq.reject { |result| result.message.nil? }
|
174
|
-
warnings = warnings.uniq.reject { |result| result.message.nil? }
|
175
|
-
warnings = warnings.sort_by do |result|
|
176
|
-
if result.message.include?("is deprecated:")
|
177
|
-
1
|
178
|
-
else
|
179
|
-
0
|
180
|
-
end
|
181
|
-
end
|
182
196
|
warnings.delete_if(&ignored_results)
|
183
197
|
end
|
184
198
|
|