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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bcb70c0ac2421d12d0a38c1e28338e67b3d57e1bef6d9d0121a00c6d042953d5
4
- data.tar.gz: f6754cbd98784332753e86c9fc5261ba8214708f94c4d7ca2e7783f21520c956
3
+ metadata.gz: 36f3f182b831bb4fbae7b9eddb5504cecb05d10616de4b25307d83baa9e578e1
4
+ data.tar.gz: a12e31b5ad9834c890ecc20afd9d443ba0b6a760078ee4a5550e63b731e45c4e
5
5
  SHA512:
6
- metadata.gz: 696a82e7609dc56b42bb91bbd4a13d998c1bc64f65e227fc63dcba97e0f15740e883007e1766cc9b30e36ad30fca6e74b03d3aca10c0f23fce47dd87c9b1062a
7
- data.tar.gz: 60e83ca55460e2af2dac385563f139edb7fbe4e0fc2b0b7de82c0110ca06c4360d6b4c639278a09f64be313ccfe4c442a3ecc4a7e024923e86487967ce5fc15a
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
- # If parent is a :begin node (sequence of statements), this is top-level
90
- # Otherwise, it's part of an expression or nested context
91
- parent.type != :begin
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
@@ -5,6 +5,6 @@
5
5
 
6
6
  module RuboCop
7
7
  module Socketry
8
- VERSION = "0.9.0"
8
+ VERSION = "0.10.0"
9
9
  end
10
10
  end
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
@@ -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.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file