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 +4 -4
- data/lib/haml_lint/ruby_extraction/chunk_extractor.rb +9 -10
- data/lib/haml_lint/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3a442bd9fc428d9e7bda54132972229c90aff2f29f1f1d9aa132f048f32d4aa1
|
|
4
|
+
data.tar.gz: 037ad2519ae3fe5a7666a3b3b7db3b8dc7c0c1ccdb54d99532b4f9efec5bf9e1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
#
|
|
644
|
-
# can fix them and map corrections back correctly.
|
|
645
|
-
|
|
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
|
-
|
|
651
|
-
lines[
|
|
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
|
|
data/lib/haml_lint/version.rb
CHANGED