runger_style 5.1.0 → 5.2.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
- data/.ruby-version +1 -1
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +10 -10
- data/lib/runger_style/cops/multiline_method_arguments_line_breaks.rb +0 -2
- data/lib/runger_style/monkeypatches/multiline_expression_indentation.rb +52 -0
- data/lib/runger_style/version.rb +1 -1
- data/rulesets/default.yml +3 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c1a9e8956388dd4c7bc41db41aecca76e135a97b5336b2fe8d80f746d739ae4
|
4
|
+
data.tar.gz: c66efecdc5226372bc5e793c4724455bbd3092e9105dd2ca484047e9cc8d2fcc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1788c21bc096a894b9db2224036743be18127a3829d5b4aacd541ff12b8b049b6fe7e69ba47efe2c4222b91cee83575818f3c5a1224ba47c0ecc3574520dbffd
|
7
|
+
data.tar.gz: 335d216ad40429163a7c5aae3490be47f418798ec4a6c0a490b2aba85001af29296f11826c588180953925c0b302826688ea3297f5db50c1dacdb2c2fcd7d076
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.4.
|
1
|
+
3.4.2
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## v5.2.0 (2025-02-16)
|
2
|
+
- Disable `Metrics/CyclomaticComplexity` cop.
|
3
|
+
- Monkeypatch `RuboCop::Cop::MultilineExpressionIndentation` to require (via `Layout/MultilineMethodCallIndentation`) the indentation of a chained multiline method call used as a method argument.
|
4
|
+
- Change `Layout/MultilineMethodCallIndentation` `EnforcedStyle` from `indented` to `indented_relative_to_receiver`, monkeypatch `RuboCop::Cop::Layout::MultilineMethodCallIndentation`, and further monkeypatch `RuboCop::Cop::MultilineExpressionIndentation` in order to avoid undesirable `Layout/MultilineMethodCallIndentation` autocorrections.
|
5
|
+
|
1
6
|
## v5.1.0 (2025-02-12)
|
2
7
|
- Monkeypatch `RuboCop::Cop::MultilineElementLineBreaks` so that arrays will be considered multiline if the array brackets are on separate lines (even if all elements are on a single line).
|
3
8
|
|
data/Gemfile.lock
CHANGED
@@ -9,7 +9,7 @@ GIT
|
|
9
9
|
PATH
|
10
10
|
remote: .
|
11
11
|
specs:
|
12
|
-
runger_style (5.
|
12
|
+
runger_style (5.2.0)
|
13
13
|
prism (>= 0.24.0)
|
14
14
|
rubocop (>= 1.68.0)
|
15
15
|
|
@@ -37,7 +37,7 @@ GEM
|
|
37
37
|
concurrent-ruby (1.3.5)
|
38
38
|
connection_pool (2.5.0)
|
39
39
|
date (3.4.1)
|
40
|
-
diff-lcs (1.
|
40
|
+
diff-lcs (1.6.0)
|
41
41
|
drb (2.2.1)
|
42
42
|
i18n (1.14.7)
|
43
43
|
concurrent-ruby (~> 1.0)
|
@@ -48,7 +48,7 @@ GEM
|
|
48
48
|
reline (>= 0.4.2)
|
49
49
|
json (2.10.1)
|
50
50
|
language_server-protocol (3.17.0.4)
|
51
|
-
logger (1.6.
|
51
|
+
logger (1.6.6)
|
52
52
|
memo_wise (1.10.0)
|
53
53
|
method_source (1.1.0)
|
54
54
|
minitest (5.25.4)
|
@@ -130,7 +130,7 @@ GEM
|
|
130
130
|
slop (~> 4.8)
|
131
131
|
securerandom (0.4.1)
|
132
132
|
slop (4.10.1)
|
133
|
-
stringio (3.1.
|
133
|
+
stringio (3.1.3)
|
134
134
|
tzinfo (2.0.6)
|
135
135
|
concurrent-ruby (~> 1.0)
|
136
136
|
unicode-display_width (3.1.4)
|
@@ -168,14 +168,14 @@ CHECKSUMS
|
|
168
168
|
concurrent-ruby (1.3.5) sha256=813b3e37aca6df2a21a3b9f1d497f8cbab24a2b94cab325bffe65ee0f6cbebc6
|
169
169
|
connection_pool (2.5.0) sha256=233b92f8d38e038c1349ccea65dd3772727d669d6d2e71f9897c8bf5cd53ebfc
|
170
170
|
date (3.4.1) sha256=bf268e14ef7158009bfeaec40b5fa3c7271906e88b196d958a89d4b408abe64f
|
171
|
-
diff-lcs (1.
|
171
|
+
diff-lcs (1.6.0) sha256=a1e7f7b272962f8fc769358ad00001b87cdcf32ba349d6c70c6b544613d2da2e
|
172
172
|
drb (2.2.1) sha256=e9d472bf785f558b96b25358bae115646da0dbfd45107ad858b0bc0d935cb340
|
173
173
|
i18n (1.14.7) sha256=ceba573f8138ff2c0915427f1fc5bdf4aa3ab8ae88c8ce255eb3ecf0a11a5d0f
|
174
174
|
io-console (0.8.0) sha256=cd6a9facbc69871d69b2cb8b926fc6ea7ef06f06e505e81a64f14a470fddefa2
|
175
175
|
irb (1.15.1) sha256=d9bca745ac4207a8b728a52b98b766ca909b86ff1a504bcde3d6f8c84faae890
|
176
176
|
json (2.10.1) sha256=ddc88ad91a1baf3f0038c174f253af3b086d30dc74db17ca4259bbde982f94dc
|
177
177
|
language_server-protocol (3.17.0.4) sha256=c484626478664fd13482d8180947c50a8590484b1258b99b7aedb3b69df89669
|
178
|
-
logger (1.6.
|
178
|
+
logger (1.6.6) sha256=dd618d24e637715472732e7eed02e33cfbdf56deaad225edd0f1f89d38024017
|
179
179
|
memo_wise (1.10.0) sha256=ae40ff8e7799697ff5d59d739b8766f76be22eba69c7c8468edb42ab83c94c3f
|
180
180
|
method_source (1.1.0) sha256=181301c9c45b731b4769bc81e8860e72f9161ad7d66dd99103c9ab84f560f5c5
|
181
181
|
minitest (5.25.4) sha256=9cf2cae25ac4dfc90c988ebc3b917f53c054978b673273da1bd20bcb0778f947
|
@@ -211,17 +211,17 @@ CHECKSUMS
|
|
211
211
|
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
|
212
212
|
runger_byebug (11.4.0) sha256=569e22ba2215f57e7f69e145fcb63be401e29fcd312f7936d813e12d0c7bbee6
|
213
213
|
runger_release_assistant (2.0.0) sha256=f4f5708291eaeef1b881208f87a494877fe768739d6e96b7293fc335b28a3865
|
214
|
-
runger_style (5.
|
214
|
+
runger_style (5.2.0)
|
215
215
|
securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
|
216
216
|
slop (4.10.1) sha256=844322b5ffcf17ed4815fdb173b04a20dd82b4fd93e3744c88c8fafea696d9c7
|
217
|
-
stringio (3.1.
|
217
|
+
stringio (3.1.3) sha256=1eedb8369ee99a9a0edfdacea95c72d647feb8ce844427c150bd641e1797abc8
|
218
218
|
tzinfo (2.0.6) sha256=8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b
|
219
219
|
unicode-display_width (3.1.4) sha256=8caf2af1c0f2f07ec89ef9e18c7d88c2790e217c482bfc78aaa65eadd5415ac1
|
220
220
|
unicode-emoji (4.0.4) sha256=2c2c4ef7f353e5809497126285a50b23056cc6e61b64433764a35eff6c36532a
|
221
221
|
uri (1.0.2) sha256=b303504ceb7e5905771fa7fa14b649652fa949df18b5880d69cfb12494791e27
|
222
222
|
|
223
223
|
RUBY VERSION
|
224
|
-
ruby 3.4.
|
224
|
+
ruby 3.4.2p28
|
225
225
|
|
226
226
|
BUNDLED WITH
|
227
|
-
2.6.
|
227
|
+
2.6.3
|
@@ -8,7 +8,6 @@ module RungerStyle # rubocop:disable Style/ClassAndModuleChildren
|
|
8
8
|
MSG = 'Each argument in a multi-line method call must start on a separate line.'
|
9
9
|
|
10
10
|
# rubocop:disable Metrics/PerceivedComplexity
|
11
|
-
# rubocop:disable Metrics/CyclomaticComplexity
|
12
11
|
def on_send(node)
|
13
12
|
if node.arguments? && multiline_method_call?(node)
|
14
13
|
# When a method call uses keyword arguments without braces,
|
@@ -35,7 +34,6 @@ module RungerStyle # rubocop:disable Style/ClassAndModuleChildren
|
|
35
34
|
end
|
36
35
|
end
|
37
36
|
end
|
38
|
-
# rubocop:enable Metrics/CyclomaticComplexity
|
39
37
|
# rubocop:enable Metrics/PerceivedComplexity
|
40
38
|
|
41
39
|
private
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RungerStyle::MultilineExpressionIndentationPatches
|
4
|
+
private
|
5
|
+
|
6
|
+
def left_hand_side(lhs)
|
7
|
+
while (
|
8
|
+
lhs.parent&.call_type? &&
|
9
|
+
lhs.parent.loc.dot &&
|
10
|
+
!lhs.parent.assignment_method? &&
|
11
|
+
!(lhs.parent.parenthesized_call? && lhs.parent.arguments.include?(lhs))
|
12
|
+
)
|
13
|
+
lhs = lhs.parent
|
14
|
+
end
|
15
|
+
|
16
|
+
lhs
|
17
|
+
end
|
18
|
+
|
19
|
+
# Modified from https://github.com/rubocop/rubocop/blob/v1.72.1/lib/rubocop/cop/mixin/multiline_expression_indentation.rb#L194-L198.
|
20
|
+
def not_for_this_cop?(node)
|
21
|
+
node.ancestors.any? do |ancestor|
|
22
|
+
grouped_expression?(ancestor)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
RuboCop::Cop::MultilineExpressionIndentation.prepend(
|
28
|
+
RungerStyle::MultilineExpressionIndentationPatches,
|
29
|
+
)
|
30
|
+
|
31
|
+
module RungerStyle::MultilineMethodCallIndentationPatches
|
32
|
+
private
|
33
|
+
|
34
|
+
def alignment_base(node, rhs, given_style)
|
35
|
+
case given_style
|
36
|
+
when :aligned
|
37
|
+
semantic_alignment_base(node, rhs) || syntactic_alignment_base(node, rhs)
|
38
|
+
when :indented
|
39
|
+
nil
|
40
|
+
when :indented_relative_to_receiver
|
41
|
+
if ([node] + node.ancestors).any? { |node| !node.parenthesized_call? }
|
42
|
+
nil
|
43
|
+
else
|
44
|
+
receiver_alignment_base(node)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
RuboCop::Cop::Layout::MultilineMethodCallIndentation.prepend(
|
51
|
+
RungerStyle::MultilineMethodCallIndentationPatches,
|
52
|
+
)
|
data/lib/runger_style/version.rb
CHANGED
data/rulesets/default.yml
CHANGED
@@ -56,7 +56,7 @@ Layout/LineLength:
|
|
56
56
|
- !ruby/regexp /^ *(context|describe|it) ['"].*['"].* do$/
|
57
57
|
Max: 100
|
58
58
|
Layout/MultilineMethodCallIndentation:
|
59
|
-
EnforcedStyle:
|
59
|
+
EnforcedStyle: indented_relative_to_receiver
|
60
60
|
Layout/MultilineOperationIndentation:
|
61
61
|
EnforcedStyle: indented
|
62
62
|
Layout/RedundantLineBreak:
|
@@ -84,6 +84,8 @@ Metrics/BlockLength:
|
|
84
84
|
Enabled: false
|
85
85
|
Metrics/ClassLength:
|
86
86
|
Enabled: false
|
87
|
+
Metrics/CyclomaticComplexity:
|
88
|
+
Enabled: false
|
87
89
|
Metrics/MethodLength:
|
88
90
|
Max: 30
|
89
91
|
Metrics/ModuleLength:
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: runger_style
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Runger
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-02-
|
10
|
+
date: 2025-02-16 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: prism
|
@@ -73,6 +73,7 @@ files:
|
|
73
73
|
- lib/runger_style/cops/require_all_custom_cops.rb
|
74
74
|
- lib/runger_style/cops/require_all_monkeypatches.rb
|
75
75
|
- lib/runger_style/monkeypatches/multiline_element_line_breaks.rb
|
76
|
+
- lib/runger_style/monkeypatches/multiline_expression_indentation.rb
|
76
77
|
- lib/runger_style/version.rb
|
77
78
|
- rulesets/capybara.yml
|
78
79
|
- rulesets/default.yml
|
@@ -105,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
106
|
- !ruby/object:Gem::Version
|
106
107
|
version: '0'
|
107
108
|
requirements: []
|
108
|
-
rubygems_version: 3.6.
|
109
|
+
rubygems_version: 3.6.3
|
109
110
|
specification_version: 4
|
110
111
|
summary: Shared rubocop rules for the preferred Ruby coding style of @davidrunger
|
111
112
|
test_files: []
|