rubocop-socketry 0.2.3 → 0.2.4

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: b25ad4b5bdd6aeaf9f0b41a518f8c31db3ead2ab410f837827f2bc92d422954b
4
- data.tar.gz: b405f44e0c5e435864b035fd24ff5bf56cfa9dc75b7f920b05db906856791f32
3
+ metadata.gz: bdf96e461ba72f91f680ae3a68c72b8a3147c3f3643b1ba2ac78b4faa9285ebd
4
+ data.tar.gz: 541814b98f28c0ccb78378c5752df9d1093afd7e41881e7ba18ad804cc1538da
5
5
  SHA512:
6
- metadata.gz: 9ebc654b95f9ff26fc351afc98a9b2250501b05b3a03e882d27c5a2deb689d986f9619f95f520ea1a1a38c638311b90351b1478339f03d0e14a087180f9dd482
7
- data.tar.gz: 8a21062e6208ea01b33727343930a50aa7be89d1bf83eaaeb8eb741ac9f4148a46e51b788e0af3360480ca648b2ff012d51d56e9fafcc997bbb336129a8b422f
6
+ metadata.gz: dd942adb6f5fa81ec37d5e3898c2dc736d4a9f9d2530d8f3e08fbfde11decec5cc9f81b40525d8a16370f98de48ad254fa3a20a505dd8e008413154fbe324a00
7
+ data.tar.gz: 2d33e2859470e2a66df2d58b0b5ced439de091b1d11b14261864f7f0f97d9726a75fa693d066d8ba4bdd51b5c63c808bef8af74fce6e86554436e7fec37e052a
checksums.yaml.gz.sig CHANGED
Binary file
@@ -89,22 +89,7 @@ module RuboCop
89
89
  deltas
90
90
  end
91
91
 
92
- STRUCTURAL_NODES = [:array, :hash, :class, :module, :sclass, :def, :defs, :if, :while, :until, :for, :case, :kwbegin]
93
-
94
- def receiver_handles_indentation(node)
95
- if send_node = node.children.first
96
- return false unless send_node.type == :send
97
-
98
- if receiver = send_node.children.first
99
- # Only structural node types handle their own indentation.
100
- # These are nodes that create indentation contexts (arrays, hashes, classes, etc.)
101
- # All other receivers (simple references, method calls, literals) should allow block indentation.
102
- return STRUCTURAL_NODES.include?(receiver.type)
103
- end
104
- end
105
-
106
- return false
107
- end
92
+ STRUCTURAL_NODES = [:array, :hash, :class, :module, :sclass, :def, :defs, :if, :if, :while, :until, :for, :case, :kwbegin]
108
93
 
109
94
  # Recursively walk the AST to build indentation deltas for block structures.
110
95
  # This method identifies nodes that should affect indentation and records the deltas.
@@ -116,11 +101,11 @@ module RuboCop
116
101
 
117
102
  case node.type
118
103
  when :block
119
- # For blocks, we need to be careful about method receiver collections
104
+ # For blocks, use the actual block begin/end boundaries, not the full location
120
105
  if location = node.location
121
- unless receiver_handles_indentation(node)
122
- deltas[location.line] += 1
123
- deltas[location.last_line] -= 1
106
+ if location.begin && location.end
107
+ deltas[location.begin.line] += 1
108
+ deltas[location.end.line] -= 1
124
109
  end
125
110
  end
126
111
  when :if
@@ -5,6 +5,6 @@
5
5
 
6
6
  module RuboCop
7
7
  module Socketry
8
- VERSION = "0.2.3"
8
+ VERSION = "0.2.4"
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.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file