danger-swiftlint 0.25.0 → 0.26.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/danger_plugin.rb +9 -9
- data/lib/version.rb +1 -1
- data/spec/danger_plugin_spec.rb +0 -18
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a7648f0b4b4bf523d4617687df847500fcdc2f846425dfadffb7f8c768319d8
|
4
|
+
data.tar.gz: 26b3d3507b659380c23b46828be7874faf949016fd54d1366436de8ce348b518
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f912b6332e39539cc16f6a09b9d7e31875409a3357db1d6e2e6160a807138bceb743a7e6580539844e45595dbd3e9932ccda66bb0bfaa5c10a2740d7997021d
|
7
|
+
data.tar.gz: 84801ec026c062c9e9f30d3bca88759cde4c73a4e70b72b0fb8f112f567585ce5468ec695c5b858919d642998047cc8b1fce8419bce8e617705fb399132595f3
|
data/lib/danger_plugin.rb
CHANGED
@@ -46,7 +46,7 @@ module Danger
|
|
46
46
|
|
47
47
|
# Errors found
|
48
48
|
attr_accessor :errors
|
49
|
-
|
49
|
+
|
50
50
|
# All issues found
|
51
51
|
attr_accessor :issues
|
52
52
|
|
@@ -67,12 +67,12 @@ module Danger
|
|
67
67
|
# Fails if swiftlint isn't installed
|
68
68
|
raise 'swiftlint is not installed' unless swiftlint.installed?
|
69
69
|
|
70
|
-
config_file_path =
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
70
|
+
config_file_path = config_file
|
71
|
+
if config_file_path
|
72
|
+
log "Using config file: #{config_file_path}"
|
73
|
+
else
|
74
|
+
log 'Config file was not specified.'
|
75
|
+
end
|
76
76
|
|
77
77
|
dir_selected = directory ? File.expand_path(directory) : Dir.pwd
|
78
78
|
log "Swiftlint will be run from #{dir_selected}"
|
@@ -124,7 +124,7 @@ module Danger
|
|
124
124
|
issues = issues.take(@max_num_violations)
|
125
125
|
end
|
126
126
|
log "Received from Swiftlint: #{issues}"
|
127
|
-
|
127
|
+
|
128
128
|
# filter out any unwanted violations with the passed in select_block
|
129
129
|
if select_block && !no_comment
|
130
130
|
issues = issues.select { |issue| select_block.call(issue) }
|
@@ -133,7 +133,7 @@ module Danger
|
|
133
133
|
# Filter warnings and errors
|
134
134
|
@warnings = issues.select { |issue| issue['severity'] == 'Warning' }
|
135
135
|
@errors = issues.select { |issue| issue['severity'] == 'Error' }
|
136
|
-
|
136
|
+
|
137
137
|
# Early exit so we don't comment
|
138
138
|
return if no_comment
|
139
139
|
|
data/lib/version.rb
CHANGED
data/spec/danger_plugin_spec.rb
CHANGED
@@ -314,24 +314,6 @@ module Danger
|
|
314
314
|
@swiftlint.lint_files
|
315
315
|
end
|
316
316
|
|
317
|
-
it 'expands default config file (if present) to absolute path' do
|
318
|
-
allow(@swiftlint.git).to receive(:added_files).and_return([])
|
319
|
-
allow(@swiftlint.git).to receive(:modified_files).and_return([
|
320
|
-
'spec/fixtures/SwiftFile.swift'
|
321
|
-
])
|
322
|
-
expect(File).to receive(:file?).and_return(true)
|
323
|
-
expect(File).to receive(:exist?).and_return(true)
|
324
|
-
expect(File).to receive(:open).and_return(StringIO.new)
|
325
|
-
expect(YAML).to receive(:safe_load).and_return({})
|
326
|
-
|
327
|
-
expect_any_instance_of(Swiftlint).to receive(:lint)
|
328
|
-
.with(hash_including(config: File.expand_path('.swiftlint.yml')), '', anything)
|
329
|
-
.once
|
330
|
-
.and_return(@swiftlint_response)
|
331
|
-
|
332
|
-
@swiftlint.lint_files
|
333
|
-
end
|
334
|
-
|
335
317
|
it 'expands specified config file to absolute path' do
|
336
318
|
allow(@swiftlint.git).to receive(:added_files).and_return([])
|
337
319
|
allow(@swiftlint.git).to receive(:modified_files).and_return([
|
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.
|
4
|
+
version: 0.26.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: 2021-03-
|
15
|
+
date: 2021-03-31 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: danger
|
@@ -180,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
180
|
- !ruby/object:Gem::Version
|
181
181
|
version: '0'
|
182
182
|
requirements: []
|
183
|
-
rubygems_version: 3.
|
183
|
+
rubygems_version: 3.0.2
|
184
184
|
signing_key:
|
185
185
|
specification_version: 4
|
186
186
|
summary: A Danger plugin for linting Swift with SwiftLint.
|