danger-swiftlint 0.24.0 → 0.24.1
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 +6 -14
- data/lib/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5e0ae1a58601a02041afbbc49b06015411d234ad6ff0f541832af053b860a18
|
4
|
+
data.tar.gz: b13fa389a8c0e4de1d70cf4e87e6347577199aff4f4d338092436fb66217122f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fea1c7af5a3e04955357c7f485fe8965509193df5152dbf6da935ffe3ca02de352790df418055d029b93c6f5b226c5bb1f06d4657313b98e244e47d8d1ef9116
|
7
|
+
data.tar.gz: 78db4cb509956091213c021025be9399e99734e47e9d51f700a93a18249c21f9acc296b7ab7a00e219ed5664355dc5ba43e2e602cf292829831be4320a3a9e47
|
data/lib/danger_plugin.rb
CHANGED
@@ -216,6 +216,8 @@ module Danger
|
|
216
216
|
Dir.glob(files)
|
217
217
|
end
|
218
218
|
# Filter files to lint
|
219
|
+
excluded_paths_list = Find.find(*excluded_paths).to_a
|
220
|
+
included_paths_list = Find.find(*included_paths).to_a
|
219
221
|
files.
|
220
222
|
# Ensure only swift files are selected
|
221
223
|
select { |file| file.end_with?('.swift') }.
|
@@ -226,12 +228,12 @@ module Danger
|
|
226
228
|
# Ensure only files in the selected directory
|
227
229
|
select { |file| file.start_with?(dir_selected) }.
|
228
230
|
# Reject files excluded on configuration
|
229
|
-
reject { |file|
|
231
|
+
reject { |file| excluded_paths_list.include?(file) }.
|
230
232
|
# Accept files included on configuration
|
231
233
|
select do |file|
|
232
|
-
|
233
|
-
|
234
|
-
|
234
|
+
next true if included_paths.empty?
|
235
|
+
included_paths_list.include?(file)
|
236
|
+
end
|
235
237
|
end
|
236
238
|
|
237
239
|
# Get the configuration file
|
@@ -256,16 +258,6 @@ module Danger
|
|
256
258
|
end
|
257
259
|
end
|
258
260
|
|
259
|
-
# Return whether the file exists within a specified collection of paths
|
260
|
-
#
|
261
|
-
# @return [Bool] file exists within specified collection of paths
|
262
|
-
def file_exists?(paths, file)
|
263
|
-
paths.any? do |path|
|
264
|
-
Find.find(path)
|
265
|
-
.include?(file)
|
266
|
-
end
|
267
|
-
end
|
268
|
-
|
269
261
|
# Parses the configuration file and return the specified files in path
|
270
262
|
#
|
271
263
|
# @return [Array] list of files specified in path
|
data/lib/version.rb
CHANGED
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.24.
|
4
|
+
version: 0.24.1
|
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: 2020-
|
15
|
+
date: 2020-02-11 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: danger
|
@@ -180,7 +180,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
180
|
- !ruby/object:Gem::Version
|
181
181
|
version: '0'
|
182
182
|
requirements: []
|
183
|
-
|
183
|
+
rubyforge_project:
|
184
|
+
rubygems_version: 2.7.6
|
184
185
|
signing_key:
|
185
186
|
specification_version: 4
|
186
187
|
summary: A Danger plugin for linting Swift with SwiftLint.
|