runger_style 5.1.0 → 5.3.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: dccf9a541e8c8fecee3ac2e58f2af64712b64b42d26082a03fe200d0bc8ca3a8
4
- data.tar.gz: 864f847dc6eaaf64f9b5dc1c7688fc6b8c77b7b19ac439e53da6bccacd9d4d54
3
+ metadata.gz: cfa5836d617c931ac21c4cf90752707f525f5c6a876970e3ec39704fc1a39167
4
+ data.tar.gz: ba7b9d92318e2f52259b9e65db0a21426aa7b52c30a9fc22eb4e9162284d3e3d
5
5
  SHA512:
6
- metadata.gz: 18aeee3a6f58039e1d00bbf3a73eeea93331e3dddf35e85e7838edb98f4d82ccbb089f546de08bede5e48c697d380794f8fb471f4ed9c35887f05055e5885d47
7
- data.tar.gz: c98d787a96ce2043a713d98d93cbe9e4f316c289e01852b0c901fc15216d014bc6a6260376e2449ffa22743b5ab743123894f5bcf590391dbb50c02b41f48078
6
+ metadata.gz: b98075603c5d6b27cb87f4c357ce8097c76f405a4794a07d2e3e9273b71d38fa63a9d0b963eb28714ac3add2524a0fb5c9587d2704f26fa3785bb9a1aa9eb298
7
+ data.tar.gz: 484693246b8168a40f4407d195d65614b4f2e3f8aa79cfe0d48e6d61988524b10aacf52e639a0bec7ef3350b4d657837de705dce162638cbaae707233d2a0c05
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.4.1
1
+ 3.4.2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## v5.3.0 (2025-02-16)
2
+ - Disable `Rails/Delegate` cop.
3
+ - Register `rubocop-rails` as a plugin (rather than requiring it).
4
+ - Register `rubocop-performance` and `rubocop-rake` as plugins (rather than requiring them).
5
+
6
+ ## v5.2.0 (2025-02-16)
7
+ - Disable `Metrics/CyclomaticComplexity` cop.
8
+ - Monkeypatch `RuboCop::Cop::MultilineExpressionIndentation` to require (via `Layout/MultilineMethodCallIndentation`) the indentation of a chained multiline method call used as a method argument.
9
+ - 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.
10
+
1
11
  ## v5.1.0 (2025-02-12)
2
12
  - 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
13
 
data/Gemfile.lock CHANGED
@@ -9,9 +9,9 @@ GIT
9
9
  PATH
10
10
  remote: .
11
11
  specs:
12
- runger_style (5.1.0)
12
+ runger_style (5.3.0)
13
13
  prism (>= 0.24.0)
14
- rubocop (>= 1.68.0)
14
+ rubocop (>= 1.72.0)
15
15
 
16
16
  GEM
17
17
  remote: https://rubygems.org/
@@ -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.5.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,8 @@ 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.5)
51
+ lint_roller (1.1.0)
52
+ logger (1.6.6)
52
53
  memo_wise (1.10.0)
53
54
  method_source (1.1.0)
54
55
  minitest (5.25.4)
@@ -88,9 +89,10 @@ GEM
88
89
  diff-lcs (>= 1.2.0, < 2.0)
89
90
  rspec-support (~> 3.13.0)
90
91
  rspec-support (3.13.2)
91
- rubocop (1.71.2)
92
+ rubocop (1.72.1)
92
93
  json (~> 2.3)
93
- language_server-protocol (>= 3.17.0)
94
+ language_server-protocol (~> 3.17.0.2)
95
+ lint_roller (~> 1.1.0)
94
96
  parallel (~> 1.10)
95
97
  parser (>= 3.3.0.2)
96
98
  rainbow (>= 2.2.2, < 4.0)
@@ -104,16 +106,19 @@ GEM
104
106
  rubocop (~> 1.41)
105
107
  rubocop-factory_bot (2.26.1)
106
108
  rubocop (~> 1.61)
