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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/rubocop/socketry/layout/consistent_blank_line_indentation.rb +5 -20
- data/lib/rubocop/socketry/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdf96e461ba72f91f680ae3a68c72b8a3147c3f3643b1ba2ac78b4faa9285ebd
|
4
|
+
data.tar.gz: 541814b98f28c0ccb78378c5752df9d1093afd7e41881e7ba18ad804cc1538da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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,
|
104
|
+
# For blocks, use the actual block begin/end boundaries, not the full location
|
120
105
|
if location = node.location
|
121
|
-
|
122
|
-
deltas[location.line] += 1
|
123
|
-
deltas[location.
|
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
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|