danger-ikr-xcode_summary 1.2.0 → 1.2.2
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: 2fea1f26e961928233244a8606f6ec205a71e10e4df71d83d5697063be0073a5
|
4
|
+
data.tar.gz: 18f57ca336ad96a7467243fbde6fb8a389f38600bc1326174a3ebb25e20ffd7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b53b28f8f102b2f9b33eb715cc1678d771147d0979145a66a7b2f7f7dec21b03e0fce741542ff3896f5ea3ccc873b645306be6da71f23a05e7d4f563e723de2
|
7
|
+
data.tar.gz: bd1032e3eb3f8018a9d616c00ce9f6d816e4fd3e1be3d9c463b94c29bf84230d095e32ab2b8e0eec2437f3dd4b19eb4129085e772732d5123fa7cd48e492851f
|
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_object
|
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_object
|
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
|
|