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
Style/RedundantConditionwhen the branches contains constant assignment. (@koic) - #14751: Fix
--force-default-confignot preventing project config loading when used with options that access configuration. (@sakuro) - #14783: Fix incorrect autocorrect for
Style/HashSyntaxwhen shorthand syntax is used in condition ofif/unless/while/until. (@ydakuka) - #14747: Fix a regression in
Layout/IndentationWidthby adding a newEnforcedStyleAlignWithstyle parameter. (@MikeMcQuaid) - #14716: Fix an infinite loop error for
Layout/LineLengthwhenSplitStringsoption is enabled and strings span multiple lines. (@HariprasanthMSH) - #14763: Fix an infinite loop error for
Layout/IndentationWidthandLayout/IndentationConsistencywhen usingEnforcedStyle: indented_internal_methodswith method chain blocks. (@ydakuka) - #9373: Fix an infinite loop error for
Layout/IndentationWidthwhen autocorrecting mixed tabs and spaces in blocks. Fix an infinite loop error forLayout/DefEndAlignmentandLayout/IndentationStylewhen autocorrecting mixed tabs and spaces. Autocorrection for tabs is disabled inAlignmentCorrectorfor indentation offenses, but enabled foralign_end. (@ydakuka) - #12295: Fix
Layout/FirstArgumentIndentationto correct entire method calls and chains for nested calls. (@ydakuka) - #12527: Fix
Offense#highlighted_areato return a validParser::Source::Range. (@ydakuka) - #14801: Preserve source tabs in Clang and Tap formatters when displaying offense highlight. (@lovro-bikic)
- #14761: Improved the remote configuration file name on the cache location. (@Jack12816)
- #14778: Fix a false positive for
Security/JSONLoadwhencreate_additionsoption is passed with other options in a hash. (@wktk) - #14796: Handle logical and operator assignment nodes in variable branch handling. (@lovro-bikic)
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
Modulemember existence methods toStyle/ModuleMemberExistenceCheck. (@lovro-bikic) - #14795: Add
AllowedMethodsconfiguration toStyle/ModuleMemberExistenceCheck. (@lovro-bikic)