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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 41a577e0180e6da6dfda10ba73ad60a971d8b057962652a30a80459781addb9d
4
- data.tar.gz: b9733b8146591866849264d3dae64bd2329d5b079e4a0e68501e375a6d38fc3f
3
+ metadata.gz: 2fea1f26e961928233244a8606f6ec205a71e10e4df71d83d5697063be0073a5
4
+ data.tar.gz: 18f57ca336ad96a7467243fbde6fb8a389f38600bc1326174a3ebb25e20ffd7b
5
5
  SHA512:
6
- metadata.gz: b11d9e601b7437f02bc8718a06ea158437c99d7de1db838394f431527f77609cf6f1430d668a68f78d4c7630c2c22a98f23bb7d40a07eb76ebf994c1a270ac37
7
- data.tar.gz: cc1131f3bad8a88ff3257757fbaf750b3169c2b224001de2021e31f92ef9e37caeb96058e77f99e10174395568fd52362e56d8bfa24a8e226ab7670f86873130
6
+ metadata.gz: 1b53b28f8f102b2f9b33eb715cc1678d771147d0979145a66a7b2f7f7dec21b03e0fce741542ff3896f5ea3ccc873b645306be6da71f23a05e7d4f563e723de2
7
+ data.tar.gz: bd1032e3eb3f8018a9d616c00ce9f6d816e4fd3e1be3d9c463b94c29bf84230d095e32ab2b8e0eec2437f3dd4b19eb4129085e772732d5123fa7cd48e492851f
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module XcodeSummary
4
- VERSION = '1.2.0'
4
+ VERSION = '1.2.2'
5
5
  end
@@ -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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-ikr-xcode_summary
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diogo Tridapalli