107
- rubocop-performance (1.23.1)
108
- rubocop (>= 1.48.1, < 2.0)
109
- rubocop-ast (>= 1.31.1, < 2.0)
110
- rubocop-rails (2.29.1)
109
+ rubocop-performance (1.24.0)
110
+ lint_roller (~> 1.1)
111
+ rubocop (>= 1.72.1, < 2.0)
112
+ rubocop-ast (>= 1.38.0, < 2.0)
113
+ rubocop-rails (2.30.0)
111
114
  activesupport (>= 4.2.0)
115
+ lint_roller (~> 1.1)
112
116
  rack (>= 1.1)
113
- rubocop (>= 1.52.0, < 2.0)
114
- rubocop-ast (>= 1.31.1, < 2.0)
115
- rubocop-rake (0.6.0)
116
- rubocop (~> 1.0)
117
+ rubocop (>= 1.72.1, < 2.0)
118
+ rubocop-ast (>= 1.38.0, < 2.0)
119
+ rubocop-rake (0.7.1)
120
+ lint_roller (~> 1.1)
121
+ rubocop (>= 1.72.1)
117
122
  rubocop-rspec (3.4.0)
118
123
  rubocop (~> 1.61)
119
124
  rubocop-rspec_rails (2.30.0)
@@ -130,7 +135,7 @@ GEM
130
135
  slop (~> 4.8)
131
136
  securerandom (0.4.1)
132
137
  slop (4.10.1)
133
- stringio (3.1.2)
138
+ stringio (3.1.3)
134
139
  tzinfo (2.0.6)
135
140
  concurrent-ruby (~> 1.0)
136
141
  unicode-display_width (3.1.4)
@@ -168,14 +173,15 @@ CHECKSUMS
168
173
  concurrent-ruby (1.3.5) sha256=813b3e37aca6df2a21a3b9f1d497f8cbab24a2b94cab325bffe65ee0f6cbebc6
169
174
  connection_pool (2.5.0) sha256=233b92f8d38e038c1349ccea65dd3772727d669d6d2e71f9897c8bf5cd53ebfc
170
175
  date (3.4.1) sha256=bf268e14ef7158009bfeaec40b5fa3c7271906e88b196d958a89d4b408abe64f
171
- diff-lcs (1.5.1) sha256=273223dfb40685548436d32b4733aa67351769c7dea621da7d9dd4813e63ddfe
176
+ diff-lcs (1.6.0) sha256=a1e7f7b272962f8fc769358ad00001b87cdcf32ba349d6c70c6b544613d2da2e
172
177
  drb (2.2.1) sha256=e9d472bf785f558b96b25358bae115646da0dbfd45107ad858b0bc0d935cb340
173
178
  i18n (1.14.7) sha256=ceba573f8138ff2c0915427f1fc5bdf4aa3ab8ae88c8ce255eb3ecf0a11a5d0f
174
179
  io-console (0.8.0) sha256=cd6a9facbc69871d69b2cb8b926fc6ea7ef06f06e505e81a64f14a470fddefa2
175
180
  irb (1.15.1) sha256=d9bca745ac4207a8b728a52b98b766ca909b86ff1a504bcde3d6f8c84faae890
176
181
  json (2.10.1) sha256=ddc88ad91a1baf3f0038c174f253af3b086d30dc74db17ca4259bbde982f94dc
177
182
  language_server-protocol (3.17.0.4) sha256=c484626478664fd13482d8180947c50a8590484b1258b99b7aedb3b69df89669
178
- logger (1.6.5) sha256=c3cfe56d01656490ddd103d38b8993d73d86296adebc5f58cefc9ec03741e56b
183
+ lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
184
+ logger (1.6.6) sha256=dd618d24e637715472732e7eed02e33cfbdf56deaad225edd0f1f89d38024017
179
185
  memo_wise (1.10.0) sha256=ae40ff8e7799697ff5d59d739b8766f76be22eba69c7c8468edb42ab83c94c3f
