danger-xcode_summary 1.2.0 → 1.3.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 +4 -4
- data/.github/workflows/ruby.yml +38 -0
- data/.ruby-version +1 -0
- data/Gemfile.lock +69 -83
- data/README.md +18 -0
- data/danger-xcode_summary.gemspec +1 -1
- data/lib/xcode_summary/gem_version.rb +1 -1
- data/lib/xcode_summary/plugin.rb +82 -4
- data/spec/spec_helper.rb +0 -2
- data/spec/xcode_summary_spec.rb +68 -0
- metadata +10 -9
- data/.travis.yml +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba01bb92755852ab528ad3721b607d41ed61963d221d337a064fb8e54743871b
|
4
|
+
data.tar.gz: 7378e516f2a5c98751997ac1e1fbdb2305805ff8a7d3bc6485a98a53e6a0deda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d48beaddc39c86f9393d1f276d55ec9293b86abb3261f47d148dedf3c46b6a706cd98b1e1ee3f3a67ef6a01206d1d9e58c1ce23952e303809a331813f62dda4
|
7
|
+
data.tar.gz: ee27dafbd6f3915058dd04d0c5ec966ac0b6113fb61c4668e9c504a16a10eef0c418ce98ca10b8c3ff7e9f875ac25afec991eba54b984947c034f21127cc9d53
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: Ruby
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
branches: [ "master" ]
|
13
|
+
pull_request:
|
14
|
+
branches: [ "master" ]
|
15
|
+
|
16
|
+
permissions:
|
17
|
+
contents: read
|
18
|
+
|
19
|
+
jobs:
|
20
|
+
test:
|
21
|
+
|
22
|
+
runs-on: macos-latest
|
23
|
+
strategy:
|
24
|
+
matrix:
|
25
|
+
ruby-version: ['3.2.2']
|
26
|
+
|
27
|
+
steps:
|
28
|
+
- uses: actions/checkout@v3
|
29
|
+
- name: Set up Ruby
|
30
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
31
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
32
|
+
uses: ruby/setup-ruby@v1
|
33
|
+
# uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
|
34
|
+
with:
|
35
|
+
ruby-version: ${{ matrix.ruby-version }}
|
36
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
37
|
+
- name: Run tests
|
38
|
+
run: bundle exec rake spec
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.2.2
|
data/Gemfile.lock
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
danger-xcode_summary (1.
|
4
|
+
danger-xcode_summary (1.3.1)
|
5
5
|
danger-plugin-api (~> 1.0)
|
6
|
-
xcresult (~> 0.2)
|
6
|
+
xcresult (~> 0.2.2)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
addressable (2.8.
|
12
|
-
public_suffix (>= 2.0.2, <
|
11
|
+
addressable (2.8.7)
|
12
|
+
public_suffix (>= 2.0.2, < 7.0)
|
13
13
|
ast (2.4.2)
|
14
14
|
claide (1.1.0)
|
15
15
|
claide-plugins (0.9.2)
|
@@ -20,52 +20,34 @@ GEM
|
|
20
20
|
colored2 (3.1.2)
|
21
21
|
cork (0.3.0)
|
22
22
|
colored2 (~> 3.1)
|
23
|
-
danger (
|
23
|
+
danger (9.5.0)
|
24
24
|
claide (~> 1.0)
|
25
25
|
claide-plugins (>= 0.9.2)
|
26
26
|
colored2 (~> 3.1)
|
27
27
|
cork (~> 0.1)
|
28
|
-
faraday (>= 0.9.0, <
|
28
|
+
faraday (>= 0.9.0, < 3.0)
|
29
29
|
faraday-http-cache (~> 2.0)
|
30
|
-
git (~> 1.
|
30
|
+
git (~> 1.13)
|
31
31
|
kramdown (~> 2.3)
|
32
32
|
kramdown-parser-gfm (~> 1.0)
|
33
|
-
|
34
|
-
octokit (~> 4.7)
|
33
|
+
octokit (>= 4.0)
|
35
34
|
terminal-table (>= 1, < 4)
|
36
35
|
danger-plugin-api (1.0.0)
|
37
36
|
danger (> 2.0)
|
38
|
-
diff-lcs (1.5.
|
39
|
-
faraday (
|
40
|
-
faraday-
|
41
|
-
|
42
|
-
|
43
|
-
faraday-httpclient (~> 1.0)
|
44
|
-
faraday-multipart (~> 1.0)
|
45
|
-
faraday-net_http (~> 1.0)
|
46
|
-
faraday-net_http_persistent (~> 1.0)
|
47
|
-
faraday-patron (~> 1.0)
|
48
|
-
faraday-rack (~> 1.0)
|
49
|
-
faraday-retry (~> 1.0)
|
50
|
-
ruby2_keywords (>= 0.0.4)
|
51
|
-
faraday-em_http (1.0.0)
|
52
|
-
faraday-em_synchrony (1.0.0)
|
53
|
-
faraday-excon (1.1.0)
|
54
|
-
faraday-http-cache (2.2.0)
|
37
|
+
diff-lcs (1.5.1)
|
38
|
+
faraday (2.11.0)
|
39
|
+
faraday-net_http (>= 2.0, < 3.4)
|
40
|
+
logger
|
41
|
+
faraday-http-cache (2.5.1)
|
55
42
|
faraday (>= 0.8)
|
56
|
-
faraday-
|
57
|
-
|
58
|
-
|
59
|
-
faraday-net_http (1.0.1)
|
60
|
-
faraday-net_http_persistent (1.2.0)
|
61
|
-
faraday-patron (1.0.0)
|
62
|
-
faraday-rack (1.0.0)
|
63
|
-
faraday-retry (1.0.3)
|
64
|
-
ffi (1.15.5)
|
43
|
+
faraday-net_http (3.3.0)
|
44
|
+
net-http
|
45
|
+
ffi (1.17.0)
|
65
46
|
formatador (1.1.0)
|
66
|
-
git (1.
|
47
|
+
git (1.19.1)
|
48
|
+
addressable (~> 2.8)
|
67
49
|
rchardet (~> 1.8)
|
68
|
-
guard (2.18.
|
50
|
+
guard (2.18.1)
|
69
51
|
formatador (>= 0.2.4)
|
70
52
|
listen (>= 2.7, < 4.0)
|
71
53
|
lumberjack (>= 1.0.12, < 2.0)
|
@@ -79,79 +61,83 @@ GEM
|
|
79
61
|
guard (~> 2.1)
|
80
62
|
guard-compat (~> 1.1)
|
81
63
|
rspec (>= 2.99.0, < 4.0)
|
64
|
+
json (2.7.2)
|
82
65
|
kramdown (2.4.0)
|
83
66
|
rexml
|
84
67
|
kramdown-parser-gfm (1.1.0)
|
85
68
|
kramdown (~> 2.0)
|
86
|
-
|
69
|
+
language_server-protocol (3.17.0.3)
|
70
|
+
listen (3.9.0)
|
87
71
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
88
72
|
rb-inotify (~> 0.9, >= 0.9.10)
|
89
|
-
|
90
|
-
|
91
|
-
|
73
|
+
logger (1.6.1)
|
74
|
+
lumberjack (1.2.10)
|
75
|
+
method_source (1.1.0)
|
92
76
|
nap (1.1.0)
|
93
77
|
nenv (0.3.0)
|
94
|
-
|
78
|
+
net-http (0.4.1)
|
79
|
+
uri
|
95
80
|
notiffany (0.1.3)
|
96
81
|
nenv (~> 0.1)
|
97
82
|
shellany (~> 0.0)
|
98
|
-
octokit (
|
99
|
-
faraday (>=
|
100
|
-
sawyer (~> 0.
|
83
|
+
octokit (9.1.0)
|
84
|
+
faraday (>= 1, < 3)
|
85
|
+
sawyer (~> 0.9)
|
101
86
|
open4 (1.3.4)
|
102
|
-
parallel (1.
|
103
|
-
parser (3.
|
87
|
+
parallel (1.26.3)
|
88
|
+
parser (3.3.5.0)
|
104
89
|
ast (~> 2.4.1)
|
105
|
-
|
90
|
+
racc
|
91
|
+
pry (0.14.2)
|
106
92
|
coderay (~> 1.1)
|
107
93
|
method_source (~> 1.0)
|
108
|
-
public_suffix (
|
94
|
+
public_suffix (6.0.1)
|
95
|
+
racc (1.8.1)
|
109
96
|
rainbow (3.1.1)
|
110
|
-
rake (13.
|
111
|
-
rb-fsevent (0.11.
|
112
|
-
rb-inotify (0.
|
97
|
+
rake (13.2.1)
|
98
|
+
rb-fsevent (0.11.2)
|
99
|
+
rb-inotify (0.11.1)
|
113
100
|
ffi (~> 1.0)
|
114
101
|
rchardet (1.8.0)
|
115
|
-
regexp_parser (2.
|
116
|
-
rexml (3.
|
117
|
-
rspec (3.
|
118
|
-
rspec-core (~> 3.
|
119
|
-
rspec-expectations (~> 3.
|
120
|
-
rspec-mocks (~> 3.
|
121
|
-
rspec-core (3.
|
122
|
-
rspec-support (~> 3.
|
123
|
-
rspec-expectations (3.
|
102
|
+
regexp_parser (2.9.2)
|
103
|
+
rexml (3.3.7)
|
104
|
+
rspec (3.13.0)
|
105
|
+
rspec-core (~> 3.13.0)
|
106
|
+
rspec-expectations (~> 3.13.0)
|
107
|
+
rspec-mocks (~> 3.13.0)
|
108
|
+
rspec-core (3.13.1)
|
109
|
+
rspec-support (~> 3.13.0)
|
110
|
+
rspec-expectations (3.13.2)
|
124
111
|
diff-lcs (>= 1.2.0, < 2.0)
|
125
|
-
rspec-support (~> 3.
|
126
|
-
rspec-mocks (3.
|
112
|
+
rspec-support (~> 3.13.0)
|
113
|
+
rspec-mocks (3.13.1)
|
127
114
|
diff-lcs (>= 1.2.0, < 2.0)
|
128
|
-
rspec-support (~> 3.
|
129
|
-
rspec-support (3.
|
130
|
-
rubocop (1.
|
115
|
+
rspec-support (~> 3.13.0)
|
116
|
+
rspec-support (3.13.1)
|
117
|
+
rubocop (1.66.1)
|
118
|
+
json (~> 2.3)
|
119
|
+
language_server-protocol (>= 3.17.0)
|
131
120
|
parallel (~> 1.10)
|
132
|
-
parser (>= 3.
|
121
|
+
parser (>= 3.3.0.2)
|
133
122
|
rainbow (>= 2.2.2, < 4.0)
|
134
|
-
regexp_parser (>=
|
135
|
-
|
136
|
-
rubocop-ast (>= 1.17.0, < 2.0)
|
123
|
+
regexp_parser (>= 2.4, < 3.0)
|
124
|
+
rubocop-ast (>= 1.32.2, < 2.0)
|
137
125
|
ruby-progressbar (~> 1.7)
|
138
|
-
unicode-display_width (>=
|
139
|
-
rubocop-ast (1.
|
140
|
-
parser (>= 3.
|
141
|
-
ruby-progressbar (1.
|
142
|
-
|
143
|
-
sawyer (0.8.2)
|
126
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
127
|
+
rubocop-ast (1.32.2)
|
128
|
+
parser (>= 3.3.1.0)
|
129
|
+
ruby-progressbar (1.13.0)
|
130
|
+
sawyer (0.9.2)
|
144
131
|
addressable (>= 2.3.5)
|
145
|
-
faraday (
|
132
|
+
faraday (>= 0.17.3, < 3)
|
146
133
|
shellany (0.0.1)
|
147
134
|
terminal-table (3.0.2)
|
148
135
|
unicode-display_width (>= 1.1.1, < 3)
|
149
|
-
thor (1.2
|
150
|
-
unicode-display_width (2.
|
151
|
-
|
152
|
-
xcresult (0.2.
|
153
|
-
yard (0.9.
|
154
|
-
webrick (~> 1.7.0)
|
136
|
+
thor (1.3.2)
|
137
|
+
unicode-display_width (2.5.0)
|
138
|
+
uri (0.13.1)
|
139
|
+
xcresult (0.2.2)
|
140
|
+
yard (0.9.37)
|
155
141
|
|
156
142
|
PLATFORMS
|
157
143
|
ruby
|
data/README.md
CHANGED
@@ -56,6 +56,24 @@ A [Danger](http://danger.systems) plugin that shows all build errors, warnings a
|
|
56
56
|
</tbody>
|
57
57
|
</table>
|
58
58
|
|
59
|
+
<table>
|
60
|
+
<thead>
|
61
|
+
<tr>
|
62
|
+
<th width="50"></th>
|
63
|
+
<th width="100%">
|
64
|
+
1 Message
|
65
|
+
</th>
|
66
|
+
</tr>
|
67
|
+
</thead>
|
68
|
+
<tbody>
|
69
|
+
<tr>
|
70
|
+
<td><g-emoji alias="book" fallback-src="https://assets-cdn.github.com/images/icons/emoji/unicode/1f4d6.png">📖</g-emoji></td>
|
71
|
+
<td>TestTarget: Executed 5 tests, with 1 failure (0 unexpected) in 0.032 (0.065) seconds</td>
|
72
|
+
</tr>
|
73
|
+
</tr>
|
74
|
+
</tbody>
|
75
|
+
</table>
|
76
|
+
|
59
77
|
## Installation
|
60
78
|
|
61
79
|
Add this line to your Gemfile:
|
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
|
24
24
|
spec.required_ruby_version = ">= 2.4.0"
|
25
25
|
|
26
|
-
spec.add_dependency 'xcresult', '~> 0.2'
|
26
|
+
spec.add_dependency 'xcresult', '~> 0.2.2'
|
27
27
|
spec.add_runtime_dependency 'danger-plugin-api', '~> 1.0'
|
28
28
|
|
29
29
|
# General ruby development
|
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`.
|
@@ -39,10 +40,30 @@ module Danger
|
|
39
40
|
# A block that filters specific results.
|
40
41
|
# An example would be `lambda { |result| result.message.start_with?('ld') }` to ignore results for ld_warnings.
|
41
42
|
#
|
42
|
-
# @param [Block value
|
43
|
+
# @param [Block] value
|
43
44
|
# @return [Block]
|
44
45
|
attr_accessor :ignored_results
|
45
46
|
|
47
|
+
# Defines if the test summary will be sticky or not.
|
48
|
+
# Defaults to `false`.
|
49
|
+
# @param [Boolean] value
|
50
|
+
# @return [Boolean]
|
51
|
+
attr_accessor :sticky_summary
|
52
|
+
|
53
|
+
# Defines if the build summary is shown or not.
|
54
|
+
# Defaults to `true`.
|
55
|
+
# @param [Boolean] value
|
56
|
+
# @return [Boolean]
|
57
|
+
attr_accessor :test_summary
|
58
|
+
|
59
|
+
# A block that sorts the warning results.
|
60
|
+
# An example would be `lambda { |warning| warning.message.include?("deprecated") ? 1 : 0 }` to sort results for
|
61
|
+
# deprecated warnings.
|
62
|
+
#
|
63
|
+
# @param [Block] value
|
64
|
+
# @return [Block]
|
65
|
+
attr_accessor :sort_warnings_by
|
66
|
+
|
46
67
|
# Defines if using inline comment or not.
|
47
68
|
# Defaults to `false`.
|
48
69
|
# @param [Boolean] value
|
@@ -72,10 +93,22 @@ module Danger
|
|
72
93
|
[@ignored_files].flatten.compact
|
73
94
|
end
|
74
95
|
|
96
|
+
def sort_warnings_by(&block)
|
97
|
+
@sort_warnings_by ||= block
|
98
|
+
end
|
99
|
+
|
75
100
|
def ignored_results(&block)
|
76
101
|
@ignored_results ||= block
|
77
102
|
end
|
78
103
|
|
104
|
+
def sticky_summary
|
105
|
+
@sticky_summary || false
|
106
|
+
end
|
107
|
+
|
108
|
+
def test_summary
|
109
|
+
@test_summary.nil? ? true : @test_summary
|
110
|
+
end
|
111
|
+
|
79
112
|
def inline_mode
|
80
113
|
@inline_mode || false
|
81
114
|
end
|
@@ -134,13 +167,17 @@ module Danger
|
|
134
167
|
private
|
135
168
|
|
136
169
|
def format_summary(xcode_summary)
|
170
|
+
messages(xcode_summary).each { |s| message(s, sticky: sticky_summary) }
|
171
|
+
all_warnings = []
|
137
172
|
xcode_summary.actions_invocation_record.actions.each do |action|
|
138
173
|
warnings(action).each do |result|
|
174
|
+
warning_object = nil
|
139
175
|
if inline_mode && result.location
|
140
|
-
|
176
|
+
warning_object = Warning.new(result.message, false, result.location)
|
141
177
|
else
|
142
|
-
|
178
|
+
warning_object = Warning.new(result.message, false, nil)
|
143
179
|
end
|
180
|
+
all_warnings << warning_object
|
144
181
|
end
|
145
182
|
errors(action).each do |result|
|
146
183
|
if inline_mode && result.location
|
@@ -158,6 +195,45 @@ module Danger
|
|
158
195
|
end
|
159
196
|
end
|
160
197
|
end
|
198
|
+
sort_and_log_warnings(all_warnings)
|
199
|
+
end
|
200
|
+
|
201
|
+
def sort_and_log_warnings(all_warnings)
|
202
|
+
all_warnings = all_warnings.sort_by(&sort_warnings_by)
|
203
|
+
all_warnings.each do |warning|
|
204
|
+
if inline_mode && warning.location
|
205
|
+
warn(warning.message, sticky: warning.sticky, file: warning.location.file_path, line: warning.location.line)
|
206
|
+
else
|
207
|
+
warn(warning.message, sticky: warning.sticky)
|
208
|
+
end
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
def messages(xcode_summary)
|
213
|
+
if test_summary
|
214
|
+
test_messages = xcode_summary.action_test_plan_summaries.map do |test_plan_summaries|
|
215
|
+
test_plan_summaries.summaries.map do |summary|
|
216
|
+
summary.testable_summaries.map do |test_summary|
|
217
|
+
test_summary.tests.filter_map do |action_test_object|
|
218
|
+
if action_test_object.instance_of? XCResult::ActionTestSummaryGroup
|
219
|
+
subtests = action_test_object.all_subtests
|
220
|
+
subtests_duration = subtests.map(&:duration).sum
|
221
|
+
test_text_infix = subtests.count == 1 ? 'test' : 'tests'
|
222
|
+
failed_tests_count = subtests.reject { |test| test.test_status == 'Success' }.count
|
223
|
+
expected_failed_tests_count = subtests.select { |test| test.test_status == 'Expected Failure' }.count
|
224
|
+
|
225
|
+
"#{test_summary.target_name}: Executed #{subtests.count} #{test_text_infix}, " \
|
226
|
+
"with #{failed_tests_count} failures (#{expected_failed_tests_count} expected) in " \
|
227
|
+
"#{subtests_duration.round(3)} (#{action_test_object.duration.round(3)}) seconds"
|
228
|
+
end
|
229
|
+
end
|
230
|
+
end
|
231
|
+
end
|
232
|
+
end
|
233
|
+
test_messages.flatten.uniq.compact.map(&:strip)
|
234
|
+
else
|
235
|
+
[]
|
236
|
+
end
|
161
237
|
end
|
162
238
|
|
163
239
|
def warnings(action)
|
@@ -197,7 +273,7 @@ module Danger
|
|
197
273
|
end
|
198
274
|
|
199
275
|
def parse_location(document_location)
|
200
|
-
return nil if document_location.nil?
|
276
|
+
return nil if document_location&.url.nil?
|
201
277
|
|
202
278
|
file_path = document_location.url.gsub('file://', '').split('#').first
|
203
279
|
file_name = file_path.split('/').last
|
@@ -245,6 +321,8 @@ module Danger
|
|
245
321
|
end
|
246
322
|
|
247
323
|
def format_test_failure(result, producing_target, test_case_name)
|
324
|
+
return escape_reason(result.message) if result.location.nil?
|
325
|
+
|
248
326
|
path = result.location.file_path
|
249
327
|
path_link = format_path(path, result.location.line)
|
250
328
|
suite_name = "#{producing_target}.#{test_case_name}"
|
data/spec/spec_helper.rb
CHANGED
@@ -30,7 +30,6 @@ end
|
|
30
30
|
# it comes with an extra function `.string` which will
|
31
31
|
# strip all ANSI colours from the string.
|
32
32
|
|
33
|
-
# rubocop:disable Lint/NestedMethodDefinition
|
34
33
|
def testing_ui
|
35
34
|
@output = StringIO.new
|
36
35
|
def @output.winsize
|
@@ -43,7 +42,6 @@ def testing_ui
|
|
43
42
|
end
|
44
43
|
cork
|
45
44
|
end
|
46
|
-
# rubocop:enable Lint/NestedMethodDefinition
|
47
45
|
|
48
46
|
# Example environment (ENV) that would come from
|
49
47
|
# running a PR on TravisCI
|
data/spec/xcode_summary_spec.rb
CHANGED
@@ -23,6 +23,26 @@ module Danger
|
|
23
23
|
expect(@dangerfile.status_report[:errors]).to eq ['summary file not found']
|
24
24
|
end
|
25
25
|
|
26
|
+
describe 'summary' do
|
27
|
+
context 'enabled' do
|
28
|
+
it 'formats summary messages' do
|
29
|
+
@xcode_summary.test_summary = true
|
30
|
+
@xcode_summary.report('spec/fixtures/swiftlint.xcresult')
|
31
|
+
expect(@dangerfile.status_report[:messages]).to eq [
|
32
|
+
'SwiftLintFrameworkTests: Executed 540 tests, with 1 failures (0 expected) in 114.029 (27.922) seconds'
|
33
|
+
]
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
context 'disabled' do
|
38
|
+
it 'shows no summary messages' do
|
39
|
+
@xcode_summary.test_summary = false
|
40
|
+
@xcode_summary.report('spec/fixtures/swiftlint.xcresult')
|
41
|
+
expect(@dangerfile.status_report[:messages]).to eq []
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
26
46
|
context 'reporting' do
|
27
47
|
it 'formats compile warnings' do
|
28
48
|
@xcode_summary.report('spec/fixtures/swiftlint.xcresult')
|
@@ -189,6 +209,54 @@ module Danger
|
|
189
209
|
expect(result).to eq '{"warnings":21,"errors":3}'
|
190
210
|
end
|
191
211
|
end
|
212
|
+
|
213
|
+
context 'with sort_warnings_by' do
|
214
|
+
before do
|
215
|
+
@xcode_summary.sort_warnings_by do |warning|
|
216
|
+
warning.message.include?('TODOs') ? 0 : 1
|
217
|
+
end
|
218
|
+
end
|
219
|
+
it 'sorts compile warnings' do
|
220
|
+
@xcode_summary.report('spec/fixtures/swiftlint.xcresult')
|
221
|
+
expect(@dangerfile.status_report[:warnings]).to eq [
|
222
|
+
"**<a href='https://github.com/realm/SwiftLint/blob/f211694e7def13785ff62047386437534541d7b3/Carthage/Checkouts/Yams/Sources/Yams/Constructor.swift#L492'>Carthage/Checkouts/Yams/Sources/Yams/Constructor.swift#L492</a>**: Todo Violation: TODOs should be resolved (Should raise error if subnode ...). (todo)",
|
223
|
+
"**<a href='https://github.com/realm/SwiftLint/blob/f211694e7def13785ff62047386437534541d7b3/Carthage/Checkouts/Yams/Tests/YamsTests/SpecTests.swift#L379'>Carthage/Checkouts/Yams/Tests/YamsTests/SpecTests.swift#L379</a>**: Todo Violation: TODOs should be resolved (YAML supports keys other than ...). (todo)",
|
224
|
+
"**<a href='https://github.com/realm/SwiftLint/blob/f211694e7def13785ff62047386437534541d7b3/Carthage/Checkouts/Yams/Tests/YamsTests/SpecTests.swift#L714'>Carthage/Checkouts/Yams/Tests/YamsTests/SpecTests.swift#L714</a>**: Todo Violation: TODOs should be resolved (local tag parsing). (todo)",
|
225
|
+
"**<a href='https://github.com/realm/SwiftLint/blob/f211694e7def13785ff62047386437534541d7b3/Carthage/Checkouts/Yams/Sources/Yams/Representer.swift#L187'>Carthage/Checkouts/Yams/Sources/Yams/Representer.swift#L187</a>**: Todo Violation: TODOs should be resolved (Support `Float80`). (todo)",
|
226
|
+
"**<a href='https://github.com/realm/SwiftLint/blob/f211694e7def13785ff62047386437534541d7b3/Carthage/Checkouts/Yams/Sources/Yams/Constructor.swift#L405'>Carthage/Checkouts/Yams/Sources/Yams/Constructor.swift#L405</a>**: Todo Violation: TODOs should be resolved (YAML supports keys other than ...). (todo)",
|
227
|
+
"**<a href='https://github.com/realm/SwiftLint/blob/f211694e7def13785ff62047386437534541d7b3/Carthage/Checkouts/Yams/Sources/Yams/Constructor.swift#L430'>Carthage/Checkouts/Yams/Sources/Yams/Constructor.swift#L430</a>**: Todo Violation: TODOs should be resolved (Should raise error on other th...). (todo)",
|
228
|
+
"**<a href='https://github.com/realm/SwiftLint/blob/f211694e7def13785ff62047386437534541d7b3/Carthage/Checkouts/Yams/Sources/Yams/Constructor.swift#L450'>Carthage/Checkouts/Yams/Sources/Yams/Constructor.swift#L450</a>**: Todo Violation: TODOs should be resolved (YAML supports Hashable element...). (todo)",
|
229
|
+
"**<a href='https://github.com/realm/SwiftLint/blob/f211694e7def13785ff62047386437534541d7b3/Carthage/Checkouts/Yams/Sources/Yams/Constructor.swift#L478'>Carthage/Checkouts/Yams/Sources/Yams/Constructor.swift#L478</a>**: Todo Violation: TODOs should be resolved (Should raise error if subnode ...). (todo)",
|
230
|
+
"**<a href='https://github.com/realm/SwiftLint/blob/f211694e7def13785ff62047386437534541d7b3/Carthage/Checkouts/Yams/Sources/Yams/Emitter.swift#L340'>Carthage/Checkouts/Yams/Sources/Yams/Emitter.swift#L340</a>**: Todo Violation: TODOs should be resolved (Support tags). (todo)",
|
231
|
+
"**<a href='https://github.com/realm/SwiftLint/blob/f211694e7def13785ff62047386437534541d7b3/Carthage/Checkouts/SWXMLHash/Source/XMLIndexer+XMLIndexerDeserializable.swift#L538'>Carthage/Checkouts/SWXMLHash/Source/XMLIndexer+XMLIndexerDeserializable.swift#L538</a>**: 'public' modifier is redundant for instance method declared in a public extension",
|
232
|
+
"**<a href='https://github.com/realm/SwiftLint/blob/f211694e7def13785ff62047386437534541d7b3/Carthage/Checkouts/SWXMLHash/Source/XMLIndexer+XMLIndexerDeserializable.swift#L552'>Carthage/Checkouts/SWXMLHash/Source/XMLIndexer+XMLIndexerDeserializable.swift#L552</a>**: 'public' modifier is redundant for instance method declared in a public extension",
|
233
|
+
"**<a href='https://github.com/realm/SwiftLint/blob/f211694e7def13785ff62047386437534541d7b3/Carthage/Checkouts/Yams/Sources/Yams/Tag.swift#L88'>Carthage/Checkouts/Yams/Sources/Yams/Tag.swift#L88</a>**: Legacy Hashing Violation: Prefer using the `hash(into:)` function instead of overriding `hashValue` (legacy_hashing)",
|
234
|
+
"**<a href='https://github.com/realm/SwiftLint/blob/f211694e7def13785ff62047386437534541d7b3/Carthage/Checkouts/Result/Result/NoError.swift#L8'>Carthage/Checkouts/Result/Result/NoError.swift#L8</a>**: Will never be executed",
|
235
|
+
"**<a href='https://github.com/realm/SwiftLint/blob/f211694e7def13785ff62047386437534541d7b3/Carthage/Checkouts/Yams/Sources/Yams/Tag.swift#L109'>Carthage/Checkouts/Yams/Sources/Yams/Tag.swift#L109</a>**: Legacy Hashing Violation: Prefer using the `hash(into:)` function instead of overriding `hashValue` (legacy_hashing)",
|
236
|
+
"**<a href='https://github.com/realm/SwiftLint/blob/f211694e7def13785ff62047386437534541d7b3/Carthage/Checkouts/Yams/Sources/Yams/Decoder.swift#L102'>Carthage/Checkouts/Yams/Sources/Yams/Decoder.swift#L102</a>**: Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon)",
|
237
|
+
"**<a href='https://github.com/realm/SwiftLint/blob/f211694e7def13785ff62047386437534541d7b3/Carthage/Checkouts/Yams/Sources/Yams/Node.swift#L191'>Carthage/Checkouts/Yams/Sources/Yams/Node.swift#L191</a>**: Legacy Hashing Violation: Prefer using the `hash(into:)` function instead of overriding `hashValue` (legacy_hashing)",
|
238
|
+
"**<a href='https://github.com/realm/SwiftLint/blob/f211694e7def13785ff62047386437534541d7b3/Carthage/Checkouts/Yams/Sources/Yams/Encoder.swift#L139'>Carthage/Checkouts/Yams/Sources/Yams/Encoder.swift#L139</a>**: Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon)",
|
239
|
+
"**<a href='https://github.com/realm/SwiftLint/blob/f211694e7def13785ff62047386437534541d7b3/Carthage/Checkouts/Yams/Sources/Yams/Parser.swift#L441'>Carthage/Checkouts/Yams/Sources/Yams/Parser.swift#L441</a>**: File Line Length Violation: File should contain 400 lines or less: currently contains 441 (file_length)",
|
240
|
+
"**<a href='https://github.com/realm/SwiftLint/blob/f211694e7def13785ff62047386437534541d7b3/Carthage/Checkouts/Yams/Tests/YamsTests/EncoderTests.swift#L924'>Carthage/Checkouts/Yams/Tests/YamsTests/EncoderTests.swift#L924</a>**: Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon)",
|
241
|
+
"**<a href='https://github.com/realm/SwiftLint/blob/f211694e7def13785ff62047386437534541d7b3/Carthage/Checkouts/Yams/Tests/YamsTests/EncoderTests.swift#L937'>Carthage/Checkouts/Yams/Tests/YamsTests/EncoderTests.swift#L937</a>**: Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon)",
|
242
|
+
"**<a href='https://github.com/realm/SwiftLint/blob/f211694e7def13785ff62047386437534541d7b3/Carthage/Checkouts/Yams/Tests/YamsTests/EncoderTests.swift#L253'>Carthage/Checkouts/Yams/Tests/YamsTests/EncoderTests.swift#L253</a>**: Superfluous Disable Command Violation: 'unused_private_declaration' is not a valid SwiftLint rule. Please remove it from the disable command. (superfluous_disable_command)"
|
243
|
+
]
|
244
|
+
end
|
245
|
+
|
246
|
+
it 'formats errors' do
|
247
|
+
@xcode_summary.report('spec/fixtures/build_error.xcresult')
|
248
|
+
expect(@dangerfile.status_report[:errors]).to eq [
|
249
|
+
'Testing cancelled because the build failed.',
|
250
|
+
"**<a href='https://github.com/realm/SwiftLint/blob/f211694e7def13785ff62047386437534541d7b3/Source/SwiftLintFramework/Extensions/QueuedPrint.swift#L13'>Source/SwiftLintFramework/Extensions/QueuedPrint.swift#L13</a>**: Use of unresolved identifier 'queue'",
|
251
|
+
"**<a href='https://github.com/realm/SwiftLint/blob/f211694e7def13785ff62047386437534541d7b3/Source/SwiftLintFramework/Extensions/QueuedPrint.swift#L17'>Source/SwiftLintFramework/Extensions/QueuedPrint.swift#L17</a>**: Use of unresolved identifier 'queue'"
|
252
|
+
]
|
253
|
+
end
|
254
|
+
|
255
|
+
it 'report warning and error counts' do
|
256
|
+
result = @xcode_summary.warning_error_count('spec/fixtures/build_error.xcresult')
|
257
|
+
expect(result).to eq '{"warnings":21,"errors":3}'
|
258
|
+
end
|
259
|
+
end
|
192
260
|
end
|
193
261
|
end
|
194
262
|
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger-xcode_summary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Diogo Tridapalli
|
8
8
|
- Marcelo Fabri
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-09-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: xcresult
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: 0.2.2
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: 0.2.2
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: danger-plugin-api
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -146,9 +146,10 @@ extensions: []
|
|
146
146
|
extra_rdoc_files: []
|
147
147
|
files:
|
148
148
|
- ".gitattributes"
|
149
|
+
- ".github/workflows/ruby.yml"
|
149
150
|
- ".gitignore"
|
150
151
|
- ".rubocop.yml"
|
151
|
-
- ".
|
152
|
+
- ".ruby-version"
|
152
153
|
- Gemfile
|
153
154
|
- Gemfile.lock
|
154
155
|
- Guardfile
|
@@ -296,7 +297,7 @@ homepage: https://github.com/diogot/danger-xcode_summary
|
|
296
297
|
licenses:
|
297
298
|
- MIT
|
298
299
|
metadata: {}
|
299
|
-
post_install_message:
|
300
|
+
post_install_message:
|
300
301
|
rdoc_options: []
|
301
302
|
require_paths:
|
302
303
|
- lib
|
@@ -311,8 +312,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
311
312
|
- !ruby/object:Gem::Version
|
312
313
|
version: '0'
|
313
314
|
requirements: []
|
314
|
-
rubygems_version: 3.
|
315
|
-
signing_key:
|
315
|
+
rubygems_version: 3.4.10
|
316
|
+
signing_key:
|
316
317
|
specification_version: 4
|
317
318
|
summary: A [Danger](http://danger.systems) plugin that shows all build errors, warnings
|
318
319
|
and unit tests results generated from `xcodebuild`.
|
data/.travis.yml
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
cache:
|
3
|
-
directories:
|
4
|
-
- bundle
|
5
|
-
|
6
|
-
os: osx
|
7
|
-
osx_image: xcode11
|
8
|
-
|
9
|
-
rvm:
|
10
|
-
- 2.6.0
|
11
|
-
- 2.5.3
|
12
|
-
|
13
|
-
# install bundler 2.x
|
14
|
-
before_install:
|
15
|
-
- gem update --system
|
16
|
-
- gem install bundler
|
17
|
-
|
18
|
-
script:
|
19
|
-
- bundle exec rake spec
|