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 +4 -4
- data/lib/erb_lint/linter.rb +1 -1
- data/lib/erb_lint/linter_config.rb +5 -2
- data/lib/erb_lint/runner.rb +1 -2
- data/lib/erb_lint/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84ee5b7d05405468648ea7ea174c2f8f57ec1e56490873e1e89e1e9f618df585
|
4
|
+
data.tar.gz: 3f7db38955673a6218517c8a031c97a9aed5a03fe8a1a9ed11c631cc8aa920f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e466a9178358d9400fa7a38cda19d1263efecaa1729391b1eea5c9dae2cf928686f97c5d84a0df85ba6774465f415ef94ec628cda8cc38834f2983fe525f41e7
|
7
|
+
data.tar.gz: 1f7cc9b5a8994d9378f70085d69e0012baa78c0da7896b366dfd32f894f05b4c3978c831eab31f6b209c9c4a42bfe36dcf0bb413a872a91a2bb22bfc79effc16
|
data/lib/erb_lint/linter.rb
CHANGED
@@ -53,9 +53,12 @@ module ERBLint
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
-
def excludes_file?(
|
56
|
+
def excludes_file?(absolute_filename, base_path)
|
57
57
|
exclude.any? do |path|
|
58
|
-
File.fnmatch?(path,
|
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
|
data/lib/erb_lint/runner.rb
CHANGED
@@ -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?(
|
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)
|
data/lib/erb_lint/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2022-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|