haml_lint 0.36.0 → 0.37.0

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: 6d2be98b8d977ca5ccbcb29baf2f0fd8d1b527d44b3a9929a55c538df46d5a82
4
- data.tar.gz: 7b5a39a010d171a7487b90c4cf1be92ed9d62f6dc2c223fe5e81bb2e75652be8
3
+ metadata.gz: a68b2308ea5b74941d9db3d5dfe22fa181bac800f89049c61db6ed533f381ca8
4
+ data.tar.gz: 78fc8f6241ad3cccace23abd95818ba461097ef4a11e51d5ec091de82de9e2ac
5
5
  SHA512:
6
- metadata.gz: 16061fce86f6da8868f2f78b19b92e8184efb80e6f73fd2b0101359466c2123abea947e7cb3b1729b005ef6144ddac5604e7ac28a4646b04c3d213c6ceaf052f
7
- data.tar.gz: a355b4893f8a7ada12d66ab61b25150a032b2cdfb5f69a9f3dfbf71f2b338bd946ed164e6b614a2dc6e647be5785d3268353f82a30f31b9efa5d4d4c90b6b356
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(rubocop, filename), source_map)
55
+ extract_lints_from_offenses(lint_file(self.class.rubocop_cli, filename), source_map)
50
56
  end
51
57
  end
52
58
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Defines the gem version.
4
4
  module HamlLint
5
- VERSION = '0.36.0'
5
+ VERSION = '0.37.0'
6
6
  end
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.36.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: 2020-10-01 00:00:00.000000000 Z
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.1
203
+ rubygems_version: 3.1.4
204
204
  signing_key:
205
205
  specification_version: 4
206
206
  summary: HAML lint tool