@@ -593,6 +593,7 @@ Layout/FirstArrayElementLineBreak:
593593 Description : Checks for a line break before the first element in a multi-line array.
594594 Enabled : false
595595 VersionAdded : ' 0.49'
596+ AllowImplicitArrayLiterals : false
596597 AllowMultilineFinalElement : true
597598Layout/FirstHashElementIndentation :
598599 Description : Checks the indentation of the first key in a hash literal.
@@ -695,6 +696,10 @@ Layout/IndentationWidth:
695696 Enabled : true
696697 VersionAdded : ' 0.49'
697698 Width : 2
699+ EnforcedStyleAlignWith : start_of_line
700+ SupportedStylesAlignWith :
701+ - start_of_line
702+ - relative_to_receiver
698703 AllowedPatterns : []
699704Layout/InitialIndentation :
700705 Description : Checks the indentation of the first non-blank non-comment line in a
@@ -1205,6 +1210,10 @@ Lint/CopDirectiveSyntax:
12051210 Description : Checks that `# rubocop:` directives are strictly formatted.
12061211 Enabled : true
12071212 VersionAdded : ' 1.72'
1213+ Lint/DataDefineOverride :
1214+ Description : Disallow overriding the `Data` built-in methods via `Data.define`.
1215+ Enabled : pending
1216+ VersionAdded : ' 1.85'
12081217Lint/Debugger :
12091218 Description : Checks for debugger calls.
12101219 Enabled : true
@@ -1774,8 +1783,9 @@ Lint/SafeNavigationConsistency:
17741783 condition, consistent and appropriate safe navigation, without excess or deficiency,
17751784 is used for all method calls on the same object.
17761785 Enabled : false
1786+ SafeAutoCorrect : false
17771787 VersionAdded : ' 0.55'
1778- VersionChanged : ' 0.77 '
1788+ VersionChanged : ' 1.85 '
17791789 AllowedMethods :
17801790 - present?
17811791 - blank?
@@ -1924,6 +1934,11 @@ Lint/UnreachableLoop:
19241934 VersionChanged : ' 1.7'
19251935 AllowedPatterns :
19261936 - !ruby/regexp /(exactly|at_least|at_most)\(\d+\)\.times/
1937+ Lint/UnreachablePatternBranch :
1938+ Description : Checks for unreachable `in` pattern branches after an unconditional
1939+ catch-all pattern.
1940+ Enabled : pending
1941+ VersionAdded : ' 1.85'
19271942Lint/UnusedBlockArgument :
19281943 Description : Checks for unused block arguments.
19291944 StyleGuide : " #underscore-unused-vars"
@@ -2356,6 +2371,7 @@ Naming/PredicateMethod:
23562371 AllowedPatterns : []
23572372 AllowBangMethods : false
23582373 WaywardPredicates :
2374+ - infinite?
23592375 - nonzero?
23602376Naming/PredicatePrefix :
23612377 Description : Predicate method names should not be prefixed and end with a `?`.
@@ -2966,6 +2982,15 @@ Style/EmptyCaseCondition:
29662982 Description : Avoid empty condition in case statements.
29672983 Enabled : false
29682984 VersionAdded : ' 0.40'
2985+ Style/EmptyClassDefinition :
2986+ Description : Enforces consistent style for empty class definitions.
2987+ Enabled : pending
2988+ VersionAdded : ' 1.84'
2989+ EnforcedStyle : class_keyword
2990+ SupportedStyles :
2991+ - class_keyword
2992+ - class_new
2993+ - class_definition
29692994Style/EmptyElse :
29702995 Description : Avoid empty else-clauses.
29712996 Enabled : false
@@ -3099,6 +3124,11 @@ Style/FileNull:
30993124 Enabled : false
31003125 SafeAutoCorrect : false
31013126 VersionAdded : ' 1.69'
3127+ Style/FileOpen :
3128+ Description : Checks for `File.open` without a block, which can leak file descriptors.
3129+ Enabled : pending
3130+ Safe : false
3131+ VersionAdded : ' 1.85'
31023132Style/FileRead :
31033133 Description : Favor `File.(bin)read` convenience methods.
31043134 StyleGuide : " #file-read"
@@ -3249,6 +3279,15 @@ Style/HashLikeCase:
32493279 Enabled : false
32503280 VersionAdded : ' 0.88'
32513281 MinBranchesCount : 3
3282+ Style/HashLookupMethod :
3283+ Description : Enforces the use of either `Hash#[]` or `Hash#fetch` for hash lookup.
3284+ Enabled : false
3285+ Safe : false
3286+ VersionAdded : ' 1.84'
3287+ EnforcedStyle : brackets
3288+ SupportedStyles :
3289+ - brackets
3290+ - fetch
32523291Style/HashSlice :
32533292 Description : Checks for usages of `Hash#reject`, `Hash#select`, and `Hash#filter`
32543293 methods that can be replaced with `Hash#slice` method.
@@ -3319,6 +3358,7 @@ Style/IfWithBooleanLiteralBranches:
33193358 VersionAdded : ' 1.9'
33203359 SafeAutoCorrect : false
33213360 AllowedMethods :
3361+ - infinite?
33223362 - nonzero?
33233363Style/IfWithSemicolon :
33243364 Description : Do not use if x; .... Use the ternary operator instead.
@@ -3478,6 +3518,11 @@ Style/MapIntoArray:
34783518 VersionAdded : ' 1.63'
34793519 VersionChanged : ' 1.67'
34803520 Safe : false
3521+ Style/MapJoin :
3522+ Description : Checks for redundant `map(&:to_s)` before `join`.
3523+ Enabled : pending
3524+ Safe : false
3525+ VersionAdded : ' 1.85'
34813526Style/MapToHash :
34823527 Description : Prefer `to_h` with a block over `map.to_h`.
34833528 Enabled : false
@@ -3599,6 +3644,7 @@ Style/ModuleMemberExistenceCheck:
35993644 with equivalent predicates.
36003645 Enabled : true
36013646 VersionAdded : ' 1.82'
3647+ AllowedMethods : []
36023648Style/MultilineBlockChain :
36033649 Description : Avoid multi-line chains of blocks.
36043650 StyleGuide : " #single-line-blocks"
@@ -3694,6 +3740,12 @@ Style/NegatedWhile:
36943740 StyleGuide : " #until-for-negatives"
36953741 Enabled : false
36963742 VersionAdded : ' 0.20'
3743+ Style/NegativeArrayIndex :
3744+ Description : Use negative array indices instead of calculating array length minus
3745+ a value. Also handles range patterns with length calculations. Recognizes preserving
3746+ methods and their combinations, allowing safe replacement when the receiver matches.
3747+ Enabled : pending
3748+ VersionAdded : ' 1.84'
36973749Style/NestedFileDirname :
36983750 Description : Checks for nested `File.dirname`.
36993751 Enabled : false
@@ -3831,6 +3883,12 @@ Style/ObjectThen:
38313883 SupportedStyles :
38323884 - then
38333885 - yield_self
3886+ Style/OneClassPerFile :
3887+ Description : Checks that each source file defines at most one top-level class or
3888+ module.
3889+ Enabled : pending
3890+ VersionAdded : ' 1.85'
3891+ AllowedClasses : []
38343892Style/OneLineConditional :
38353893 Description : Favor the ternary operator (?:) or multi-line constructs over single-line
38363894 if/then/else/end constructs.
@@ -3901,6 +3959,12 @@ Style/ParenthesesAroundCondition:
39013959 VersionChanged : ' 0.56'
39023960 AllowSafeAssignment : true
39033961 AllowInMultilineConditions : false
3962+ Style/PartitionInsteadOfDoubleSelect :
3963+ Description : Checks for consecutive `select`/`filter`/`find_all` and `reject` calls
3964+ on the same receiver with the same block body.
3965+ Enabled : pending
3966+ Safe : false
3967+ VersionAdded : ' 1.85'
39043968Style/PercentLiteralDelimiters :
39053969 Description : Use `%`-literal delimiters consistently.
39063970 StyleGuide : " #percent-literal-braces"
@@ -3927,6 +3991,11 @@ Style/PerlBackrefs:
39273991 StyleGuide : " #no-perl-regexp-last-matchers"
39283992 Enabled : false
39293993 VersionAdded : ' 0.13'
3994+ Style/PredicateWithKind :
3995+ Description : Prefer `any?(Klass)` to `any? { |x| x.is_a?(Klass) }`.
3996+ Enabled : pending
3997+ SafeAutoCorrect : false
3998+ VersionAdded : ' 1.85'
39303999Style/PreferredHashMethods :
39314000 Description : Checks use of `has_key?` and `has_value?` Hash methods.
39324001 StyleGuide : " #hash-key"
@@ -3971,6 +4040,12 @@ Style/RandomWithOffset:
39714040 StyleGuide : " #random-numbers"
39724041 Enabled : false
39734042 VersionAdded : ' 0.52'
4043+ Style/ReduceToHash :
4044+ Description : Use `to_h { ... }` instead of `each_with_object`, `inject`, or `reduce`
4045+ to build a hash.
4046+ Enabled : pending
4047+ Safe : false
4048+ VersionAdded : ' 1.85'
39744049Style/RedundantArgument :
39754050 Description : Checks for a redundant argument passed to certain methods.
39764051 Enabled : false
@@ -4015,6 +4090,7 @@ Style/RedundantCondition:
40154090 VersionAdded : ' 0.76'
40164091 VersionChanged : ' 1.73'
40174092 AllowedMethods :
4093+ - infinite?
40184094 - nonzero?
40194095Style/RedundantConditional :
40204096 Description : Don't return true/false from a conditional.
@@ -4105,6 +4181,10 @@ Style/RedundantLineContinuation:
41054181 Description : Checks for redundant line continuation.
41064182 Enabled : false
41074183 VersionAdded : ' 1.49'
4184+ Style/RedundantMinMaxBy :
4185+ Description : Identifies places where `max_by`/`min_by` can be replaced by `max`/`min`.
4186+ Enabled : pending
4187+ VersionAdded : ' 1.85'
41084188Style/RedundantParentheses :
41094189 Description : Checks for parentheses that seem not to serve any purpose.
41104190 Enabled : false
@@ -4170,6 +4250,11 @@ Style/RedundantStringEscape:
41704250 Description : Checks for redundant escapes in string literals.
41714251 Enabled : false
41724252 VersionAdded : ' 1.37'
4253+ Style/RedundantStructKeywordInit :
4254+ Description : Checks for redundant `keyword_init` option for `Struct.new`.
4255+ Enabled : pending
4256+ SafeAutoCorrect : false
4257+ VersionAdded : ' 1.85'
41734258Style/RegexpLiteral :
41744259 Description : Use / or %r around regular expressions.
41754260 StyleGuide : " #percent-r"
@@ -4218,6 +4303,11 @@ Style/ReturnNilInPredicateMethodDefinition:
42184303 AllowedPatterns : []
42194304 VersionAdded : ' 1.53'
42204305 VersionChanged : ' 1.67'
4306+ Style/ReverseFind :
4307+ Description : Use `array.rfind` instead of `array.reverse.find`.
4308+ Enabled : pending
4309+ Safe : false
4310+ VersionAdded : ' 1.84'
42214311Style/SafeNavigation :
42224312 Description : Transforms usages of a method call safeguarded by a check for the existence
42234313 of the object to safe navigation (`&.`). Autocorrection is unsafe as it assumes
@@ -4247,8 +4337,18 @@ Style/Sample:
42474337 - https://github.com/fastruby/fast-ruby#arrayshufflefirst-vs-arraysample-code
42484338 Enabled : false
42494339 VersionAdded : ' 0.30'
4340+ Style/SelectByKind :
4341+ Description : Prefer grep/grep_v to select/reject/find/detect with a kind check.
4342+ Enabled : pending
4343+ SafeAutoCorrect : false
4344+ VersionAdded : ' 1.85'
4345+ Style/SelectByRange :
4346+ Description : Prefer grep/grep_v to select/reject/find/detect with a range check.
4347+ Enabled : pending
4348+ SafeAutoCorrect : false
4349+ VersionAdded : ' 1.85'
42504350Style/SelectByRegexp :
4251- Description : Prefer grep/grep_v to select/reject with a regexp match.
4351+ Description : Prefer grep/grep_v to select/reject/find/detect with a regexp match.
42524352 Enabled : false
42534353 SafeAutoCorrect : false
42544354 VersionAdded : ' 1.22'
@@ -4469,6 +4569,11 @@ Style/SymbolProc:
44694569 - define_method
44704570 AllowedPatterns : []
44714571 AllowComments : false
4572+ Style/TallyMethod :
4573+ Description : Prefer `Enumerable#tally` over manual counting patterns.
4574+ Enabled : pending
4575+ Safe : false
4576+ VersionAdded : ' 1.85'
44724577Style/TernaryParentheses :
44734578 Description : Checks for use of parentheses around ternary conditions.
44744579 Enabled : false
0 commit comments