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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/danger_plugin.rb +6 -14
  3. data/lib/version.rb +1 -1
  4. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8bd5ffb51afbb7836e76cfc8bd0c6a0df09f8344ad5bacd69bba455c8ab73513
4
- data.tar.gz: 1df24c142a6c18201aa6acc6f01a00bea3d0bec6b34082101a466ec7427bf903
3
+ metadata.gz: c5e0ae1a58601a02041afbbc49b06015411d234ad6ff0f541832af053b860a18
4
+ data.tar.gz: b13fa389a8c0e4de1d70cf4e87e6347577199aff4f4d338092436fb66217122f
5
5
  SHA512:
6
- metadata.gz: 55da087dc9bdace268e2ec965f3bbda84e8ae0af891b05f4404ca53e69056a44c257e03546c776dce379fcf451926905df9d17060cd8d59de51e00433ce24ac7
7
- data.tar.gz: fe2140a9eaed8f7a335241fde6eaa8d83895476d430f1541f4046a32f4e9bb23b31bfe8d783c41862b1d7add1812fcb123f6cd4ac01cecd25c94b14e78a996f1
6
+ metadata.gz: fea1c7af5a3e04955357c7f485fe8965509193df5152dbf6da935ffe3ca02de352790df418055d029b93c6f5b226c5bb1f06d4657313b98e244e47d8d1ef9116
7
+ data.tar.gz: 78db4cb509956091213c021025be9399e99734e47e9d51f700a93a18249c21f9acc296b7ab7a00e219ed5664355dc5ba43e2e602cf292829831be4320a3a9e47
@@ -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| file_exists?(excluded_paths, file) }.
231
+ reject { |file| excluded_paths_list.include?(file) }.
230
232
  # Accept files included on configuration
231
233
  select do |file|
232
- next true if included_paths.empty?
233
- file_exists?(included_paths, file)
234
- end
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
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DangerSwiftlint
4
- VERSION = '0.24.0'
4
+ VERSION = '0.24.1'
5
5
  SWIFTLINT_VERSION = '0.38.0'
6
6
  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.24.0
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-01-07 00:00:00.000000000 Z
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
- rubygems_version: 3.0.3
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.