danger-ikr-xcode_summary 1.2.0 → 1.2.1

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: 41a577e0180e6da6dfda10ba73ad60a971d8b057962652a30a80459781addb9d
4
- data.tar.gz: b9733b8146591866849264d3dae64bd2329d5b079e4a0e68501e375a6d38fc3f
3
+ metadata.gz: 3cc3ecc5ea097f3d69852d4021d86e26c31c52f4a1f72437969addf8471c8e3f
4
+ data.tar.gz: a35b8f014bc3f719b0622e163e0ab79135483da613c506a1adabe1d9f0ff19fe
5
5
  SHA512:
6
- metadata.gz: b11d9e601b7437f02bc8718a06ea158437c99d7de1db838394f431527f77609cf6f1430d668a68f78d4c7630c2c22a98f23bb7d40a07eb76ebf994c1a270ac37
7
- data.tar.gz: cc1131f3bad8a88ff3257757fbaf750b3169c2b224001de2021e31f92ef9e37caeb96058e77f99e10174395568fd52362e56d8bfa24a8e226ab7670f86873130
6
+ metadata.gz: b8d47628e652b0ad1d2513cccd57f02e573c17b8213226f1a88937f6c12c5ab04dfa0ba4a97616f088c562d1b8ea2a2ecc975d6d25694013ff800e7c98965664
7
+ data.tar.gz: 11d4717315c848aca0042f9c09762c45cc8b31cd2c0b0e33015524add362f301a35cd415f3b5021480c8045e53deee2727da766ffb88141e34f16722fef32600
@@ -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.1'
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
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
 
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.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diogo Tridapalli