haml_lint 0.70.0 → 0.72.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b1a2ca29afbb8764cf0932d560901cd9b2af889701386bf398a464b94d331bc
4
- data.tar.gz: 82e6c7e54a0bd3c1d8f4159893af0bfb0c16c81dca993a9aaf6e875544d79269
3
+ metadata.gz: 3a442bd9fc428d9e7bda54132972229c90aff2f29f1f1d9aa132f048f32d4aa1
4
+ data.tar.gz: 037ad2519ae3fe5a7666a3b3b7db3b8dc7c0c1ccdb54d99532b4f9efec5bf9e1
5
5
  SHA512:
6
- metadata.gz: 754e6ad2de8723a619eb4b24204e8231fead3443c35080c073fbc8e68a15cadace16eb5635c86bea78eee28831de1ef4ba8afadc4e22156f4c6edd6155df42b7
7
- data.tar.gz: f533a65a21402e75970431c7e82b7b82f111b12d584568b8fd38ff25fd21d258c76e81d562c7b23d439fe1055f01f95897fbc1bc787cc599b8430baa30260857
6
+ metadata.gz: 2b11a6a2f915800c5ea089f858cfe5ceeabe2e7c5ca67aea6344ea0c668dce353c74b00bbde4dac47aebb4113a9cba45c0cf68a991f78981aea5413d73a73807
7
+ data.tar.gz: a78db311971e4c9578d1f5ed25d9a610c1f03d44c3584e6cb8b9b6d2499e9a50af7dcef72fdf58685a49b66b09169ec7481c7778c5cdfabffa3ca7b01cf48a99
@@ -639,19 +639,18 @@ module HamlLint::RubyExtraction
639
639
  lines = lines.dup
640
640
  wrapping_prefix = 'W' * (wrap_depth - 1) + '('
641
641
 
642
- # Strip leading/trailing space only when linting (not autocorrecting) to avoid
643
- # SpaceInsideParens violations. During autocorrect, preserve spaces so RuboCop
644
- # can fix them and map corrections back correctly.
645
- if autocorrect
646
- lines[0] = wrapping_prefix + lines[0]
647
- lines[-1] = lines[-1] + ')'
648
- else
642
+ # Strip leading/trailing space only when linting (not autocorrecting) to avoid SpaceInsideParens violations.
643
+ # Preserve spaces for fully nested attribute hashes that need no adjustment.
644
+ # Preserve spaces during autocorrect, so RuboCop can fix them and map corrections back correctly.
645
+ unless lines[0] =~ /^\s*$/ || autocorrect
649
646
  leading_spaces = lines[0][/^\s*/].length
650
- wrapping_prefix = 'W' * (wrap_depth - 1 + leading_spaces) + '('
651
- lines[0] = wrapping_prefix + lines[0].lstrip
652
- lines[-1] = lines[-1].rstrip + ')'
647
+ lines = lines.map { |line| line.gsub(/^\s{,#{leading_spaces}}/, '') }
648
+ lines[-1] = lines[-1].gsub(/\s+\z/, '')
653
649
  end
654
650
 
651
+ lines[0] = wrapping_prefix + lines[0]
652
+ lines[-1] = lines[-1] + ')'
653
+
655
654
  lines
656
655
  end
657
656
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Defines the gem version.
4
4
  module HamlLint
5
- VERSION = '0.70.0'
5
+ VERSION = '0.72.0'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haml_lint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.70.0
4
+ version: 0.72.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane da Silva