haml_lint 0.36.0 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/haml_lint/linter/rubocop.rb +9 -3
- data/lib/haml_lint/version.rb +1 -1
- 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: a68b2308ea5b74941d9db3d5dfe22fa181bac800f89049c61db6ed533f381ca8
|
4
|
+
data.tar.gz: 78fc8f6241ad3cccace23abd95818ba461097ef4a11e51d5ec091de82de9e2ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 145a57a93ecf9960435ccd40fb02819e560bf4557be450494b5d3d1c920e65089925959b2377156172ed5cb10cbfbfd79a690b6b7c0ea99eb282ce2a3c7f5cd0
|
7
|
+
data.tar.gz: 81e45f26624c737b2cf750027aaca241d3c4c08ab0c05ad0233d802e75f4de803d5401ccf90c527416aec7987d00b1fe5a8ce8856c7bedba70a86243c5d3b26b
|
@@ -29,6 +29,14 @@ module HamlLint
|
|
29
29
|
|
30
30
|
private
|
31
31
|
|
32
|
+
# A single CLI instance is shared between files to avoid RuboCop
|
33
|
+
# having to repeatedly reload .rubocop.yml.
|
34
|
+
def self.rubocop_cli
|
35
|
+
# The ivar is stored on the class singleton rather than the Linter instance
|
36
|
+
# because it can't be Marshal.dump'd (as used by Parallel.map)
|
37
|
+
@rubocop_cli ||= ::RuboCop::CLI.new
|
38
|
+
end
|
39
|
+
|
32
40
|
# Executes RuboCop against the given Ruby code and records the offenses as
|
33
41
|
# lints.
|
34
42
|
#
|
@@ -36,8 +44,6 @@ module HamlLint
|
|
36
44
|
# @param source_map [Hash] map of Ruby code line numbers to original line
|
37
45
|
# numbers in the template
|
38
46
|
def find_lints(ruby, source_map)
|
39
|
-
rubocop = ::RuboCop::CLI.new
|
40
|
-
|
41
47
|
filename =
|
42
48
|
if document.file
|
43
49
|
"#{document.file}.rb"
|
@@ -46,7 +52,7 @@ module HamlLint
|
|
46
52
|
end
|
47
53
|
|
48
54
|
with_ruby_from_stdin(ruby) do
|
49
|
-
extract_lints_from_offenses(lint_file(
|
55
|
+
extract_lints_from_offenses(lint_file(self.class.rubocop_cli, filename), source_map)
|
50
56
|
end
|
51
57
|
end
|
52
58
|
|
data/lib/haml_lint/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: haml_lint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.37.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shane da Silva
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: haml
|
@@ -200,7 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
200
200
|
- !ruby/object:Gem::Version
|
201
201
|
version: '0'
|
202
202
|
requirements: []
|
203
|
-
rubygems_version: 3.1.
|
203
|
+
rubygems_version: 3.1.4
|
204
204
|
signing_key:
|
205
205
|
specification_version: 4
|
206
206
|
summary: HAML lint tool
|