180
186
  method_source (1.1.0) sha256=181301c9c45b731b4769bc81e8860e72f9161ad7d66dd99103c9ab84f560f5c5
181
187
  minitest (5.25.4) sha256=9cf2cae25ac4dfc90c988ebc3b917f53c054978b673273da1bd20bcb0778f947
@@ -199,29 +205,29 @@ CHECKSUMS
199
205
  rspec-expectations (3.13.3) sha256=0e6b5af59b900147698ea0ff80456c4f2e69cac4394fbd392fbd1ca561f66c58
200
206
  rspec-mocks (3.13.2) sha256=2327335def0e1665325a9b617e3af9ae20272741d80ac550336309a7c59abdef
201
207
  rspec-support (3.13.2) sha256=cea3a2463fd9b84b9dcc9685efd80ea701aa8f7b3decb3b3ce795ed67737dbec
202
- rubocop (1.71.2) sha256=9a7b7501aac661a338ed7ff2a5eba78e581759e1f0d3c82362b2ca217ed3f97f
208
+ rubocop (1.72.1) sha256=4306ae64c6e7e1026d2a90ed755a113c7b9bf0ac21037b8046fbc826a87daaa5
203
209
  rubocop-ast (1.38.0) sha256=4fdf6792fe443a9a18acb12dbc8225d0d64cd1654e41fedb30e79c18edbb26ae
204
210
  rubocop-capybara (2.21.0) sha256=5d264efdd8b6c7081a3d4889decf1451a1cfaaec204d81534e236bc825b280ab
205
211
  rubocop-factory_bot (2.26.1) sha256=8de13cd4edcee5ca800f255188167ecef8dbfc3d1fae9f15734e9d2e755392aa
206
- rubocop-performance (1.23.1) sha256=f22f86a795f5e6a6180aac2c6fc172534b173a068d6ed3396d6460523e051b82
207
- rubocop-rails (2.29.1) sha256=41c2fcf48d5d62f4a5f574d5f1c97bbaf4cba88ee367936c98b3422d047b17aa
208
- rubocop-rake (0.6.0) sha256=56b6f22189af4b33d4f4e490a555c09f1281b02f4d48c3a61f6e8fe5f401d8db
212
+ rubocop-performance (1.24.0) sha256=e5bd39ff3e368395b9af886927cc37f5892f43db4bd6c8526594352d5b4440b5
213
+ rubocop-rails (2.30.0) sha256=37d475c2cab768d1dfb07bee908ebdbc4814cfaa62f906d3e7adbcd7be01a33d
214
+ rubocop-rake (0.7.1) sha256=3797f2b6810c3e9df7376c26d5f44f3475eda59eb1adc38e6f62ecf027cbae4d
209
215
  rubocop-rspec (3.4.0) sha256=8721c13b6a8c9530a7ac481cea9423022f946fcf72428bda8289f8b57e4d4885
210
216
  rubocop-rspec_rails (2.30.0) sha256=888112e83f9d7ef7ad2397e9d69a0b9614a4bae24f072c399804a180f80c4c46
211
217
  ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
212
218
  runger_byebug (11.4.0) sha256=569e22ba2215f57e7f69e145fcb63be401e29fcd312f7936d813e12d0c7bbee6
213
219
  runger_release_assistant (2.0.0) sha256=f4f5708291eaeef1b881208f87a494877fe768739d6e96b7293fc335b28a3865
214
- runger_style (5.1.0)
220
+ runger_style (5.3.0)
215
221
  securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
216
222
  slop (4.10.1) sha256=844322b5ffcf17ed4815fdb173b04a20dd82b4fd93e3744c88c8fafea696d9c7
217
- stringio (3.1.2) sha256=204f1828f85cdb39d57cac4abc6dc44b04505a223f131587f2e20ae3729ba131
223
+ stringio (3.1.3) sha256=1eedb8369ee99a9a0edfdacea95c72d647feb8ce844427c150bd641e1797abc8
218
224
  tzinfo (2.0.6) sha256=8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b
