haml_lint 0.49.2 → 0.50.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/config/forced_rubocop_config.yml +9 -0
- data/lib/haml_lint/ruby_extraction/script_chunk.rb +10 -3
- data/lib/haml_lint/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c9c0aec66473b6cb72108115d220aeea717f7a524e2c9853629ef17c3269f1a
|
4
|
+
data.tar.gz: 8f8d0d45078fe3249d2ac88740aae782a3e08a1f5e052ca6c9eed8757485cae6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c3fb6e8ff1a81147eec8d1c1942759a5c19fe71419030762b26c33dbd5f93fc1f2a6c56d3adee626ad7bf22893dc2784bc45ce917d6a0fb95c5bd6f5722402b
|
7
|
+
data.tar.gz: ac0762a3b27f32c55f7167323f429728bd01816d3794af9a574e4af9ceda7c0d19c6d16c7c3d676be255564d98830f41143287cc721f22f64a4562bd00b70ed3
|
@@ -122,6 +122,15 @@ Style/FrozenStringLiteralComment:
|
|
122
122
|
Style/IfUnlessModifier:
|
123
123
|
AutoCorrect: false
|
124
124
|
|
125
|
+
<% if rubocop_version >= '1.37.0' %>
|
126
|
+
# This new cop can trigger on the here-doc we use for filters that contain interpolation.
|
127
|
+
# Ex:
|
128
|
+
# :javascript
|
129
|
+
# hello #{world} \. bad escape
|
130
|
+
Style/RedundantStringEscape:
|
131
|
+
Enabled: false
|
132
|
+
<% end %>
|
133
|
+
|
125
134
|
# In some case, this cop can cause a change in the spacing.
|
126
135
|
# In HAML 5.2, going from (absurd example for clarity):
|
127
136
|
# = 'abc' rescue nil
|
@@ -107,20 +107,22 @@ module HamlLint::RubyExtraction
|
|
107
107
|
statement_start_line_indexes = find_statement_start_line_indexes(to_ruby_lines)
|
108
108
|
|
109
109
|
continued_line_indent_delta = 2
|
110
|
+
continued_line_min_indent = 2
|
110
111
|
|
111
112
|
cur_line_start_index = nil
|
112
113
|
line_start_indexes_that_need_pipes = []
|
113
114
|
haml_output_prefix = first_output_haml_prefix
|
114
|
-
to_haml_lines = to_ruby_lines.map.with_index do |line, i|
|
115
|
+
to_haml_lines = to_ruby_lines.map.with_index do |line, i| # rubocop:disable Metrics/BlockLength
|
115
116
|
if line !~ /\S/
|
116
117
|
# whitespace or empty lines, we don't want any indentation
|
117
118
|
''
|
118
119
|
elsif statement_start_line_indexes.include?(i)
|
119
120
|
cur_line_start_index = i
|
120
121
|
code_start = line.index(/\S/)
|
122
|
+
continued_line_min_indent = code_start + 2
|
121
123
|
if line[code_start..].start_with?(script_output_ruby_prefix)
|
122
124
|
line = line.sub(script_output_ruby_prefix, '')
|
123
|
-
# The
|
125
|
+
# The next lines may have been too indented because of the "HL.out = " prefix
|
124
126
|
continued_line_indent_delta = 2 - script_output_ruby_prefix.size
|
125
127
|
new_line = "#{line[0...code_start]}#{haml_output_prefix} #{line[code_start..]}"
|
126
128
|
haml_output_prefix = '='
|
@@ -134,7 +136,12 @@ module HamlLint::RubyExtraction
|
|
134
136
|
line_start_indexes_that_need_pipes << cur_line_start_index
|
135
137
|
end
|
136
138
|
|
137
|
-
HamlLint::Utils.indent(line, continued_line_indent_delta)
|
139
|
+
line = HamlLint::Utils.indent(line, continued_line_indent_delta)
|
140
|
+
cur_indent = line[/^ */].size
|
141
|
+
if cur_indent < continued_line_min_indent
|
142
|
+
line = HamlLint::Utils.indent(line, continued_line_min_indent - cur_indent)
|
143
|
+
end
|
144
|
+
line
|
138
145
|
end
|
139
146
|
end
|
140
147
|
|
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.50.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: 2023-
|
11
|
+
date: 2023-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: haml
|
@@ -206,7 +206,7 @@ homepage: https://github.com/sds/haml-lint
|
|
206
206
|
licenses:
|
207
207
|
- MIT
|
208
208
|
metadata: {}
|
209
|
-
post_install_message:
|
209
|
+
post_install_message:
|
210
210
|
rdoc_options: []
|
211
211
|
require_paths:
|
212
212
|
- lib
|
@@ -214,15 +214,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
214
214
|
requirements:
|
215
215
|
- - ">="
|
216
216
|
- !ruby/object:Gem::Version
|
217
|
-
version: 2.
|
217
|
+
version: 2.7.0
|
218
218
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
219
219
|
requirements:
|
220
220
|
- - ">="
|
221
221
|
- !ruby/object:Gem::Version
|
222
222
|
version: '0'
|
223
223
|
requirements: []
|
224
|
-
rubygems_version: 3.
|
225
|
-
signing_key:
|
224
|
+
rubygems_version: 3.1.6
|
225
|
+
signing_key:
|
226
226
|
specification_version: 4
|
227
227
|
summary: HAML lint tool
|
228
228
|
test_files: []
|