New
RuboCop v1.84.0
New features
- #14516: Add
AllowImplicitArrayLiteralstoLayout/FirstArrayElementLineBreak. (@koic) - #14750: Add new
Style/ReverseFindcop. (@koic) - #12343: Add new
Style/EmptyClassDefinitioncop to enforce consistent style for empty class definitions. The cop can enforce either a two-line class definition orClass.newfor classes with no body. (@ydakuka) - #14769: Add new
Style/HashLookupMethodcop to enforceHash#[]vsHash#fetchpreference. (@sferik) - #12051: Add new
Style/NegativeArrayIndexcop to enforce using negative array indices instead of calculating array length minus a value. The cop handles both simple index patterns and range patterns, and recognizes preserving methods and their combinations. (@ydakuka) - #14633: Make a new system to handle push and pop locally. (@Magikdidi24)
- #14722: Support
TargetRubyVersion 4.1(experimental). (@koic)
Bug fixes
- #14697: Allow non-method calls in
CategoriesforLayout/ClassStructure. (@fatkodima) - #14784: Fix an error for
Style/GuardClausewhen using heredoc as an argument of raise inelsebranch andifbranch is empty. (@koic) - #14790: Fix an error for
Style/HashLookupMethodcop when there's no receiver. (@viralpraxis) - #14779: Fix autocorrect crash with
ruby_extractorwhen usingoffset: 0and different source buffers. (@ydakuka) - #14762: Fix false negatives for when the branches contains constant assignment. ()
Changes
- #14753: Add support for
squishandsquish!applied to heredoc toLayout/HeredocIndentation. (@lovro-bikic) - #14798: Recognize
Forwardablemethods inLint/DuplicateMethods. (@lovro-bikic) - #14793: Make
Lint/RedundantSplatExpansionaware of constant assignment. (@koic) - #14770: Make
Style/AccessModifierDeclarationsaware of self class. (@koic) - #14748: Add support for other member existence methods to . ()