219
225
  unicode-display_width (3.1.4) sha256=8caf2af1c0f2f07ec89ef9e18c7d88c2790e217c482bfc78aaa65eadd5415ac1
220
226
  unicode-emoji (4.0.4) sha256=2c2c4ef7f353e5809497126285a50b23056cc6e61b64433764a35eff6c36532a
221
227
  uri (1.0.2) sha256=b303504ceb7e5905771fa7fa14b649652fa949df18b5880d69cfb12494791e27
222
228
 
223
229
  RUBY VERSION
224
- ruby 3.4.1p0
230
+ ruby 3.4.2p28
225
231
 
226
232
  BUNDLED WITH
227
- 2.6.2
233
+ 2.6.3
data/bin/rspec CHANGED
@@ -8,12 +8,12 @@
8
8
  # this file is here to facilitate running it.
9
9
  #
10
10
 
11
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
11
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
12
12
 
13
- bundle_binstub = File.expand_path("bundle", __dir__)
13
+ bundle_binstub = File.expand_path('bundle', __dir__)
14
14
 
15
15
  if File.file?(bundle_binstub)
16
- if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
16
+ if File.read(bundle_binstub, 300).include?('This file was generated by Bundler')
17
17
  load(bundle_binstub)
18
18
  else
19
19
  abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
@@ -21,7 +21,7 @@ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this
21
21
  end
22
22
  end
23
23
 
24
- require "rubygems"
25
- require "bundler/setup"
24
+ require 'rubygems'
25
+ require 'bundler/setup'
26
26
 
27
- load Gem.bin_path("rspec-core", "rspec")
27
+ load Gem.bin_path('rspec-core', 'rspec')
@@ -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
+ )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RungerStyle
4
- VERSION = '5.1.0'
4
+ VERSION = '5.3.0'
5
5
  end
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: indented
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:
@@ -1,4 +1,4 @@
1
- require:
1
+ plugins:
2
2
  - rubocop-performance
3
3
 
4
4
  Performance/ChainArrayAllocation:
data/rulesets/rails.yml CHANGED
@@ -1,4 +1,4 @@
1
- require:
1
+ plugins:
2
2
  - rubocop-rails
3
3
 
4
4
  AllCops:
@@ -16,6 +16,8 @@ Rails/CreateTableWithTimestamps:
16
16
  Exclude:
17
17
  - !ruby/regexp /db/migrate/201[1-9].*\.rb\z/
18
18
  - db/schema.rb
19
+ Rails/Delegate:
20
+ Enabled: false
19
21
  Rails/EnvironmentVariableAccess:
20
22
  AllowReads: true
21
23
  Rails/I18nLocaleTexts:
data/rulesets/rake.yml CHANGED
@@ -1,2 +1,2 @@
1
- require:
1
+ plugins:
2
2
  - rubocop-rake
data/runger_style.gemspec CHANGED
@@ -34,5 +34,5 @@ Gem::Specification.new do |spec|
34
34
  spec.required_ruby_version = ">= #{required_ruby_version}"
35
35
 
36
36
  spec.add_dependency('prism', '>= 0.24.0')
37
- spec.add_dependency('rubocop', '>= 1.68.0')
37
+ spec.add_dependency('rubocop', '>= 1.72.0')
38
38
  end
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.1.0
4
+ version: 5.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Runger
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-02-13 00:00:00.000000000 Z
10
+ date: 2025-02-16 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: prism
@@ -29,14 +29,14 @@ dependencies:
29
29
  requirements:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 1.68.0
32
+ version: 1.72.0
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: 1.68.0
39
+ version: 1.72.0
40
40
  description: Shared rubocop rules for the preferred Ruby coding style of @davidrunger
41
41
  email:
42
42
  - davidjrunger@gmail.com
@@ -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.2
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: []