danger-xcode_summary 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e6def5cba1b9a73d4f4f07a6c30d16589ae999b7
4
- data.tar.gz: 17ad38af9f1e987e0acd218e18e2d3767729dac3
3
+ metadata.gz: e222df89970744f0a9e0e9ec76408480aaa6020c
4
+ data.tar.gz: f07bbe188cf33ef8cd5707742bbd4d68b965da8f
5
5
  SHA512:
6
- metadata.gz: be044a5264cc74bccf5a51d57749ac77e242b74a00d021cb633504cb4eedd887e07537f63e06ec52bd3b3dc4f95c388cc8f2a22b9d1c99ffbb45e4beb0d4e626
7
- data.tar.gz: 768deca527d4006812c55fe34162bb4312d31d4c0a64247553c506af8985efc85832b3f0ab8347b07da1c5ac5b7f0a2754e228e32c5c90bafbab78f9b22a7f97
6
+ metadata.gz: fb7531300b28f2307a50ce66562c28e3bec695d6e70223220f811b822b5522137e5022677359f92509a7fa651f0fd9beaa3a6d084733df7e76016ab5ef5e8d0d
7
+ data.tar.gz: 70d9df94ff7603adb1b340650cb5b4f6b350c228797aa5b89ea790b99de1c5792439ed0ac5eaf7663c94ec45f9261865c827828a58150e27437856a463971d11
data/.rubocop.yml CHANGED
@@ -12,7 +12,7 @@ Lint/UselessAssignment:
12
12
  - '**/spec/**/*'
13
13
 
14
14
  # HoundCI doesn't like this rule
15
- Style/DotPosition:
15
+ Layout/DotPosition:
16
16
  Enabled: false
17
17
 
18
18
  # Cop supports --auto-correct.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- danger-xcode_summary (0.4.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.3.0)
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.6)
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.13.1)
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.18)
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.4.0.2)
76
- ast (~> 2.3)
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.1)
81
+ public_suffix (3.0.2)
82
82
  rainbow (3.0.0)
83
83
  rake (10.5.0)
84
- rb-fsevent (0.10.2)
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.0)
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.0
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 = '**/Pods/**'
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.
@@ -1,3 +1,3 @@
1
1
  module XcodeSummary
2
- VERSION = '0.4.0'.freeze
2
+ VERSION = '0.5.0'.freeze
3
3
  end
@@ -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'
@@ -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 waring and error counts with no errors' do
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.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-01-07 00:00:00.000000000 Z
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