erb_lint 0.1.2 → 0.1.3

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
  SHA256:
3
- metadata.gz: 97583caf4e48c7c5b8a6d2e1bf4c17add7bac9693ef6032be0fb22f9d46f4fa4
4
- data.tar.gz: 3d1dba73d37680a0339936a12a6c2a048b473a7c9077518f54edd1aa037c4ce5
3
+ metadata.gz: 84ee5b7d05405468648ea7ea174c2f8f57ec1e56490873e1e89e1e9f618df585
4
+ data.tar.gz: 3f7db38955673a6218517c8a031c97a9aed5a03fe8a1a9ed11c631cc8aa920f7
5
5
  SHA512:
6
- metadata.gz: a043d8859ef059100dd809112f8768908f2ec8df59a52991c09ea995d2181aeabf06c105b3d12eef13ddbbed15d220edbdd88941fe6a55a23fd5c600aa55623d
7
- data.tar.gz: 805102e771aac93e6a75017dde3f88deee018dceff3c8c57f2ddcdea88f97f241980efc17885999989733952e771e0538a75eaf67566499e61534c9e64476f75
6
+ metadata.gz: e466a9178358d9400fa7a38cda19d1263efecaa1729391b1eea5c9dae2cf928686f97c5d84a0df85ba6774465f415ef94ec628cda8cc38834f2983fe525f41e7
7
+ data.tar.gz: 1f7cc9b5a8994d9378f70085d69e0012baa78c0da7896b366dfd32f894f05b4c3978c831eab31f6b209c9c4a42bfe36dcf0bb413a872a91a2bb22bfc79effc16
@@ -46,7 +46,7 @@ module ERBLint
46
46
  end
47
47
 
48
48
  def excludes_file?(filename)
49
- @config.excludes_file?(filename)
49
+ @config.excludes_file?(filename, @file_loader.base_path)
50
50
  end
51
51
 
52
52
  def run(_processed_source)
@@ -53,9 +53,12 @@ module ERBLint
53
53
  end
54
54
  end
55
55
 
56
- def excludes_file?(filename)
56
+ def excludes_file?(absolute_filename, base_path)
57
57
  exclude.any? do |path|
58
- File.fnmatch?(path, filename)
58
+ return true if File.fnmatch?(path, absolute_filename)
59
+
60
+ relative_path = absolute_filename.delete_prefix("#{base_path}/")
61
+ File.fnmatch?(path, relative_path)
59
62
  end
60
63
  end
61
64
  end
@@ -18,9 +18,8 @@ module ERBLint
18
18
  end
19
19
 
20
20
  def run(processed_source)
21
- relative_filename = processed_source.filename.delete_prefix("#{@file_loader.base_path}/")
22
21
  @linters
23
- .reject { |linter| linter.excludes_file?(relative_filename) }
22
+ .reject { |linter| linter.excludes_file?(processed_source.filename) }
24
23
  .each do |linter|
25
24
  linter.run(processed_source)
26
25
  @offenses.concat(linter.offenses)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ERBLint
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erb_lint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Chan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-06-15 00:00:00.000000000 Z
11
+ date: 2022-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport