rubocop-socketry 0.7.0 → 0.9.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/consistent_blank_line_indentation.rb +8 -3
- data/lib/rubocop/socketry/version.rb +2 -2
- data/license.md +1 -1
- data/readme.md +20 -0
- data/releases.md +20 -0
- data.tar.gz.sig +0 -0
- metadata +2 -2
- 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: bcb70c0ac2421d12d0a38c1e28338e67b3d57e1bef6d9d0121a00c6d042953d5
|
|
4
|
+
data.tar.gz: f6754cbd98784332753e86c9fc5261ba8214708f94c4d7ca2e7783f21520c956
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 696a82e7609dc56b42bb91bbd4a13d998c1bc64f65e227fc63dcba97e0f15740e883007e1766cc9b30e36ad30fca6e74b03d3aca10c0f23fce47dd87c9b1062a
|
|
7
|
+
data.tar.gz: 60e83ca55460e2af2dac385563f139edb7fbe4e0fc2b0b7de82c0110ca06c4360d6b4c639278a09f64be313ccfe4c442a3ecc4a7e024923e86487967ce5fc15a
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
|
@@ -61,6 +61,7 @@ module RuboCop
|
|
|
61
61
|
# Check blank lines for correct indentation:
|
|
62
62
|
if line.strip.empty?
|
|
63
63
|
expected_indentation = indentation(current_level)
|
|
64
|
+
|
|
64
65
|
if line != expected_indentation
|
|
65
66
|
add_offense(
|
|
66
67
|
source_range(processed_source.buffer, line_number, 0, line.length),
|
|
@@ -84,9 +85,13 @@ module RuboCop
|
|
|
84
85
|
# This method walks the AST to identify where indentation should increase or decrease.
|
|
85
86
|
# @returns [Hash(Integer, Integer)] A hash where keys are line numbers and values are deltas.
|
|
86
87
|
def build_indentation_deltas
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
Hash.new(0).tap do |deltas|
|
|
89
|
+
walk_ast_for_indentation(processed_source.ast, deltas)
|
|
90
|
+
|
|
91
|
+
# Cap deltas to a maximum of +1 or -1 per line to handle cases where
|
|
92
|
+
# multiple structures open/close on the same line (e.g., `[..., {`)
|
|
93
|
+
deltas.transform_values!{|delta| delta.nil? ? nil : delta.clamp(-1, 1)}
|
|
94
|
+
end
|
|
90
95
|
end
|
|
91
96
|
|
|
92
97
|
STRUCTURAL_NODES = [:array, :hash, :class, :module, :sclass, :def, :defs, :if, :if, :while, :until, :for, :case, :kwbegin, :regexp]
|
data/license.md
CHANGED
data/readme.md
CHANGED
|
@@ -27,6 +27,26 @@ 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.8.0
|
|
31
|
+
|
|
32
|
+
- Fixed `Layout/BlockDelimiterSpacing` to correctly distinguish between statement and expression contexts for blocks inside `do...end` blocks.
|
|
33
|
+
|
|
34
|
+
### v0.7.0
|
|
35
|
+
|
|
36
|
+
- Fixed `Layout/BlockDelimiterSpacing` to correctly handle blocks inside `do...end` blocks (statements should have space before braces).
|
|
37
|
+
|
|
38
|
+
### v0.6.1
|
|
39
|
+
|
|
40
|
+
- Refined `Style/GlobalExceptionVariables` to allow global exception variables in safe contexts:
|
|
41
|
+
- Inside rescue blocks (well-defined scope).
|
|
42
|
+
- In rescue modifiers (`expression rescue $!`).
|
|
43
|
+
- In method parameter defaults (`def foo(error = $!)`).
|
|
44
|
+
- Added specific warning for using global exception variables in ensure blocks (extremely unsafe).
|
|
45
|
+
|
|
46
|
+
### v0.6.0
|
|
47
|
+
|
|
48
|
+
- Extended `Layout/BlockDelimiterSpacing` to handle lambda and proc constructs (`->`, `lambda`, `proc`, `Proc.new`).
|
|
49
|
+
|
|
30
50
|
### v0.5.0
|
|
31
51
|
|
|
32
52
|
- Added `Style/GlobalExceptionVariables` cop to warn against using global exception variables (`$!`, `$@`, `$ERROR_INFO`, `$ERROR_POSITION`).
|
data/releases.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Releases
|
|
2
2
|
|
|
3
|
+
## v0.8.0
|
|
4
|
+
|
|
5
|
+
- Fixed `Layout/BlockDelimiterSpacing` to correctly distinguish between statement and expression contexts for blocks inside `do...end` blocks.
|
|
6
|
+
|
|
7
|
+
## v0.7.0
|
|
8
|
+
|
|
9
|
+
- Fixed `Layout/BlockDelimiterSpacing` to correctly handle blocks inside `do...end` blocks (statements should have space before braces).
|
|
10
|
+
|
|
11
|
+
## v0.6.1
|
|
12
|
+
|
|
13
|
+
- Refined `Style/GlobalExceptionVariables` to allow global exception variables in safe contexts:
|
|
14
|
+
- Inside rescue blocks (well-defined scope).
|
|
15
|
+
- In rescue modifiers (`expression rescue $!`).
|
|
16
|
+
- In method parameter defaults (`def foo(error = $!)`).
|
|
17
|
+
- Added specific warning for using global exception variables in ensure blocks (extremely unsafe).
|
|
18
|
+
|
|
19
|
+
## v0.6.0
|
|
20
|
+
|
|
21
|
+
- Extended `Layout/BlockDelimiterSpacing` to handle lambda and proc constructs (`->`, `lambda`, `proc`, `Proc.new`).
|
|
22
|
+
|
|
3
23
|
## v0.5.0
|
|
4
24
|
|
|
5
25
|
- Added `Style/GlobalExceptionVariables` cop to warn against using global exception variables (`$!`, `$@`, `$ERROR_INFO`, `$ERROR_POSITION`).
|
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.
|
|
4
|
+
version: 0.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Samuel Williams
|
|
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
103
103
|
- !ruby/object:Gem::Version
|
|
104
104
|
version: '0'
|
|
105
105
|
requirements: []
|
|
106
|
-
rubygems_version: 4.0.
|
|
106
|
+
rubygems_version: 4.0.6
|
|
107
107
|
specification_version: 4
|
|
108
108
|
summary: RuboCop rules for Socketry projects
|
|
109
109
|
test_files: []
|
metadata.gz.sig
CHANGED
|
Binary file
|