slim_lint 0.25.0 → 0.26.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: 58c99ab50012a0f3475e6518e69bade743b55e6ed5eb4f5dd25a98ea1b7a617e
4
- data.tar.gz: 4593348af814f4bce1bd240d4982eec2acd9d4c7bbda5f5ccc231a3a51b8c148
3
+ metadata.gz: 007f6af5a15bd9858e04011b2fa0b604bc523148929b96852f44661b95fb1f66
4
+ data.tar.gz: 156ad192dc47014b863c9be9840f2280ee3174aa98bb96588b34017ffa7d470e
5
5
  SHA512:
6
- metadata.gz: 53ea008e7e03d7261af22c33e098be489096299117b9ec103406382568af8b8b3c10e0a77a3e97e9848c88a57d04d2f5a6b7998b48555d7ea205ceb136f95cdb
7
- data.tar.gz: 1e5e98f7d7e6eacc805a85451b8428f2f746b91b5b3433ce5262779d6bd9285b6db00e463c3d1b79912e9b93b677b5f12f0bf0e50613f284b8b482732fc7e552
6
+ metadata.gz: 30e9a1af1ba6b00cdc64037fa862eb2b40789e81f6d846183d84755a37396de87a7606ef30b8c11955ca3dc41fe691a157b5b2e75b737b73a03dfaecde8279c3
7
+ data.tar.gz: 2664127ced343842a71564c9be8b146f39a5d0374c48bb4c6f41fe764c021507542a81ddc24c9df3b12fab79d62408c2971179f9b57b02e5781846b31922c63d
@@ -9,14 +9,8 @@ module SlimLint
9
9
 
10
10
  on [:html, :tag, anything, [],
11
11
  [:slim, :output, anything, capture(:ruby, anything)]] do |sexp|
12
- # Process original slim code so that multi-line attributes become single line.
13
- # And store the correction line count
14
- source = merge_multiline_attributes(document.source_lines)
15
-
16
- # Fetch processed Slim code that contains an element with a control statement.
17
- line = source[sexp.line - 1][:line]
18
- # Apply correction to the line count.
19
- sexp.line += source[sexp.line - 1][:line_count]
12
+ # Fetch original Slim code that contains an element with a control statement.
13
+ line = document.source_lines[sexp.line - 1]
20
14
 
21
15
  # Remove any Ruby code, because our regexp below must not match inside Ruby.
22
16
  ruby = captures[:ruby]
@@ -26,29 +20,5 @@ module SlimLint
26
20
 
27
21
  report_lint(sexp, MESSAGE)
28
22
  end
29
-
30
- private
31
-
32
- def merge_multiline_attributes(source_lines)
33
- result = []
34
- memo = ''
35
- correction_line_count = 0
36
-
37
- source_lines.each do |line|
38
- memo += line.chomp('\\')
39
-
40
- # Lines ending in a backslash are concatenated with the next line
41
- # And count the number of lines to correct the sexp line count.
42
- if line.match?(/\\$/)
43
- correction_line_count += 1
44
- next
45
- end
46
-
47
- # Add merged rows and correction line count to the result and reset the memo
48
- result << { line: memo, line_count: correction_line_count }
49
- memo = ''
50
- end
51
- result
52
- end
53
23
  end
54
24
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Defines the gem version.
4
4
  module SlimLint
5
- VERSION = '0.25.0'
5
+ VERSION = '0.26.0'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slim_lint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.25.0
4
+ version: 0.26.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane da Silva
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-10 00:00:00.000000000 Z
11
+ date: 2024-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -149,7 +149,7 @@ homepage: https://github.com/sds/slim-lint
149
149
  licenses:
150
150
  - MIT
151
151
  metadata: {}
152
- post_install_message:
152
+ post_install_message:
153
153
  rdoc_options: []
154
154
  require_paths:
155
155
  - lib
@@ -164,8 +164,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
164
  - !ruby/object:Gem::Version
165
165
  version: '0'
166
166
  requirements: []
167
- rubygems_version: 3.0.3.1
168
- signing_key:
167
+ rubygems_version: 3.4.10
168
+ signing_key:
169
169
  specification_version: 4
170
170
  summary: Slim template linting tool
171
171
  test_files: []