danger-xcode_summary 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +4 -2
- data/Gemfile.lock +49 -46
- data/README.md +3 -2
- data/lib/danger_plugin.rb +2 -0
- data/lib/danger_xcode_summary.rb +2 -0
- data/lib/xcode_summary/gem_version.rb +3 -1
- data/lib/xcode_summary/plugin.rb +29 -25
- data/spec/spec_helper.rb +3 -1
- data/spec/xcode_summary_spec.rb +7 -7
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 89600e0789c2dd26170e4ab907793de5e37da32a506eb70bda0f14c4e10593ac
|
4
|
+
data.tar.gz: 2655f9dc02e6732c4192d32a1322c635ddaed46937fa6909810d65388bf48bc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d58b82c99a313222e7e47035b2d7c1abcd51e8fdd7665816e52bd4e71892469df127992d0b0993ce82ea88432fdaa0db00e1d89926e9e6d3e341d728d78da0c3
|
7
|
+
data.tar.gz: 1bcb75db59e3c41adeb88fb868ee667cc7184ea127d9cfc59f41f57c3bacc5f725f00efbe36d6349354d48d02d97c0df9225d73c172dec19e78dc869a8d4ad8c
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
danger-xcode_summary (0.5.
|
4
|
+
danger-xcode_summary (0.5.1)
|
5
5
|
danger-plugin-api (~> 1.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
addressable (2.
|
10
|
+
addressable (2.6.0)
|
11
11
|
public_suffix (>= 2.0.2, < 4.0)
|
12
12
|
ast (2.4.0)
|
13
13
|
claide (1.0.2)
|
@@ -19,29 +19,30 @@ GEM
|
|
19
19
|
colored2 (3.1.2)
|
20
20
|
cork (0.3.0)
|
21
21
|
colored2 (~> 3.1)
|
22
|
-
danger (
|
22
|
+
danger (6.0.9)
|
23
23
|
claide (~> 1.0)
|
24
24
|
claide-plugins (>= 0.9.2)
|
25
25
|
colored2 (~> 3.1)
|
26
26
|
cork (~> 0.1)
|
27
27
|
faraday (~> 0.9)
|
28
|
-
faraday-http-cache (~>
|
29
|
-
git (~> 1)
|
30
|
-
kramdown (~>
|
28
|
+
faraday-http-cache (~> 2.0)
|
29
|
+
git (~> 1.5)
|
30
|
+
kramdown (~> 2.0)
|
31
|
+
kramdown-parser-gfm (~> 1.0)
|
31
32
|
no_proxy_fix
|
32
33
|
octokit (~> 4.7)
|
33
34
|
terminal-table (~> 1)
|
34
35
|
danger-plugin-api (1.0.0)
|
35
36
|
danger (> 2.0)
|
36
37
|
diff-lcs (1.3)
|
37
|
-
faraday (0.
|
38
|
+
faraday (0.15.4)
|
38
39
|
multipart-post (>= 1.2, < 3)
|
39
|
-
faraday-http-cache (
|
40
|
+
faraday-http-cache (2.0.0)
|
40
41
|
faraday (~> 0.8)
|
41
|
-
ffi (1.
|
42
|
+
ffi (1.11.1)
|
42
43
|
formatador (0.2.5)
|
43
|
-
git (1.
|
44
|
-
guard (2.
|
44
|
+
git (1.5.0)
|
45
|
+
guard (2.15.0)
|
45
46
|
formatador (>= 0.2.4)
|
46
47
|
listen (>= 2.7, < 4.0)
|
47
48
|
lumberjack (>= 1.0.12, < 2.0)
|
@@ -55,65 +56,67 @@ GEM
|
|
55
56
|
guard (~> 2.1)
|
56
57
|
guard-compat (~> 1.1)
|
57
58
|
rspec (>= 2.99.0, < 4.0)
|
58
|
-
|
59
|
+
jaro_winkler (1.5.3)
|
60
|
+
kramdown (2.1.0)
|
61
|
+
kramdown-parser-gfm (1.1.0)
|
62
|
+
kramdown (~> 2.0)
|
59
63
|
listen (3.0.7)
|
60
64
|
rb-fsevent (>= 0.9.3)
|
61
65
|
rb-inotify (>= 0.9.7)
|
62
|
-
lumberjack (1.0.
|
63
|
-
method_source (0.9.
|
64
|
-
multipart-post (2.
|
66
|
+
lumberjack (1.0.13)
|
67
|
+
method_source (0.9.2)
|
68
|
+
multipart-post (2.1.1)
|
65
69
|
nap (1.1.0)
|
66
70
|
nenv (0.3.0)
|
67
71
|
no_proxy_fix (0.1.2)
|
68
72
|
notiffany (0.1.1)
|
69
73
|
nenv (~> 0.1)
|
70
74
|
shellany (~> 0.0)
|
71
|
-
octokit (4.
|
75
|
+
octokit (4.14.0)
|
72
76
|
sawyer (~> 0.8.0, >= 0.5.3)
|
73
77
|
open4 (1.3.4)
|
74
|
-
parallel (1.
|
75
|
-
parser (2.
|
78
|
+
parallel (1.17.0)
|
79
|
+
parser (2.6.3.0)
|
76
80
|
ast (~> 2.4.0)
|
77
|
-
|
78
|
-
pry (0.11.3)
|
81
|
+
pry (0.12.2)
|
79
82
|
coderay (~> 1.1.0)
|
80
83
|
method_source (~> 0.9.0)
|
81
|
-
public_suffix (3.
|
84
|
+
public_suffix (3.1.1)
|
82
85
|
rainbow (3.0.0)
|
83
86
|
rake (10.5.0)
|
84
87
|
rb-fsevent (0.10.3)
|
85
|
-
rb-inotify (0.
|
86
|
-
ffi (
|
87
|
-
rspec (3.
|
88
|
-
rspec-core (~> 3.
|
89
|
-
rspec-expectations (~> 3.
|
90
|
-
rspec-mocks (~> 3.
|
91
|
-
rspec-core (3.
|
92
|
-
rspec-support (~> 3.
|
93
|
-
rspec-expectations (3.
|
88
|
+
rb-inotify (0.10.0)
|
89
|
+
ffi (~> 1.0)
|
90
|
+
rspec (3.8.0)
|
91
|
+
rspec-core (~> 3.8.0)
|
92
|
+
rspec-expectations (~> 3.8.0)
|
93
|
+
rspec-mocks (~> 3.8.0)
|
94
|
+
rspec-core (3.8.2)
|
95
|
+
rspec-support (~> 3.8.0)
|
96
|
+
rspec-expectations (3.8.4)
|
94
97
|
diff-lcs (>= 1.2.0, < 2.0)
|
95
|
-
rspec-support (~> 3.
|
96
|
-
rspec-mocks (3.
|
98
|
+
rspec-support (~> 3.8.0)
|
99
|
+
rspec-mocks (3.8.1)
|
97
100
|
diff-lcs (>= 1.2.0, < 2.0)
|
98
|
-
rspec-support (~> 3.
|
99
|
-
rspec-support (3.
|
100
|
-
rubocop (0.
|
101
|
+
rspec-support (~> 3.8.0)
|
102
|
+
rspec-support (3.8.2)
|
103
|
+
rubocop (0.73.0)
|
104
|
+
jaro_winkler (~> 1.5.1)
|
101
105
|
parallel (~> 1.10)
|
102
|
-
parser (>= 2.
|
103
|
-
powerpack (~> 0.1)
|
106
|
+
parser (>= 2.6)
|
104
107
|
rainbow (>= 2.2.2, < 4.0)
|
105
108
|
ruby-progressbar (~> 1.7)
|
106
|
-
unicode-display_width (
|
107
|
-
ruby-progressbar (1.
|
108
|
-
sawyer (0.8.
|
109
|
-
addressable (>= 2.3.5
|
110
|
-
faraday (
|
109
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
110
|
+
ruby-progressbar (1.10.1)
|
111
|
+
sawyer (0.8.2)
|
112
|
+
addressable (>= 2.3.5)
|
113
|
+
faraday (> 0.8, < 2.0)
|
111
114
|
shellany (0.0.1)
|
112
115
|
terminal-table (1.8.0)
|
113
116
|
unicode-display_width (~> 1.1, >= 1.1.1)
|
114
|
-
thor (0.20.
|
115
|
-
unicode-display_width (1.
|
116
|
-
yard (0.9.
|
117
|
+
thor (0.20.3)
|
118
|
+
unicode-display_width (1.6.0)
|
119
|
+
yard (0.9.20)
|
117
120
|
|
118
121
|
PLATFORMS
|
119
122
|
ruby
|
@@ -132,4 +135,4 @@ DEPENDENCIES
|
|
132
135
|
yard
|
133
136
|
|
134
137
|
BUNDLED WITH
|
135
|
-
1.
|
138
|
+
1.17.2
|
data/README.md
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
[![License](http://img.shields.io/badge/license-MIT-green.svg?style=flat)](LICENSE.txt)
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/danger-xcode_summary.svg)](https://badge.fury.io/rb/danger-xcode_summary)
|
5
5
|
[![Build Status](https://travis-ci.org/diogot/danger-xcode_summary.svg?branch=master)](https://travis-ci.org/diogot/danger-xcode_summary)
|
6
|
-
[![Dependency Status](https://dependencyci.com/github/diogot/danger-xcode_summary/badge)](https://dependencyci.com/github/diogot/danger-xcode_summary)
|
7
6
|
|
8
7
|
A [Danger](http://danger.systems) plugin that shows all build errors, warnings and unit tests results generated from `xcodebuild`.
|
9
8
|
|
@@ -11,6 +10,8 @@ You need to use [xcpretty](https://github.com/supermarin/xcpretty) with
|
|
11
10
|
[xcpretty-json-formatter](https://github.com/marcelofabri/xcpretty-json-formatter)
|
12
11
|
to generate a JSON file that this plugin can read.
|
13
12
|
|
13
|
+
**Using [danger-swift](https://github.com/danger/swift)**? You may want to take a look at [danger-swift-xcodesummary](https://github.com/f-meloni/danger-swift-xcodesummary).
|
14
|
+
|
14
15
|
## How does it look?
|
15
16
|
|
16
17
|
<table>
|
@@ -104,7 +105,7 @@ xcode_summary.ignored_files = 'Pods/**'
|
|
104
105
|
|
105
106
|
# Ignoring specific warnings
|
106
107
|
xcode_summary.ignored_results { |result|
|
107
|
-
result.message.start_with 'ld' # Ignore ld_warnings
|
108
|
+
result.message.start_with? 'ld' # Ignore ld_warnings
|
108
109
|
}
|
109
110
|
|
110
111
|
xcode_summary.report 'xcodebuild.json'
|
data/lib/danger_plugin.rb
CHANGED
data/lib/danger_xcode_summary.rb
CHANGED
data/lib/xcode_summary/plugin.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'json'
|
2
4
|
|
3
5
|
module Danger
|
@@ -196,9 +198,9 @@ module Danger
|
|
196
198
|
errors.delete_if(&ignored_results)
|
197
199
|
end
|
198
200
|
|
199
|
-
def parse_location(
|
200
|
-
file_path, line, _column =
|
201
|
-
Location.new(
|
201
|
+
def parse_location(input)
|
202
|
+
file_path, line, _column = input[:file_path].split(':')
|
203
|
+
Location.new(input[:file_name], file_path, line.to_i)
|
202
204
|
end
|
203
205
|
|
204
206
|
def parse_test_location(failure)
|
@@ -208,27 +210,29 @@ module Danger
|
|
208
210
|
end
|
209
211
|
|
210
212
|
def format_path(path)
|
211
|
-
clean_path, line = parse_filename(path)
|
212
|
-
path = clean_path + '#L' + line if clean_path && line
|
213
|
-
|
214
213
|
# Pick a Dangerfile plugin for a chosen request_source
|
215
214
|
# based on https://github.com/danger/danger/blob/master/lib/danger/plugin_support/plugin.rb#L31
|
216
215
|
plugins = Plugin.all_plugins.select { |plugin| Dangerfile.essential_plugin_classes.include? plugin }
|
217
216
|
plugin = plugins.select { |p| p.method_defined? :html_link }.map { |p| p.new(@dangerfile) }.compact.first
|
218
217
|
|
219
|
-
plugin
|
218
|
+
if plugin
|
219
|
+
clean_path, line = parse_filename(path)
|
220
|
+
path = clean_path + '#L' + line if clean_path && line
|
221
|
+
plugin.html_link(path)
|
222
|
+
else
|
223
|
+
path
|
224
|
+
end
|
220
225
|
end
|
221
226
|
|
222
227
|
def parse_filename(path)
|
223
228
|
regex = /^(.*?):(\d*):?\d*$/
|
224
229
|
match = path.match(regex)
|
225
|
-
|
226
|
-
match.captures
|
227
|
-
end
|
230
|
+
match&.captures
|
228
231
|
end
|
229
232
|
|
230
233
|
def relative_path(path)
|
231
234
|
return nil if project_root.nil?
|
235
|
+
|
232
236
|
path.gsub(project_root, '')
|
233
237
|
end
|
234
238
|
|
@@ -242,38 +246,38 @@ module Danger
|
|
242
246
|
reason.gsub('>', '\>').gsub('<', '\<')
|
243
247
|
end
|
244
248
|
|
245
|
-
def format_compile_warning(
|
246
|
-
path = relative_path(
|
249
|
+
def format_compile_warning(input)
|
250
|
+
path = relative_path(input[:file_path])
|
247
251
|
return nil if should_ignore_warning?(path)
|
248
252
|
|
249
253
|
path_link = format_path(path)
|
250
254
|
|
251
|
-
warning = "**#{path_link}**: #{escape_reason(
|
252
|
-
if
|
255
|
+
warning = "**#{path_link}**: #{escape_reason(input[:reason])} <br />"
|
256
|
+
if input[:line] && !input[:line].empty?
|
253
257
|
"#{warning}" \
|
254
258
|
"```\n" \
|
255
|
-
"#{
|
259
|
+
"#{input[:line]}\n" \
|
256
260
|
'```'
|
257
261
|
else
|
258
262
|
warning
|
259
263
|
end
|
260
264
|
end
|
261
265
|
|
262
|
-
def format_format_file_missing_error(
|
263
|
-
path = relative_path(
|
266
|
+
def format_format_file_missing_error(input)
|
267
|
+
path = relative_path(input[:file_path])
|
264
268
|
path_link = format_path(path)
|
265
|
-
"**#{escape_reason(
|
269
|
+
"**#{escape_reason(input[:reason])}**: #{path_link}"
|
266
270
|
end
|
267
271
|
|
268
|
-
def format_undefined_symbols(
|
269
|
-
"#{
|
270
|
-
"> Symbol: #{
|
271
|
-
"> Referenced from: #{
|
272
|
+
def format_undefined_symbols(input)
|
273
|
+
"#{input[:message]} <br />" \
|
274
|
+
"> Symbol: #{input[:symbol]} <br />" \
|
275
|
+
"> Referenced from: #{input[:reference]}"
|
272
276
|
end
|
273
277
|
|
274
|
-
def format_duplicate_symbols(
|
275
|
-
"#{
|
276
|
-
"> #{
|
278
|
+
def format_duplicate_symbols(input)
|
279
|
+
"#{input[:message]} <br />" \
|
280
|
+
"> #{input[:file_paths].map { |path| path.split('/').last }.join('<br /> ')}"
|
277
281
|
end
|
278
282
|
|
279
283
|
def format_test_failure(suite_name, failure)
|
data/spec/spec_helper.rb
CHANGED
data/spec/xcode_summary_spec.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require File.expand_path('spec_helper', __dir__)
|
2
4
|
|
3
5
|
module Danger
|
4
6
|
describe Danger::DangerXcodeSummary do
|
@@ -73,7 +75,7 @@ module Danger
|
|
73
75
|
@xcode_summary.report('spec/fixtures/summary.json')
|
74
76
|
expect(@dangerfile.status_report[:warnings]).to eq [
|
75
77
|
# rubocop:disable LineLength
|
76
|
-
"**<a href='https://github.com/diogot/danger-xcode_summary/blob/129jef029jf029fj2039fj203f92/MyWeight/Bla.m#L32'>MyWeight/Bla.m#L32</a>**: Value stored to 'theme' is never read <br />```\n theme = *ptr++;\n```"
|
78
|
+
"**<a href='https://github.com/diogot/danger-xcode_summary/blob/129jef029jf029fj2039fj203f92/MyWeight/Bla.m#L32'>MyWeight/Bla.m#L32</a>**: Value stored to 'theme' is never read <br />```\n theme = *ptr++;\n```"
|
77
79
|
# rubocop:enable LineLength
|
78
80
|
]
|
79
81
|
end
|
@@ -89,7 +91,7 @@ module Danger
|
|
89
91
|
expect(@dangerfile.status_report[:errors]).to eq [
|
90
92
|
# rubocop:disable LineLength
|
91
93
|
'**MyWeight.MyWeightSpec**: works_with_success, expected to eventually not be nil, got \<nil\> <br /> ' \
|
92
|
-
"<a href='https://github.com/diogot/danger-xcode_summary/blob/129jef029jf029fj2039fj203f92/MyWeight/MyWeightTests/Tests.swift#L86'>MyWeight/MyWeightTests/Tests.swift#L86</a>"
|
94
|
+
"<a href='https://github.com/diogot/danger-xcode_summary/blob/129jef029jf029fj2039fj203f92/MyWeight/MyWeightTests/Tests.swift#L86'>MyWeight/MyWeightTests/Tests.swift#L86</a>"
|
93
95
|
# rubocop:enable LineLength
|
94
96
|
]
|
95
97
|
end
|
@@ -204,10 +206,8 @@ module Danger
|
|
204
206
|
|
205
207
|
describe 'where request source' do
|
206
208
|
it 'should be bitbucket' do
|
207
|
-
path = @xcode_summary.send(:format_path, 'lib/xcode_summary/plugin.rb
|
208
|
-
|
209
|
-
expect(path).to eq "<a href='https://github.com/diogot/danger-xcode_summary/lib/xcode_summary/plugin.rb?at=4d4c0f31857e3185b51b6865a0700525bc0cb2bb#L3'>lib/xcode_summary/plugin.rb</a>"
|
210
|
-
# rubocop:enable LineLength
|
209
|
+
path = @xcode_summary.send(:format_path, 'lib/xcode_summary/plugin.rb:3')
|
210
|
+
expect(path).to eq 'lib/xcode_summary/plugin.rb:3'
|
211
211
|
end
|
212
212
|
end
|
213
213
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger-xcode_summary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Diogo Tridapalli
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-07-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: danger-plugin-api
|
@@ -175,8 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
175
175
|
- !ruby/object:Gem::Version
|
176
176
|
version: '0'
|
177
177
|
requirements: []
|
178
|
-
|
179
|
-
rubygems_version: 2.4.5.2
|
178
|
+
rubygems_version: 3.0.3
|
180
179
|
signing_key:
|
181
180
|
specification_version: 4
|
182
181
|
summary: A [Danger](http://danger.systems) plugin that shows all build errors, warnings
|