danger-xcode_summary 0.4.0 → 0.5.0
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/.rubocop.yml +1 -1
- data/Gemfile.lock +11 -11
- data/README.md +14 -1
- data/lib/xcode_summary/gem_version.rb +1 -1
- data/lib/xcode_summary/plugin.rb +14 -0
- data/spec/fixtures/warnings_errors.json +32 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/xcode_summary_spec.rb +23 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e222df89970744f0a9e0e9ec76408480aaa6020c
|
4
|
+
data.tar.gz: f07bbe188cf33ef8cd5707742bbd4d68b965da8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb7531300b28f2307a50ce66562c28e3bec695d6e70223220f811b822b5522137e5022677359f92509a7fa651f0fd9beaa3a6d084733df7e76016ab5ef5e8d0d
|
7
|
+
data.tar.gz: 70d9df94ff7603adb1b340650cb5b4f6b350c228797aa5b89ea790b99de1c5792439ed0ac5eaf7663c94ec45f9261865c827828a58150e27437856a463971d11
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
danger-xcode_summary (0.
|
4
|
+
danger-xcode_summary (0.5.0)
|
5
5
|
danger-plugin-api (~> 1.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -9,7 +9,7 @@ GEM
|
|
9
9
|
specs:
|
10
10
|
addressable (2.5.2)
|
11
11
|
public_suffix (>= 2.0.2, < 4.0)
|
12
|
-
ast (2.
|
12
|
+
ast (2.4.0)
|
13
13
|
claide (1.0.2)
|
14
14
|
claide-plugins (0.9.2)
|
15
15
|
cork
|
@@ -19,7 +19,7 @@ GEM
|
|
19
19
|
colored2 (3.1.2)
|
20
20
|
cork (0.3.0)
|
21
21
|
colored2 (~> 3.1)
|
22
|
-
danger (5.5.
|
22
|
+
danger (5.5.10)
|
23
23
|
claide (~> 1.0)
|
24
24
|
claide-plugins (>= 0.9.2)
|
25
25
|
colored2 (~> 3.1)
|
@@ -34,11 +34,11 @@ GEM
|
|
34
34
|
danger-plugin-api (1.0.0)
|
35
35
|
danger (> 2.0)
|
36
36
|
diff-lcs (1.3)
|
37
|
-
faraday (0.
|
37
|
+
faraday (0.14.0)
|
38
38
|
multipart-post (>= 1.2, < 3)
|
39
39
|
faraday-http-cache (1.3.1)
|
40
40
|
faraday (~> 0.8)
|
41
|
-
ffi (1.9.
|
41
|
+
ffi (1.9.23)
|
42
42
|
formatador (0.2.5)
|
43
43
|
git (1.3.0)
|
44
44
|
guard (2.14.2)
|
@@ -72,16 +72,16 @@ GEM
|
|
72
72
|
sawyer (~> 0.8.0, >= 0.5.3)
|
73
73
|
open4 (1.3.4)
|
74
74
|
parallel (1.12.1)
|
75
|
-
parser (2.
|
76
|
-
ast (~> 2.
|
75
|
+
parser (2.5.0.2)
|
76
|
+
ast (~> 2.4.0)
|
77
77
|
powerpack (0.1.1)
|
78
78
|
pry (0.11.3)
|
79
79
|
coderay (~> 1.1.0)
|
80
80
|
method_source (~> 0.9.0)
|
81
|
-
public_suffix (3.0.
|
81
|
+
public_suffix (3.0.2)
|
82
82
|
rainbow (3.0.0)
|
83
83
|
rake (10.5.0)
|
84
|
-
rb-fsevent (0.10.
|
84
|
+
rb-fsevent (0.10.3)
|
85
85
|
rb-inotify (0.9.10)
|
86
86
|
ffi (>= 0.5.0, < 2)
|
87
87
|
rspec (3.7.0)
|
@@ -96,7 +96,7 @@ GEM
|
|
96
96
|
rspec-mocks (3.7.0)
|
97
97
|
diff-lcs (>= 1.2.0, < 2.0)
|
98
98
|
rspec-support (~> 3.7.0)
|
99
|
-
rspec-support (3.7.
|
99
|
+
rspec-support (3.7.1)
|
100
100
|
rubocop (0.52.1)
|
101
101
|
parallel (~> 1.10)
|
102
102
|
parser (>= 2.4.0.2, < 3.0)
|
@@ -132,4 +132,4 @@ DEPENDENCIES
|
|
132
132
|
yard
|
133
133
|
|
134
134
|
BUNDLED WITH
|
135
|
-
1.16.
|
135
|
+
1.16.1
|
data/README.md
CHANGED
@@ -96,10 +96,11 @@ xcode_summary.report 'xcodebuild.json'
|
|
96
96
|
```
|
97
97
|
|
98
98
|
You can also ignore warnings from certain files by setting `ignored_files`:
|
99
|
+
Warning: `ignored_files` patterns applied on relative paths.
|
99
100
|
|
100
101
|
```ruby
|
101
102
|
# Ignoring warnings from Pods
|
102
|
-
xcode_summary.ignored_files = '
|
103
|
+
xcode_summary.ignored_files = 'Pods/**'
|
103
104
|
|
104
105
|
# Ignoring specific warnings
|
105
106
|
xcode_summary.ignored_results { |result|
|
@@ -109,6 +110,12 @@ xcode_summary.ignored_results { |result|
|
|
109
110
|
xcode_summary.report 'xcodebuild.json'
|
110
111
|
```
|
111
112
|
|
113
|
+
You can use `ignores_warnings` to supress warnings and shows only errors.
|
114
|
+
|
115
|
+
```ruby
|
116
|
+
xcode_summary.ignores_warnings = true
|
117
|
+
```
|
118
|
+
|
112
119
|
You can use `inline_mode`.
|
113
120
|
When this value is enabled, each warnings and errors are commented on each lines.
|
114
121
|
|
@@ -118,6 +125,12 @@ xcode_summary.inline_mode = true
|
|
118
125
|
xcode_summary.report 'xcodebuild.json'
|
119
126
|
```
|
120
127
|
|
128
|
+
You can get warning and error number by calling `warning_error_count`. The return will be a JSON string contains warning and error count, e.g {"warnings":1,"errors":3}:
|
129
|
+
|
130
|
+
```ruby
|
131
|
+
result = xcode_summary.warning_error_count 'xcodebuild.json'
|
132
|
+
```
|
133
|
+
|
121
134
|
## License
|
122
135
|
|
123
136
|
danger-xcode_summary is released under the MIT license. See [LICENSE.txt](LICENSE.txt) for details.
|
data/lib/xcode_summary/plugin.rb
CHANGED
@@ -60,6 +60,12 @@ module Danger
|
|
60
60
|
# @return [Boolean]
|
61
61
|
attr_accessor :inline_mode
|
62
62
|
|
63
|
+
# Defines if warnings should be included or not
|
64
|
+
# Defaults to `false`.
|
65
|
+
# @param [Boolean] value
|
66
|
+
# @return [Boolean]
|
67
|
+
attr_accessor :ignores_warnings
|
68
|
+
|
63
69
|
# rubocop:disable Lint/DuplicateMethods
|
64
70
|
def project_root
|
65
71
|
root = @project_root || Dir.pwd
|
@@ -86,6 +92,10 @@ module Danger
|
|
86
92
|
def inline_mode
|
87
93
|
@inline_mode || false
|
88
94
|
end
|
95
|
+
|
96
|
+
def ignores_warnings
|
97
|
+
@ignores_warnings || false
|
98
|
+
end
|
89
99
|
# rubocop:enable Lint/DuplicateMethods
|
90
100
|
|
91
101
|
# Reads a file with JSON Xcode summary and reports it.
|
@@ -148,6 +158,10 @@ module Danger
|
|
148
158
|
end
|
149
159
|
|
150
160
|
def warnings(xcode_summary)
|
161
|
+
if ignores_warnings
|
162
|
+
return []
|
163
|
+
end
|
164
|
+
|
151
165
|
warnings = [
|
152
166
|
xcode_summary.fetch(:warnings, []).map { |message| Result.new(message, nil) },
|
153
167
|
xcode_summary.fetch(:ld_warnings, []).map { |message| Result.new(message, nil) },
|
@@ -0,0 +1,32 @@
|
|
1
|
+
{
|
2
|
+
"warnings": [
|
3
|
+
"some warning",
|
4
|
+
"another warning"
|
5
|
+
],
|
6
|
+
"ld_warnings": [
|
7
|
+
|
8
|
+
],
|
9
|
+
"compile_warnings": [
|
10
|
+
|
11
|
+
],
|
12
|
+
"errors": [
|
13
|
+
"some error",
|
14
|
+
"another error"
|
15
|
+
],
|
16
|
+
"compile_errors": [
|
17
|
+
|
18
|
+
],
|
19
|
+
"file_missing_errors": [
|
20
|
+
|
21
|
+
],
|
22
|
+
"undefined_symbols_errors": [
|
23
|
+
|
24
|
+
],
|
25
|
+
"duplicate_symbols_errors": [
|
26
|
+
|
27
|
+
],
|
28
|
+
"tests_failures": {
|
29
|
+
},
|
30
|
+
"tests_summary_messages": [
|
31
|
+
]
|
32
|
+
}
|
data/spec/spec_helper.rb
CHANGED
@@ -55,6 +55,7 @@ end
|
|
55
55
|
def testing_bitbucket_env
|
56
56
|
{
|
57
57
|
'GIT_URL' => 'https://github.com/diogot/danger-xcode_summary.git',
|
58
|
+
'CHANGE_ID' => '4d4c0f31857e3185b51b6865a0700525bc0cb2bb',
|
58
59
|
'JENKINS_URL' => 'http://jenkins.server.com/',
|
59
60
|
'DANGER_BITBUCKETCLOUD_USERNAME' => 'username',
|
60
61
|
'DANGER_BITBUCKETCLOUD_PASSWORD' => 'password'
|
data/spec/xcode_summary_spec.rb
CHANGED
@@ -156,7 +156,7 @@ module Danger
|
|
156
156
|
expect(@dangerfile.status_report[:warnings]).to eq ['another warning']
|
157
157
|
end
|
158
158
|
|
159
|
-
it 'report
|
159
|
+
it 'report warning and error counts with no errors' do
|
160
160
|
result = @xcode_summary.warning_error_count('spec/fixtures/errors.json')
|
161
161
|
expect(result).to eq '{"warnings":0,"errors":1}'
|
162
162
|
end
|
@@ -166,6 +166,28 @@ module Danger
|
|
166
166
|
expect(result).to eq '{"warnings":1,"errors":0}'
|
167
167
|
end
|
168
168
|
end
|
169
|
+
|
170
|
+
context 'with ignores_warnings' do
|
171
|
+
before do
|
172
|
+
@xcode_summary.ignores_warnings = true
|
173
|
+
end
|
174
|
+
|
175
|
+
it 'asserts no ld warnings' do
|
176
|
+
@xcode_summary.report('spec/fixtures/ld_warnings.json')
|
177
|
+
expect(@dangerfile.status_report[:warnings]).to eq []
|
178
|
+
end
|
179
|
+
|
180
|
+
it 'asserts no errors' do
|
181
|
+
@xcode_summary.report('spec/fixtures/warnings_errors.json')
|
182
|
+
expect(@dangerfile.status_report[:warnings]).to eq []
|
183
|
+
expect(@dangerfile.status_report[:errors]).to eq ['some error', 'another error']
|
184
|
+
end
|
185
|
+
|
186
|
+
it 'report warning and error counts with no warning' do
|
187
|
+
result = @xcode_summary.warning_error_count('spec/fixtures/warnings_errors.json')
|
188
|
+
expect(result).to eq '{"warnings":0,"errors":2}'
|
189
|
+
end
|
190
|
+
end
|
169
191
|
end
|
170
192
|
end
|
171
193
|
|
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.5.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: 2018-
|
12
|
+
date: 2018-03-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: danger-plugin-api
|
@@ -153,6 +153,7 @@ files:
|
|
153
153
|
- spec/fixtures/summary_messages.json
|
154
154
|
- spec/fixtures/summary_with_empty_line.json
|
155
155
|
- spec/fixtures/test_errors.json
|
156
|
+
- spec/fixtures/warnings_errors.json
|
156
157
|
- spec/spec_helper.rb
|
157
158
|
- spec/xcode_summary_spec.rb
|
158
159
|
homepage: https://github.com/diogot/danger-xcode_summary
|
@@ -189,5 +190,6 @@ test_files:
|
|
189
190
|
- spec/fixtures/summary_messages.json
|
190
191
|
- spec/fixtures/summary_with_empty_line.json
|
191
192
|
- spec/fixtures/test_errors.json
|
193
|
+
- spec/fixtures/warnings_errors.json
|
192
194
|
- spec/spec_helper.rb
|
193
195
|
- spec/xcode_summary_spec.rb
|