rubocop-socketry 0.1.1 → 0.1.3

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: abb38c5191391101e2c6e33ecbf2461381c211efeb61b1a564603d6a7cdee934
4
- data.tar.gz: 7f306f0e881d6a8fac183ae0190a8455fc5b9358f4d6cdf2cd4879255069ca26
3
+ metadata.gz: 7fb604bbc488fb077b40f6d1145e16677de0e92eab7ec9eb1c573f8cc5f5b8ab
4
+ data.tar.gz: 489ce0952ff38f34fd2a502183c32595bfc2db4a8c4b480171e3524cd50a7e4d
5
5
  SHA512:
6
- metadata.gz: edb6cf3cc36629fac5db3f5c36ecbcd22692677b12bc72937e413f211139efdbd1718d363b28c101339e32328965a98e7497f2c8f92fd3128521ce5ddc2eee03
7
- data.tar.gz: 96dc733c3cdb27b03d50d65ae033d12299a298db28c6cd0fac00ab398e18179597a22fc7aeb35c49d9aff7ec15700b8ad0596cdec8d58a5318c9ab6ee50ca1be
6
+ metadata.gz: 33e81903ded45555f1089f11dea5dae07f56c90e390d81f20b07184e3a8ca9f79de5af2f69528798e2857f5802c0d273158947f295fbc6ffab43b8121908f338
7
+ data.tar.gz: f33baa3486895e9388b1383635197427d3714f7af60199b544d84e5f5678081c4e3090ae22b55af14b4bbb356898eda8d3a60c4968d94d17973cfd7d9491f6bd
checksums.yaml.gz.sig CHANGED
Binary file
@@ -52,6 +52,11 @@ module RuboCop
52
52
 
53
53
  processed_source.lines.each_with_index do |line, index|
54
54
  line_number = index + 1
55
+
56
+ unless delta = indentation_deltas[line_number]
57
+ # Skip this line (e.g., non-squiggly heredoc content):
58
+ next
59
+ end
55
60
 
56
61
  # Check blank lines for correct indentation:
57
62
  if line.strip.empty?
@@ -69,8 +74,6 @@ module RuboCop
69
74
  end
70
75
  end
71
76
 
72
- # Apply indentation delta for this line:
73
- delta = indentation_deltas[line_number] || 0
74
77
  current_level += delta
75
78
  end
76
79
  end
@@ -99,6 +102,21 @@ module RuboCop
99
102
  deltas[location.line] += 1
100
103
  deltas[location.last_line] -= 1
101
104
  end
105
+ when :dstr
106
+ if location = node.location
107
+ if location.is_a?(Parser::Source::Map::Heredoc) and body = location.heredoc_body
108
+ if location.expression.source.start_with?("<<~")
109
+ # Squiggly heredoc - indentation is significant, add deltas
110
+ deltas[body.line] += 1
111
+ deltas[body.last_line] -= 1
112
+ else
113
+ # Non-squiggly heredoc - ignore indentation on these lines
114
+ (body.line..body.last_line).each do |line|
115
+ deltas[line] = nil
116
+ end
117
+ end
118
+ end
119
+ end
102
120
  end
103
121
 
104
122
  node.children.each do |child|
@@ -5,6 +5,6 @@
5
5
 
6
6
  module RuboCop
7
7
  module Socketry
8
- VERSION = "0.1.1"
8
+ VERSION = "0.1.3"
9
9
  end
10
10
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-socketry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file