rubocop-socketry 0.2.1 → 0.2.2
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 +6 -5
- 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: 1cd24ac3f11cf5e4b0fc32f54ca985578963b64ea7ccdf9d148996b75e0df68f
|
4
|
+
data.tar.gz: 57ca52a7c26e6f4b029b928ad0b6d5cae1dfab8e8c4105ebd084be7fe1a9732b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '059d5dd3fc0e62510c4966ea018c4ef15d4e8fd54827895441899c47ca38a4d408e9ef39795112f2c913f0af9012172a0339c3ac42de58f1273ca77e4762161a'
|
7
|
+
data.tar.gz: dd8b19f094ace1a5891d14877331d9eda98e45a08e326b2d1b87e96696987067bd369852d2887a4e4d4a1c63c38f549ed2d4e07899607da04e373ae924682465
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -94,14 +94,15 @@ module RuboCop
|
|
94
94
|
return false unless send_node.type == :send
|
95
95
|
|
96
96
|
if receiver = send_node.children.first
|
97
|
-
|
97
|
+
# Only structural node types handle their own indentation.
|
98
|
+
# These are nodes that create indentation contexts (arrays, hashes, classes, etc.)
|
99
|
+
# All other receivers (simple references, method calls, literals) should allow block indentation.
|
100
|
+
return [:array, :hash, :class, :module, :sclass, :def, :defs, :if, :while, :until, :for, :case, :kwbegin].include?(receiver.type)
|
98
101
|
end
|
99
102
|
end
|
100
103
|
|
101
104
|
return false
|
102
|
-
end
|
103
|
-
|
104
|
-
# Recursively walk the AST to build indentation deltas for block structures.
|
105
|
+
end # Recursively walk the AST to build indentation deltas for block structures.
|
105
106
|
# This method identifies nodes that should affect indentation and records the deltas.
|
106
107
|
# @parameter node [Parser::AST::Node] The current AST node to process.
|
107
108
|
# @parameter deltas [Hash(Integer, Integer)] The deltas hash to populate.
|
@@ -118,7 +119,7 @@ module RuboCop
|
|
118
119
|
deltas[location.last_line] -= 1
|
119
120
|
end
|
120
121
|
end
|
121
|
-
when :
|
122
|
+
when :array, :hash, :class, :module, :sclass, :def, :defs, :while, :until, :for, :case, :kwbegin
|
122
123
|
if location = node.location
|
123
124
|
deltas[location.line] += 1
|
124
125
|
deltas[location.last_line] -= 1
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|