rubocop-socketry 0.9.0 → 0.10.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
- checksums.yaml.gz.sig +0 -0
- data/lib/rubocop/socketry/layout/block_delimiter_spacing.rb +19 -3
- data/lib/rubocop/socketry/version.rb +1 -1
- data/readme.md +10 -0
- data/releases.md +10 -0
- 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: 36f3f182b831bb4fbae7b9eddb5504cecb05d10616de4b25307d83baa9e578e1
|
|
4
|
+
data.tar.gz: a12e31b5ad9834c890ecc20afd9d443ba0b6a760078ee4a5550e63b731e45c4e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ffe0bfaa3a740753d590f0852f87374976c0a76e931d0184f63fc553f37a4c5547838d6ab1103f658fecdc4cc3c2a7c30502e813f7987e0dad25d3f4e86ac74f
|
|
7
|
+
data.tar.gz: c1b77f49c5bdb0fee928666a1f9436b37ae2d38f35cc17fc5aa274034cd61a31002d7435caf9d4e308fe49ed871e28987d3a9355a255c00c9ec1c06047d4afbe
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
|
@@ -86,9 +86,25 @@ module RuboCop
|
|
|
86
86
|
parent = node.parent
|
|
87
87
|
return false unless parent
|
|
88
88
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
case parent.type
|
|
90
|
+
when :begin
|
|
91
|
+
# Sequence of statements — this is a top-level statement.
|
|
92
|
+
false
|
|
93
|
+
when :block, :numblock
|
|
94
|
+
# When a block is the sole body statement of an outer block there is no
|
|
95
|
+
# :begin wrapper; the outer block node is the direct parent.
|
|
96
|
+
# Only the body slot counts as a statement context, and only when the
|
|
97
|
+
# outer block itself spans multiple lines (e.g. a do…end describe/context
|
|
98
|
+
# block). Single-line inline blocks (`foo {bar{baz}}`) keep their
|
|
99
|
+
# compact style.
|
|
100
|
+
parent.body == node ? !parent.multiline? : true
|
|
101
|
+
when :def, :defs, :class, :module, :sclass
|
|
102
|
+
# Same situation for method / class / module bodies with a single
|
|
103
|
+
# statement — they are always multi-line in practice.
|
|
104
|
+
parent.body != node
|
|
105
|
+
else
|
|
106
|
+
true
|
|
107
|
+
end
|
|
92
108
|
end
|
|
93
109
|
|
|
94
110
|
# Check that there's no space before the opening brace for lambdas
|
data/readme.md
CHANGED
|
@@ -27,6 +27,16 @@ Layout/ConsistentBlankLineIndentation:
|
|
|
27
27
|
|
|
28
28
|
Please see the [project releases](https://socketry.github.io/rubocop-socketry/releases/index) for all releases.
|
|
29
29
|
|
|
30
|
+
### v0.10.0
|
|
31
|
+
|
|
32
|
+
- Fixed `Layout/BlockDelimiterSpacing` to correctly treat a block as a statement (requiring space before `{`) when it is the sole body of a multi-line outer block or method/class/module definition. Previously, the absence of a `:begin` wrapper in the AST caused such blocks (e.g. `Async {foo}` or `let(:bar) {baz}` inside a `describe`/`context` block) to be misclassified as expression-context and have their space incorrectly removed.
|
|
33
|
+
- Single-line inline outer blocks (e.g. `foo {bar{baz}}`) continue to use compact style with no space before the inner brace.
|
|
34
|
+
|
|
35
|
+
### v0.9.0
|
|
36
|
+
|
|
37
|
+
- Fixed `Layout/ConsistentBlankLineIndentation` to correctly handle files containing multiple blocks.
|
|
38
|
+
- Expanded `Layout/BlockDelimiterSpacing` test coverage to include method chaining scenarios.
|
|
39
|
+
|
|
30
40
|
### v0.8.0
|
|
31
41
|
|
|
32
42
|
- Fixed `Layout/BlockDelimiterSpacing` to correctly distinguish between statement and expression contexts for blocks inside `do...end` blocks.
|
data/releases.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Releases
|
|
2
2
|
|
|
3
|
+
## v0.10.0
|
|
4
|
+
|
|
5
|
+
- Fixed `Layout/BlockDelimiterSpacing` to correctly treat a block as a statement (requiring space before `{`) when it is the sole body of a multi-line outer block or method/class/module definition. Previously, the absence of a `:begin` wrapper in the AST caused such blocks (e.g. `Async {foo}` or `let(:bar) {baz}` inside a `describe`/`context` block) to be misclassified as expression-context and have their space incorrectly removed.
|
|
6
|
+
- Single-line inline outer blocks (e.g. `foo {bar{baz}}`) continue to use compact style with no space before the inner brace.
|
|
7
|
+
|
|
8
|
+
## v0.9.0
|
|
9
|
+
|
|
10
|
+
- Fixed `Layout/ConsistentBlankLineIndentation` to correctly handle files containing multiple blocks.
|
|
11
|
+
- Expanded `Layout/BlockDelimiterSpacing` test coverage to include method chaining scenarios.
|
|
12
|
+
|
|
3
13
|
## v0.8.0
|
|
4
14
|
|
|
5
15
|
- Fixed `Layout/BlockDelimiterSpacing` to correctly distinguish between statement and expression contexts for blocks inside `do...end` blocks.
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
|
Binary file
|