danger-swiftlint 0.14.0 → 0.15.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: bc125a1eab659b16db325b01cc6e17d3b7d46f2a
4
- data.tar.gz: 1b2bb65a44388d2a69b7aae55cd707208a1dc1b7
2
+ SHA256:
3
+ metadata.gz: 01a0939fa22887ccd7c5fb12e95137480358a86b29fa5172013fcab5c4a641e8
4
+ data.tar.gz: fd0159f18351b1024d8a0375da700490a1fb65bf854b1afc43d9353129050ba6
5
5
  SHA512:
6
- metadata.gz: 759555135b7c2b2900273e2701eac2a8884f77b41368922e2f0b735871f13df821ab60c9d4456092b032d9ed9b0392f813dd71794ac3bfef3f6eec5e944bf8c3
7
- data.tar.gz: 4982d50f8e88cb400edf37ddb9f1e58e47f479002d98dc728f870f5a624a8873e33c8750bb8e2ba7d42b7ca0cccb45d57056cb0910a699fa9ad784fc4dc017dd
6
+ metadata.gz: d4ab4971ad7ce9ec8534f1640e6fb6d0ab9ab5ebc150fb3978bf0f2090969ea51af28982d920fb791a579a19ab8a938ce4bea2971b3183473ff30ac00ff5b01e
7
+ data.tar.gz: 2d2dda5c3ce69edc438d2054a52ecbb13dd0479dcc116c1c4981393328f2134d69c27790160ac2f5a16e5c67b12739aa311fae403cb7db6793eaca87ff7b884f
@@ -98,8 +98,8 @@ module Danger
98
98
 
99
99
  if inline_mode
100
100
  # Report with inline comment
101
- send_inline_comment(warnings, 'warn')
102
- send_inline_comment(errors, 'fail')
101
+ send_inline_comment(warnings, :warn)
102
+ send_inline_comment(errors, fail_on_error ? :fail : :warn)
103
103
  warn other_issues_message(other_issues_count) if other_issues_count > 0
104
104
  elsif warnings.count > 0 || errors.count > 0
105
105
  # Report if any warning or error
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DangerSwiftlint
4
- VERSION = '0.14.0'
4
+ VERSION = '0.15.0'
5
5
  SWIFTLINT_VERSION = '0.25.0'
6
6
  end
@@ -282,17 +282,40 @@ module Danger
282
282
  @swiftlint.lint_files
283
283
  end
284
284
 
285
- it 'generates errors instead of markdown when use inline mode' do
285
+ it 'generates errors/warnings instead of markdown when use inline mode' do
286
286
  allow_any_instance_of(Swiftlint).to receive(:lint)
287
287
  .with(hash_including(path: File.expand_path('spec/fixtures/SwiftFile.swift')), '')
288
288
  .and_return(@swiftlint_response)
289
289
 
290
- @swiftlint.lint_files('spec/fixtures/*.swift', inline_mode: true, fail_on_error: false, additional_swiftlint_args: '')
290
+ @swiftlint.lint_files('spec/fixtures/*.swift', inline_mode: true, additional_swiftlint_args: '')
291
291
 
292
292
  status = @swiftlint.status_report
293
- expect(status[:errors]).to_not be_empty
293
+ expect(status[:errors] + status[:warnings]).to_not be_empty
294
294
  expect(status[:markdowns]).to be_empty
295
295
  end
296
+
297
+ it 'generate errors in inline_mode when fail_on_error' do
298
+ allow_any_instance_of(Swiftlint).to receive(:lint)
299
+ .with(hash_including(path: File.expand_path('spec/fixtures/SwiftFile.swift')), '')
300
+ .and_return(@swiftlint_response)
301
+
302
+ @swiftlint.lint_files('spec/fixtures/*.swift', inline_mode: true, fail_on_error: true, additional_swiftlint_args: '')
303
+
304
+ status = @swiftlint.status_report
305
+ expect(status[:errors]).to_not be_empty
306
+ end
307
+
308
+ it 'generate only warnings in inline_mode when fail_on_error is false' do
309
+ allow_any_instance_of(Swiftlint).to receive(:lint)
310
+ .with(hash_including(path: File.expand_path('spec/fixtures/SwiftFile.swift')), '')
311
+ .and_return(@swiftlint_response)
312
+
313
+ @swiftlint.lint_files('spec/fixtures/*.swift', inline_mode: true, fail_on_error: false, additional_swiftlint_args: '')
314
+
315
+ status = @swiftlint.status_report
316
+ expect(status[:warnings]).to_not be_empty
317
+ expect(status[:errors]).to be_empty
318
+ end
296
319
  end
297
320
  end
298
321
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-swiftlint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ash Furrow
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2018-03-21 00:00:00.000000000 Z
15
+ date: 2018-03-26 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: danger
@@ -181,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
181
  version: '0'
182
182
  requirements: []
183
183
  rubyforge_project:
184
- rubygems_version: 2.6.11
184
+ rubygems_version: 2.7.6
185
185
  signing_key:
186
186
  specification_version: 4
187
187
  summary: A Danger plugin for linting Swift with SwiftLint.