danger-xcode_summary 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/Gemfile.lock +48 -46
- data/lib/xcode_summary/gem_version.rb +1 -1
- data/lib/xcode_summary/plugin.rb +18 -0
- data/spec/xcode_summary_spec.rb +15 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6def5cba1b9a73d4f4f07a6c30d16589ae999b7
|
4
|
+
data.tar.gz: 17ad38af9f1e987e0acd218e18e2d3767729dac3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be044a5264cc74bccf5a51d57749ac77e242b74a00d021cb633504cb4eedd887e07537f63e06ec52bd3b3dc4f95c388cc8f2a22b9d1c99ffbb45e4beb0d4e626
|
7
|
+
data.tar.gz: 768deca527d4006812c55fe34162bb4312d31d4c0a64247553c506af8985efc85832b3f0ab8347b07da1c5ac5b7f0a2754e228e32c5c90bafbab78f9b22a7f97
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,25 +1,25 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
danger-xcode_summary (0.
|
4
|
+
danger-xcode_summary (0.4.0)
|
5
5
|
danger-plugin-api (~> 1.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
addressable (2.5.
|
11
|
-
public_suffix (
|
10
|
+
addressable (2.5.2)
|
11
|
+
public_suffix (>= 2.0.2, < 4.0)
|
12
12
|
ast (2.3.0)
|
13
|
-
claide (1.0.
|
13
|
+
claide (1.0.2)
|
14
14
|
claide-plugins (0.9.2)
|
15
15
|
cork
|
16
16
|
nap
|
17
17
|
open4 (~> 1.3)
|
18
|
-
coderay (1.1.
|
18
|
+
coderay (1.1.2)
|
19
19
|
colored2 (3.1.2)
|
20
20
|
cork (0.3.0)
|
21
21
|
colored2 (~> 3.1)
|
22
|
-
danger (
|
22
|
+
danger (5.5.6)
|
23
23
|
claide (~> 1.0)
|
24
24
|
claide-plugins (>= 0.9.2)
|
25
25
|
colored2 (~> 3.1)
|
@@ -28,22 +28,23 @@ GEM
|
|
28
28
|
faraday-http-cache (~> 1.0)
|
29
29
|
git (~> 1)
|
30
30
|
kramdown (~> 1.5)
|
31
|
-
|
31
|
+
no_proxy_fix
|
32
|
+
octokit (~> 4.7)
|
32
33
|
terminal-table (~> 1)
|
33
34
|
danger-plugin-api (1.0.0)
|
34
35
|
danger (> 2.0)
|
35
36
|
diff-lcs (1.3)
|
36
|
-
faraday (0.
|
37
|
+
faraday (0.13.1)
|
37
38
|
multipart-post (>= 1.2, < 3)
|
38
39
|
faraday-http-cache (1.3.1)
|
39
40
|
faraday (~> 0.8)
|
40
41
|
ffi (1.9.18)
|
41
42
|
formatador (0.2.5)
|
42
43
|
git (1.3.0)
|
43
|
-
guard (2.14.
|
44
|
+
guard (2.14.2)
|
44
45
|
formatador (>= 0.2.4)
|
45
46
|
listen (>= 2.7, < 4.0)
|
46
|
-
lumberjack (
|
47
|
+
lumberjack (>= 1.0.12, < 2.0)
|
47
48
|
nenv (~> 0.1)
|
48
49
|
notiffany (~> 0.0)
|
49
50
|
pry (>= 0.9.12)
|
@@ -54,64 +55,65 @@ GEM
|
|
54
55
|
guard (~> 2.1)
|
55
56
|
guard-compat (~> 1.1)
|
56
57
|
rspec (>= 2.99.0, < 4.0)
|
57
|
-
kramdown (1.
|
58
|
+
kramdown (1.16.2)
|
58
59
|
listen (3.0.7)
|
59
60
|
rb-fsevent (>= 0.9.3)
|
60
61
|
rb-inotify (>= 0.9.7)
|
61
|
-
lumberjack (1.0.
|
62
|
-
method_source (0.
|
62
|
+
lumberjack (1.0.12)
|
63
|
+
method_source (0.9.0)
|
63
64
|
multipart-post (2.0.0)
|
64
65
|
nap (1.1.0)
|
65
66
|
nenv (0.3.0)
|
67
|
+
no_proxy_fix (0.1.2)
|
66
68
|
notiffany (0.1.1)
|
67
69
|
nenv (~> 0.1)
|
68
70
|
shellany (~> 0.0)
|
69
|
-
octokit (4.
|
71
|
+
octokit (4.8.0)
|
70
72
|
sawyer (~> 0.8.0, >= 0.5.3)
|
71
73
|
open4 (1.3.4)
|
72
|
-
|
73
|
-
|
74
|
+
parallel (1.12.1)
|
75
|
+
parser (2.4.0.2)
|
76
|
+
ast (~> 2.3)
|
74
77
|
powerpack (0.1.1)
|
75
|
-
pry (0.
|
78
|
+
pry (0.11.3)
|
76
79
|
coderay (~> 1.1.0)
|
77
|
-
method_source (~> 0.
|
78
|
-
|
79
|
-
|
80
|
-
rainbow (2.2.1)
|
80
|
+
method_source (~> 0.9.0)
|
81
|
+
public_suffix (3.0.1)
|
82
|
+
rainbow (3.0.0)
|
81
83
|
rake (10.5.0)
|
82
|
-
rb-fsevent (0.
|
83
|
-
rb-inotify (0.9.
|
84
|
-
ffi (>= 0.5.0)
|
85
|
-
rspec (3.
|
86
|
-
rspec-core (~> 3.
|
87
|
-
rspec-expectations (~> 3.
|
88
|
-
rspec-mocks (~> 3.
|
89
|
-
rspec-core (3.
|
90
|
-
rspec-support (~> 3.
|
91
|
-
rspec-expectations (3.
|
84
|
+
rb-fsevent (0.10.2)
|
85
|
+
rb-inotify (0.9.10)
|
86
|
+
ffi (>= 0.5.0, < 2)
|
87
|
+
rspec (3.7.0)
|
88
|
+
rspec-core (~> 3.7.0)
|
89
|
+
rspec-expectations (~> 3.7.0)
|
90
|
+
rspec-mocks (~> 3.7.0)
|
91
|
+
rspec-core (3.7.1)
|
92
|
+
rspec-support (~> 3.7.0)
|
93
|
+
rspec-expectations (3.7.0)
|
92
94
|
diff-lcs (>= 1.2.0, < 2.0)
|
93
|
-
rspec-support (~> 3.
|
94
|
-
rspec-mocks (3.
|
95
|
+
rspec-support (~> 3.7.0)
|
96
|
+
rspec-mocks (3.7.0)
|
95
97
|
diff-lcs (>= 1.2.0, < 2.0)
|
96
|
-
rspec-support (~> 3.
|
97
|
-
rspec-support (3.
|
98
|
-
rubocop (0.
|
99
|
-
|
98
|
+
rspec-support (~> 3.7.0)
|
99
|
+
rspec-support (3.7.0)
|
100
|
+
rubocop (0.52.1)
|
101
|
+
parallel (~> 1.10)
|
102
|
+
parser (>= 2.4.0.2, < 3.0)
|
100
103
|
powerpack (~> 0.1)
|
101
|
-
rainbow (>=
|
104
|
+
rainbow (>= 2.2.2, < 4.0)
|
102
105
|
ruby-progressbar (~> 1.7)
|
103
106
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
104
|
-
ruby-progressbar (1.
|
107
|
+
ruby-progressbar (1.9.0)
|
105
108
|
sawyer (0.8.1)
|
106
109
|
addressable (>= 2.3.5, < 2.6)
|
107
110
|
faraday (~> 0.8, < 1.0)
|
108
111
|
shellany (0.0.1)
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
yard (0.9.8)
|
112
|
+
terminal-table (1.8.0)
|
113
|
+
unicode-display_width (~> 1.1, >= 1.1.1)
|
114
|
+
thor (0.20.0)
|
115
|
+
unicode-display_width (1.3.0)
|
116
|
+
yard (0.9.12)
|
115
117
|
|
116
118
|
PLATFORMS
|
117
119
|
ruby
|
@@ -130,4 +132,4 @@ DEPENDENCIES
|
|
130
132
|
yard
|
131
133
|
|
132
134
|
BUNDLED WITH
|
133
|
-
1.
|
135
|
+
1.16.0
|
data/lib/xcode_summary/plugin.rb
CHANGED
@@ -60,6 +60,7 @@ module Danger
|
|
60
60
|
# @return [Boolean]
|
61
61
|
attr_accessor :inline_mode
|
62
62
|
|
63
|
+
# rubocop:disable Lint/DuplicateMethods
|
63
64
|
def project_root
|
64
65
|
root = @project_root || Dir.pwd
|
65
66
|
root += '/' unless root.end_with? '/'
|
@@ -85,6 +86,7 @@ module Danger
|
|
85
86
|
def inline_mode
|
86
87
|
@inline_mode || false
|
87
88
|
end
|
89
|
+
# rubocop:enable Lint/DuplicateMethods
|
88
90
|
|
89
91
|
# Reads a file with JSON Xcode summary and reports it.
|
90
92
|
#
|
@@ -99,6 +101,22 @@ module Danger
|
|
99
101
|
end
|
100
102
|
end
|
101
103
|
|
104
|
+
# Reads a file with JSON Xcode summary and reports its warning and error count.
|
105
|
+
#
|
106
|
+
# @param [String] file_path Path for Xcode summary in JSON format.
|
107
|
+
# @return [String] JSON string with warningCount and errorCount
|
108
|
+
def warning_error_count(file_path)
|
109
|
+
if File.file?(file_path)
|
110
|
+
xcode_summary = JSON.parse(File.read(file_path), symbolize_names: true)
|
111
|
+
warning_count = warnings(xcode_summary).count
|
112
|
+
error_count = errors(xcode_summary).count
|
113
|
+
result = { warnings: warning_count, errors: error_count }
|
114
|
+
result.to_json
|
115
|
+
else
|
116
|
+
fail 'summary file not found'
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
102
120
|
private
|
103
121
|
|
104
122
|
def format_summary(xcode_summary)
|
data/spec/xcode_summary_spec.rb
CHANGED
@@ -102,6 +102,11 @@ module Danger
|
|
102
102
|
]
|
103
103
|
end
|
104
104
|
|
105
|
+
it 'report waring and error counts' do
|
106
|
+
result = @xcode_summary.warning_error_count('spec/fixtures/summary.json')
|
107
|
+
expect(result).to eq '{"warnings":2,"errors":0}'
|
108
|
+
end
|
109
|
+
|
105
110
|
context 'with inline_mode' do
|
106
111
|
before do
|
107
112
|
@xcode_summary.inline_mode = true
|
@@ -150,6 +155,16 @@ module Danger
|
|
150
155
|
@xcode_summary.report('spec/fixtures/ld_warnings.json')
|
151
156
|
expect(@dangerfile.status_report[:warnings]).to eq ['another warning']
|
152
157
|
end
|
158
|
+
|
159
|
+
it 'report waring and error counts with no errors' do
|
160
|
+
result = @xcode_summary.warning_error_count('spec/fixtures/errors.json')
|
161
|
+
expect(result).to eq '{"warnings":0,"errors":1}'
|
162
|
+
end
|
163
|
+
|
164
|
+
it 'report waring and error counts with no warnings' do
|
165
|
+
result = @xcode_summary.warning_error_count('spec/fixtures/ld_warnings.json')
|
166
|
+
expect(result).to eq '{"warnings":1,"errors":0}'
|
167
|
+
end
|
153
168
|
end
|
154
169
|
end
|
155
170
|
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.
|
4
|
+
version: 0.4.0
|
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: 2018-01-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: danger-plugin-api
|