haml_lint 0.49.2 → 0.50.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: 95c5137a04c59dbfc74fbc6648be0e502ae683e7bca5ff756bab9daf128243cb
4
- data.tar.gz: 4b7429295c1a07d73dd3fae058cafba55fdcab05a7113623a5db4d8aed4d7d11
3
+ metadata.gz: 3c9c0aec66473b6cb72108115d220aeea717f7a524e2c9853629ef17c3269f1a
4
+ data.tar.gz: 8f8d0d45078fe3249d2ac88740aae782a3e08a1f5e052ca6c9eed8757485cae6
5
5
  SHA512:
6
- metadata.gz: 0ab868d2be78c9a5fcebc8dd370687fa088deb4b537a64c3ff878e4a8bb4a057a9841c6b0f02914a9ebd791bf19a19e737d9f559e8b12f577c215695ff9b207d
7
- data.tar.gz: dbd373708eba214749fc1aa20e42d330c494ac1e3161a71527c956f405e845fb724d312dfa4bfae1bc3c080fe2d972fb75cf9915e1a1c0a808ba4b1ca963be15
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 line may have been too indented because of the "HL.out = " prefix
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
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Defines the gem version.
4
4
  module HamlLint
5
- VERSION = '0.49.2'
5
+ VERSION = '0.50.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.49.2
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-07-24 00:00:00.000000000 Z
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.6.0
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.0.3.1
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: []