Skip to content

Commit aa2797e

Browse files
committed
Cut 1.85
1 parent c0f3332 commit aa2797e

15 files changed

Lines changed: 1104 additions & 92 deletions

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
## master (unreleased)
1313

14+
## 1.85.0 (2026-02-26)
15+
1416
### New features
1517

1618
* [#14921](https://github.com/rubocop/rubocop/pull/14921): Add `mise.toml` as source for TargetRubyVersion. ([@kitsane][])

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ do so.
1717

1818
```console
1919
$ rubocop -V
20-
1.84.2 (using Parser 3.3.7.2, rubocop-ast 1.49.0, analyzing as Ruby 3.4, running on ruby 3.4.8) [x86_64-linux]
20+
1.85.0 (using Parser 3.3.7.2, rubocop-ast 1.49.0, analyzing as Ruby 3.4, running on ruby 3.4.8) [x86_64-linux]
2121
- rubocop-performance 1.26.1
2222
- rubocop-rspec 3.9.0
2323
```

config/default.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1723,7 +1723,7 @@ Lint/CopDirectiveSyntax:
17231723
Lint/DataDefineOverride:
17241724
Description: 'Disallow overriding the `Data` built-in methods via `Data.define`.'
17251725
Enabled: pending
1726-
VersionAdded: '<<next>>'
1726+
VersionAdded: '1.85'
17271727

17281728
Lint/Debugger:
17291729
Description: 'Checks for debugger calls.'
@@ -2416,7 +2416,7 @@ Lint/SafeNavigationConsistency:
24162416
Enabled: true
24172417
SafeAutoCorrect: false
24182418
VersionAdded: '0.55'
2419-
VersionChanged: '<<next>>'
2419+
VersionChanged: '1.85'
24202420
AllowedMethods:
24212421
- present?
24222422
- blank?
@@ -2596,7 +2596,7 @@ Lint/UnreachableLoop:
25962596
Lint/UnreachablePatternBranch:
25972597
Description: 'Checks for unreachable `in` pattern branches after an unconditional catch-all pattern.'
25982598
Enabled: pending
2599-
VersionAdded: '<<next>>'
2599+
VersionAdded: '1.85'
26002600

26012601
Lint/UnusedBlockArgument:
26022602
Description: 'Checks for unused block arguments.'
@@ -4161,7 +4161,7 @@ Style/FileOpen:
41614161
Description: 'Checks for `File.open` without a block, which can leak file descriptors.'
41624162
Enabled: pending
41634163
Safe: false
4164-
VersionAdded: '<<next>>'
4164+
VersionAdded: '1.85'
41654165

41664166
Style/FileRead:
41674167
Description: 'Favor `File.(bin)read` convenience methods.'
@@ -4664,7 +4664,7 @@ Style/MapJoin:
46644664
Description: 'Checks for redundant `map(&:to_s)` before `join`.'
46654665
Enabled: pending
46664666
Safe: false
4667-
VersionAdded: '<<next>>'
4667+
VersionAdded: '1.85'
46684668

46694669
Style/MapToHash:
46704670
Description: 'Prefer `to_h` with a block over `map.to_h`.'
@@ -5118,7 +5118,7 @@ Style/ObjectThen:
51185118
Style/OneClassPerFile:
51195119
Description: 'Checks that each source file defines at most one top-level class or module.'
51205120
Enabled: pending
5121-
VersionAdded: '<<next>>'
5121+
VersionAdded: '1.85'
51225122
AllowedClasses: []
51235123

51245124
Style/OneLineConditional:
@@ -5215,7 +5215,7 @@ Style/PartitionInsteadOfDoubleSelect:
52155215
on the same receiver with the same block body.
52165216
Enabled: pending
52175217
Safe: false
5218-
VersionAdded: '<<next>>'
5218+
VersionAdded: '1.85'
52195219

52205220
Style/PercentLiteralDelimiters:
52215221
Description: 'Use `%`-literal delimiters consistently.'
@@ -5253,7 +5253,7 @@ Style/PredicateWithKind:
52535253
Description: 'Prefer `any?(Klass)` to `any? { |x| x.is_a?(Klass) }`.'
52545254
Enabled: pending
52555255
SafeAutoCorrect: false
5256-
VersionAdded: '<<next>>'
5256+
VersionAdded: '1.85'
52575257

52585258
Style/PreferredHashMethods:
52595259
Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
@@ -5309,7 +5309,7 @@ Style/ReduceToHash:
53095309
Description: 'Use `to_h { ... }` instead of `each_with_object`, `inject`, or `reduce` to build a hash.'
53105310
Enabled: pending
53115311
Safe: false
5312-
VersionAdded: '<<next>>'
5312+
VersionAdded: '1.85'
53135313

53145314
Style/RedundantArgument:
53155315
Description: 'Checks for a redundant argument passed to certain methods.'
@@ -5483,7 +5483,7 @@ Style/RedundantLineContinuation:
54835483
Style/RedundantMinMaxBy:
54845484
Description: 'Identifies places where `max_by`/`min_by` can be replaced by `max`/`min`.'
54855485
Enabled: pending
5486-
VersionAdded: '<<next>>'
5486+
VersionAdded: '1.85'
54875487

54885488
Style/RedundantParentheses:
54895489
Description: "Checks for parentheses that seem not to serve any purpose."
@@ -5566,7 +5566,7 @@ Style/RedundantStructKeywordInit:
55665566
Description: 'Checks for redundant `keyword_init` option for `Struct.new`.'
55675567
Enabled: pending
55685568
SafeAutoCorrect: false
5569-
VersionAdded: '<<next>>'
5569+
VersionAdded: '1.85'
55705570

55715571
Style/RegexpLiteral:
55725572
Description: 'Use / or %r around regular expressions.'
@@ -5678,13 +5678,13 @@ Style/SelectByKind:
56785678
Description: 'Prefer grep/grep_v to select/reject/find/detect with a kind check.'
56795679
Enabled: pending
56805680
SafeAutoCorrect: false
5681-
VersionAdded: '<<next>>'
5681+
VersionAdded: '1.85'
56825682

56835683
Style/SelectByRange:
56845684
Description: 'Prefer grep/grep_v to select/reject/find/detect with a range check.'
56855685
Enabled: pending
56865686
SafeAutoCorrect: false
5687-
VersionAdded: '<<next>>'
5687+
VersionAdded: '1.85'
56885688

56895689
Style/SelectByRegexp:
56905690
Description: 'Prefer grep/grep_v to select/reject/find/detect with a regexp match.'
@@ -5950,7 +5950,7 @@ Style/TallyMethod:
59505950
Description: 'Prefer `Enumerable#tally` over manual counting patterns.'
59515951
Enabled: pending
59525952
Safe: false
5953-
VersionAdded: '<<next>>'
5953+
VersionAdded: '1.85'
59545954

59555955
Style/TernaryParentheses:
59565956
Description: 'Checks for use of parentheses around ternary conditions.'

docs/antora.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ name: rubocop
22
title: RuboCop
33
# We always provide version without patch here (e.g. 1.1),
44
# as patch versions should not appear in the docs.
5-
version: ~
5+
version: '1.85'
66
nav:
77
- modules/ROOT/nav.adoc

docs/modules/ROOT/pages/cops.adoc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ In the following section you find all available cops:
237237
* xref:cops_lint.adoc#lintconstantreassignment[Lint/ConstantReassignment]
238238
* xref:cops_lint.adoc#lintconstantresolution[Lint/ConstantResolution]
239239
* xref:cops_lint.adoc#lintcopdirectivesyntax[Lint/CopDirectiveSyntax]
240+
* xref:cops_lint.adoc#lintdatadefineoverride[Lint/DataDefineOverride]
240241
* xref:cops_lint.adoc#lintdebugger[Lint/Debugger]
241242
* xref:cops_lint.adoc#lintdeprecatedclassmethods[Lint/DeprecatedClassMethods]
242243
* xref:cops_lint.adoc#lintdeprecatedconstants[Lint/DeprecatedConstants]
@@ -354,6 +355,7 @@ In the following section you find all available cops:
354355
* xref:cops_lint.adoc#lintunmodifiedreduceaccumulator[Lint/UnmodifiedReduceAccumulator]
355356
* xref:cops_lint.adoc#lintunreachablecode[Lint/UnreachableCode]
356357
* xref:cops_lint.adoc#lintunreachableloop[Lint/UnreachableLoop]
358+
* xref:cops_lint.adoc#lintunreachablepatternbranch[Lint/UnreachablePatternBranch]
357359
* xref:cops_lint.adoc#lintunusedblockargument[Lint/UnusedBlockArgument]
358360
* xref:cops_lint.adoc#lintunusedmethodargument[Lint/UnusedMethodArgument]
359361
* xref:cops_lint.adoc#linturiescapeunescape[Lint/UriEscapeUnescape]
@@ -505,6 +507,7 @@ In the following section you find all available cops:
505507
* xref:cops_style.adoc#stylefetchenvvar[Style/FetchEnvVar]
506508
* xref:cops_style.adoc#stylefileempty[Style/FileEmpty]
507509
* xref:cops_style.adoc#stylefilenull[Style/FileNull]
510+
* xref:cops_style.adoc#stylefileopen[Style/FileOpen]
508511
* xref:cops_style.adoc#stylefileread[Style/FileRead]
509512
* xref:cops_style.adoc#stylefiletouch[Style/FileTouch]
510513
* xref:cops_style.adoc#stylefilewrite[Style/FileWrite]
@@ -550,6 +553,7 @@ In the following section you find all available cops:
550553
* xref:cops_style.adoc#stylemagiccommentformat[Style/MagicCommentFormat]
551554
* xref:cops_style.adoc#stylemapcompactwithconditionalblock[Style/MapCompactWithConditionalBlock]
552555
* xref:cops_style.adoc#stylemapintoarray[Style/MapIntoArray]
556+
* xref:cops_style.adoc#stylemapjoin[Style/MapJoin]
553557
* xref:cops_style.adoc#stylemaptohash[Style/MapToHash]
554558
* xref:cops_style.adoc#stylemaptoset[Style/MapToSet]
555559
* xref:cops_style.adoc#stylemethodcallwithargsparentheses[Style/MethodCallWithArgsParentheses]
@@ -594,6 +598,7 @@ In the following section you find all available cops:
594598
* xref:cops_style.adoc#stylenumericliterals[Style/NumericLiterals]
595599
* xref:cops_style.adoc#stylenumericpredicate[Style/NumericPredicate]
596600
* xref:cops_style.adoc#styleobjectthen[Style/ObjectThen]
601+
* xref:cops_style.adoc#styleoneclassperfile[Style/OneClassPerFile]
597602
* xref:cops_style.adoc#styleonelineconditional[Style/OneLineConditional]
598603
* xref:cops_style.adoc#styleopenstructuse[Style/OpenStructUse]
599604
* xref:cops_style.adoc#styleoperatormethodcall[Style/OperatorMethodCall]
@@ -603,14 +608,17 @@ In the following section you find all available cops:
603608
* xref:cops_style.adoc#styleorassignment[Style/OrAssignment]
604609
* xref:cops_style.adoc#styleparallelassignment[Style/ParallelAssignment]
605610
* xref:cops_style.adoc#styleparenthesesaroundcondition[Style/ParenthesesAroundCondition]
611+
* xref:cops_style.adoc#stylepartitioninsteadofdoubleselect[Style/PartitionInsteadOfDoubleSelect]
606612
* xref:cops_style.adoc#stylepercentliteraldelimiters[Style/PercentLiteralDelimiters]
607613
* xref:cops_style.adoc#stylepercentqliterals[Style/PercentQLiterals]
608614
* xref:cops_style.adoc#styleperlbackrefs[Style/PerlBackrefs]
615+
* xref:cops_style.adoc#stylepredicatewithkind[Style/PredicateWithKind]
609616
* xref:cops_style.adoc#stylepreferredhashmethods[Style/PreferredHashMethods]
610617
* xref:cops_style.adoc#styleproc[Style/Proc]
611618
* xref:cops_style.adoc#stylequotedsymbols[Style/QuotedSymbols]
612619
* xref:cops_style.adoc#styleraiseargs[Style/RaiseArgs]
613620
* xref:cops_style.adoc#stylerandomwithoffset[Style/RandomWithOffset]
621+
* xref:cops_style.adoc#stylereducetohash[Style/ReduceToHash]
614622
* xref:cops_style.adoc#styleredundantargument[Style/RedundantArgument]
615623
* xref:cops_style.adoc#styleredundantarrayconstructor[Style/RedundantArrayConstructor]
616624
* xref:cops_style.adoc#styleredundantarrayflatten[Style/RedundantArrayFlatten]
@@ -634,6 +642,7 @@ In the following section you find all available cops:
634642
* xref:cops_style.adoc#styleredundantinterpolation[Style/RedundantInterpolation]
635643
* xref:cops_style.adoc#styleredundantinterpolationunfreeze[Style/RedundantInterpolationUnfreeze]
636644
* xref:cops_style.adoc#styleredundantlinecontinuation[Style/RedundantLineContinuation]
645+
* xref:cops_style.adoc#styleredundantminmaxby[Style/RedundantMinMaxBy]
637646
* xref:cops_style.adoc#styleredundantparentheses[Style/RedundantParentheses]
638647
* xref:cops_style.adoc#styleredundantpercentq[Style/RedundantPercentQ]
639648
* xref:cops_style.adoc#styleredundantregexpargument[Style/RedundantRegexpArgument]
@@ -647,6 +656,7 @@ In the following section you find all available cops:
647656
* xref:cops_style.adoc#styleredundantsort[Style/RedundantSort]
648657
* xref:cops_style.adoc#styleredundantsortby[Style/RedundantSortBy]
649658
* xref:cops_style.adoc#styleredundantstringescape[Style/RedundantStringEscape]
659+
* xref:cops_style.adoc#styleredundantstructkeywordinit[Style/RedundantStructKeywordInit]
650660
* xref:cops_style.adoc#styleregexpliteral[Style/RegexpLiteral]
651661
* xref:cops_style.adoc#stylerequireorder[Style/RequireOrder]
652662
* xref:cops_style.adoc#stylerescuemodifier[Style/RescueModifier]
@@ -657,6 +667,8 @@ In the following section you find all available cops:
657667
* xref:cops_style.adoc#stylesafenavigation[Style/SafeNavigation]
658668
* xref:cops_style.adoc#stylesafenavigationchainlength[Style/SafeNavigationChainLength]
659669
* xref:cops_style.adoc#stylesample[Style/Sample]
670+
* xref:cops_style.adoc#styleselectbykind[Style/SelectByKind]
671+
* xref:cops_style.adoc#styleselectbyrange[Style/SelectByRange]
660672
* xref:cops_style.adoc#styleselectbyregexp[Style/SelectByRegexp]
661673
* xref:cops_style.adoc#styleselfassignment[Style/SelfAssignment]
662674
* xref:cops_style.adoc#stylesemicolon[Style/Semicolon]
@@ -687,6 +699,7 @@ In the following section you find all available cops:
687699
* xref:cops_style.adoc#stylesymbolarray[Style/SymbolArray]
688700
* xref:cops_style.adoc#stylesymbolliteral[Style/SymbolLiteral]
689701
* xref:cops_style.adoc#stylesymbolproc[Style/SymbolProc]
702+
* xref:cops_style.adoc#styletallymethod[Style/TallyMethod]
690703
* xref:cops_style.adoc#styleternaryparentheses[Style/TernaryParentheses]
691704
* xref:cops_style.adoc#styletoplevelmethoddefinition[Style/TopLevelMethodDefinition]
692705
* xref:cops_style.adoc#styletrailingbodyonclass[Style/TrailingBodyOnClass]

docs/modules/ROOT/pages/cops_layout.adoc

Lines changed: 48 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ end
9595
| 0.77
9696
|===
9797
98-
Check that the arguments on a multi-line method call are aligned.
98+
Checks that the arguments on a multi-line method call are aligned.
9999
100100
[#examples-layoutargumentalignment]
101101
=== Examples
@@ -181,7 +181,7 @@ foo :bar,
181181
| 0.77
182182
|===
183183
184-
Check that the elements of a multi-line array literal are
184+
Checks that the elements of a multi-line array literal are
185185
aligned.
186186
187187
[#examples-layoutarrayalignment]
@@ -2179,8 +2179,14 @@ the configuration.
21792179
21802180
[source,ruby]
21812181
----
2182-
# good
2182+
# bad
2183+
foo do |bar|
2184+
2185+
# ...
2186+
2187+
end
21832188
2189+
# good
21842190
foo do |bar|
21852191
# ...
21862192
end
@@ -2191,8 +2197,12 @@ end
21912197
21922198
[source,ruby]
21932199
----
2194-
# good
2200+
# bad
2201+
foo do |bar|
2202+
# ...
2203+
end
21952204
2205+
# good
21962206
foo do |bar|
21972207
21982208
# ...
@@ -2240,8 +2250,16 @@ the configuration.
22402250
22412251
[source,ruby]
22422252
----
2243-
# good
2253+
# bad
2254+
class Foo
2255+
2256+
def bar
2257+
# ...
2258+
end
2259+
2260+
end
22442261
2262+
# good
22452263
class Foo
22462264
def bar
22472265
# ...
@@ -2254,8 +2272,14 @@ end
22542272
22552273
[source,ruby]
22562274
----
2257-
# good
2275+
# bad
2276+
class Foo
2277+
def bar
2278+
# ...
2279+
end
2280+
end
22582281
2282+
# good
22592283
class Foo
22602284
22612285
def bar
@@ -2482,8 +2506,16 @@ the configuration.
24822506
24832507
[source,ruby]
24842508
----
2485-
# good
2509+
# bad
2510+
module Foo
24862511
2512+
def bar
2513+
# ...
2514+
end
2515+
2516+
end
2517+
2518+
# good
24872519
module Foo
24882520
def bar
24892521
# ...
@@ -2496,8 +2528,14 @@ end
24962528
24972529
[source,ruby]
24982530
----
2499-
# good
2531+
# bad
2532+
module Foo
2533+
def bar
2534+
# ...
2535+
end
2536+
end
25002537
2538+
# good
25012539
module Foo
25022540
25032541
def bar
@@ -3754,7 +3792,7 @@ end
37543792
| 1.16
37553793
|===
37563794
3757-
Check that the keys, separators, and values of a multi-line hash
3795+
Checks that the keys, separators, and values of a multi-line hash
37583796
literal are aligned according to configuration. The configuration
37593797
options are:
37603798
@@ -6332,7 +6370,7 @@ end
63326370
| 0.77
63336371
|===
63346372
6335-
Check that the parameters on a multi-line method call or definition are aligned.
6373+
Checks that the parameters on a multi-line method call or definition are aligned.
63366374
63376375
To set the alignment of the first argument, use the
63386376
`Layout/FirstParameterIndentation` cop.

0 commit comments

Comments
 (0)