Releases: rubocop/rubocop
Releases · rubocop/rubocop
RuboCop 1.60.2
Bug fixes
- #12627: Fix a false positive for
Layout/RedundantLineBreak
when using index access call chained on multiple lines with backslash. (@koic) - #12626: Fix a false positive for
Style/ArgumentsForwarding
when naming a block argument&
. (@koic) - #12635: Fix a false positive for
Style/HashEachMethods
when both arguments are unused. (@earlopain) - #12636: Fix an error for
Style/HashEachMethods
when a block with both parameters has no body. (@earlopain) - #12638: Fix an
Errno::ENOENT
error when using server mode. (@koic) - #12628: Fix a false positive for
Style/ArgumentsForwarding
when using block arg forwarding with positional arguments forwarding to within block. (@koic) - #12642: Fix false positives for
Style/HashEachMethods
when using array converter method. (@koic) - #12632: Fix an infinite loop error when
EnforcedStyle: explicit
ofNaming/BlockForwarding
withStyle/ArgumentsForwarding
. (@koic)
RuboCop 1.60.1
Bug fixes
- #12625: Fix an error when server cache dir has read-only file system. (@Strzesia)
- #12618: Fix false positives for
Style/ArgumentsForwarding
when using block argument forwarding with other arguments. (@koic) - #12614: Fix false positiveis for
Style/RedundantParentheses
when parentheses in control flow keyword with multiline style argument. (@koic)
Changes
RuboCop 1.60
Bug fixes
- #12603: Fix an infinite loop error for
Style/MultilineTernaryOperator
when using a method call as a ternary operator condition with a line break between receiver and method. (@koic) - #12549: Fix a false positive for
Style/RedundantLineContinuation
when line continuations for multiline leading dot method chain with a blank line. (@koic) - #12610: Accept parentheses in argument calls with blocks for
Style/MethodCallWithArgsParentheses
omit_parentheses
style. (@gsamokovarov) - #12580: Fix an infinite loop error for
Layout/EndAlignment
when misaligned in singleton class assignments withEnforcedStyleAlignWith: variable
. (@koic) - #12548: Fix an infinite loop error for
Layout/FirstArgumentIndentation
when specifyingEnforcedStyle: with_fixed_indentation
ofLayout/ArrayAlignment
. (@koic) - #12236: Fix an error for
Lint/ShadowedArgument
when self assigning to a block argument infor
. (@koic) - #12569: Fix an error for
Style/IdenticalConditionalBranches
when usingif
...else
with identical leading lines that assign toself.foo
. (@koic) - #12437: Fix an infinite loop error for
EnforcedStyle: omit_parentheses
ofStyle/MethodCallWithArgsParentheses
withStyle/SuperWithArgsParentheses
. (@koic) - #12558: Fix an incorrect autocorrect for
Style/MapToHash
when usingmap.to_h
without receiver. (@koic) - #12179: Let
--auto-gen-config
generateExclude
whenMax
is overridden. (@jonas054) - #12574: Fix bug for unrecognized style in --auto-gen-config. (@jonas054)
- #12542: Fix false positive for
Lint/MixedRegexpCaptureTypes
when using look-ahead matcher. (@marocchino) - #12607: Fix a false positive for
Style/RedundantParentheses
when regexp literal attempts to match against a parenthesized condition. (@koic) - #12539: Fix false positives for
Lint/LiteralAssignmentInCondition
when a collection literal contains non-literal elements. (@koic) - #12571: Fix false positives for
Naming/BlockForwarding
when using explicit block forwarding in block method. (@koic) - #12537: Fix false positives for
Style/RedundantParentheses
whenAllowInMultilineConditions: true
ofStyle/ParenthesesAroundCondition
. (@koic) - #12578: Fix false positives for
Style/ArgumentsForwarding
when rest arguments forwarding to a method in block. (@koic) - #12540: Fix false positives for
Style/HashEachMethods
when rest block argument ofEnumerable#each
method is used. (@koic) - #12529: Fix false positives for
Style/ParenthesesAroundCondition
. (@koic) - #12556: Fix false positives for
Style/RedundantParentheses
when parentheses are used around a semantic operator in expressions within assignments. (@koic) - #12541: Fix false negative in
Style/ArgumentsForwarding
when a block is forwarded but other args aren't. (@dvandersluis) - #12581: Handle trailing line continuation in
Layout/LineContinuationLeadingSpace
. (@eugeneius) - #12601: Make
Style/EachForSimpleLoop
accept block with no parameters. (@koic)
Changes
- #12535: Allow --autocorrect with --display-only-fail-level-offenses. (@naveg)
- #12572: Follow a Ruby 3.3 warning for
Security/Open
whenopen
with a literal string starting with a pipe. (@koic) - #12453: Make
Style/RedundantEach
aware of safe navigation operator. (@koic) - #12233: Make
Style/SlicingWithRange
aware of redundant and beginless range. (@koic) - #12388: Reject additional 'expanded'
EnforcedStyle
options when--no-auto-gen-enforced-style
is given. (@kpost) - #12593: Require Parser 3.3.0.2 or higher. (@koic)
RuboCop 1.59
New features
Bug fixes
- #12434: Fix a false positive for
Lint/LiteralAssignmentInCondition
when using interpolated string or xstring literals. (@koic) - #12435: Fix a false positive for
Lint/SelfAssignment
when using attribute assignment with method call with arguments. (@koic) - #12444: Fix false positive for
Style/HashEachMethods
when receiver literal is not a hash literal. (@koic) - #12524: Fix a false positive for
Style/MethodCallWithArgsParentheses
whenEnforcedStyle: omit_parentheses
and parens inwhen
clause is used to pass an argument. (@koic) - #12505: Fix a false positive for
Style/RedundantParentheses
when using parenthesizedlambda
orproc
withdo
...end
block. (@koic) - #12442: Fix an incorrect autocorrect for
Style/CombinableLoops
when looping over the same data as previous loop indo
...end
and{
...}
blocks. (@koic) - #12432: Fix a false positive for
Lint/LiteralAssignmentInCondition
when using parallel assignment with splat operator in block of guard condition. (@koic) - #12441: Fix false positives for
Style/HashEachMethods
when using destructed block arguments. (@koic) - #12436: Fix false positives for
Style/RedundantParentheses
when a part of range is a parenthesized condition. (@koic) - #12429: Fix incorrect autocorrect for
Style/MapToHash
when using dot method calls forto_h
. (@koic) - #12488: Make
Lint/HashCompareByIdentity
aware of safe navigation operator. (@koic) - #12489: Make
Lint/NextWithoutAccumulator
aware of safe navigation operator. (@koic) - #12490: Make
Lint/NumberConversion
aware of safe navigation operator. (@koic) - #12491: Make
Lint/RedundantWithIndex
aware of safe navigation operator. (@koic) - #12492: Make
Lint/RedundantWithObject
aware of safe navigation operator. (@koic) - #12493: Make
Lint/UnmodifiedReduceAccumulator
aware of safe navigation operator. (@koic) - #12473: Make
Style/ClassCheck
aware of safe navigation operator. (@koic) - #12445: Make
Style/CollectionCompact
aware of safe navigation operator. (@koic) - #12474: Make
Style/ConcatArrayLiterals
aware of safe navigation operator. (@koic) - #12476: Make
Style/DateTime
aware of safe navigation operator. (@koic) - #12479: Make
Style/EachWithObject
aware of safe navigation operator. (@koic) - #12446: Make
Style/HashExcept
aware of safe navigation operator. (@koic) - #12447: Make
Style/MapCompactWithConditionalBlock
aware of safe navigation operator. (@koic) - #12484: Make
Style/Next
aware of safe navigation operator. (@koic) - #12486: Make
Style/RedundantArgument
aware of safe navigation operator. (@koic) - #12454: Make
Style/RedundantFetchBlock
aware of safe navigation operator. (@koic) - #12495: Make
Layout/RedundantLineBreak
aware of safe navigation operator. (@koic) - #12455: Make
Style/RedundantSortBy
aware of safe navigation operator. (@koic) - #12456: Make
Style/RedundantSortBy
aware of safe navigation operator. (@koic) - #12480: Make
Style/ExactRegexpMatch
aware of safe navigation operator. (@koic) - #12457: Make
Style/Sample
aware of safe navigation operator. (@koic) - #12458: Make
Style/SelectByRegexp
cops aware of safe navigation operator. (@koic) - #12494: Make
Layout/SingleLineBlockChain
aware of safe navigation operator. (@koic) - #12461: Make
Style/StringChars
aware of safe navigation operator. (@koic) - #12468: Make
Style/Strip
aware of safe navigation operator. (@koic) - #12469: Make
Style/UnpackFirst
aware of safe navigation operator. (@koic)
Changes
RuboCop 1.58
New features
- #12420: Add new
Lint/LiteralAssignmentInCondition
cop. (@koic) - #12353: Add new
Style/SuperWithArgsParentheses
cop. (@koic) - #12406: Add new
Style/ArrayFirstLast
cop. (@fatkodima)
Bug fixes
- #12372: Fix a false negative for
Lint/Debugger
when used within method arguments abegin
...end
block. (@koic) - #12378: Fix a false negative for
Style/Semicolon
when a semicolon at the beginning of a lambda block. (@koic) - #12146: Fix a false positive for
Lint/FloatComparison
when comparing against zero. (@earlopain) - #12404: Fix a false positive for
Layout/RescueEnsureAlignment
when alignedrescue
indo
-end
numbered block in a method. (@koic) - #12374: Fix a false positive for
Layout/SpaceBeforeSemicolon
when a space between an opening lambda brace and a semicolon. (@koic) - #12326: Fix an error for
Style/RedundantDoubleSplatHashBraces
when method call for parenthesized no hash double double splat. (@koic) - #12361: Fix an incorrect autocorrect for
Naming/BlockForwarding
andStyle/ArgumentsForwarding
when autocorrection conflicts for anonymous arguments. (@koic) - #12324: Fix an error for
Layout/RescueEnsureAlignment
when usingrescue
indo
...end
block assigned to object attribute. (@koic) - #12322: Fix an error for
Style/CombinableLoops
when looping over the same data for the third consecutive time or more. (@koic) - #12366: Fix a false negative for
Layout/ExtraSpacing
when a file has exactly two comments. (@eugeneius) - #12373: Fix a false negative for
Lint/SymbolConversion
when using string interpolation. (@earlopain) - #12402: Fix false negatives for
Style/RedundantLineContinuation
when redundant line continuations for a block are used, especially without parentheses around first argument. (@koic) - #12311: Fix false negatives for
Style/RedundantParentheses
when parentheses around logical operator keywords in method definition. (@koic) - #12394: Fix false negatives for
Style/RedundantReturn
whenlambda
(->
) ending withreturn
. (@koic) - #12377: Fix false positives for
Lint/Void
when a collection literal that includes non-literal elements in a method definition. (@koic) - #12407: Fix an incorrect autocorrect for
Style/MapToHash
withLayout/SingleLineBlockChain
. (@koic) - #12409: Fix an incorrect autocorrect for
Lint/SafeNavigationChain
when ordinary method chain exists after safe navigation leading dot method call. (@koic) - #12363: Fix incorrect rendering of HTML character entities in
HTMLFormatter
formatter. (@koic) - #12424: Make
Style/HashEachMethods
aware of safe navigation operator. (@koic) - #12413: Make
Style/InverseMethods
aware of safe navigation operator. (@koic) - #12408: Make
Style/MapToHash
aware of safe navigation operator. (@koic)
Changes
- #12328: Make
Style/AutoResourceCleanup
aware ofTempfile.open
. (@koic) - #12412: Enhance
Lint/RedundantSafeNavigation
to handle conversion methods with defaults. (@fatkodima) - #12410: Enhance
Lint/SelfAssignment
to check attribute assignment and key assignment. (@fatkodima) - #12370: Make
Style/HashEachMethods
aware of unused block value. (@koic) - #12380: Make
Style/RedundantParentheses
aware of lambda or proc. (@koic) - #12421: Make
Style/SelfAssignment
aware of%
,^
,<<
, and>>
operators. (@koic) - #12305: Require
rubocop-ast
version 1.30 or greater. (@sambostock) - #12337: Supports
EnforcedStyleForRationalLiterals
option forLayout/SpaceAroundOperators
. (@koic) - #12296: Support
RedundantRestArgumentNames
,RedundantKeywordRestArgumentNames
, andRedundantBlockArgumentNames
options forStyle/ArgumentsForwarding
. (@koic)
RuboCop 1.57.2
Bug fixes
- #12274: Fix a false positive for
Lint/Void
wheneach
's receiver is an object ofEnumerator
to whichfilter
has been applied. (@koic) - #12291: Fix a false positive for
Metrics/ClassLength
when a class with a singleton class definition. (@koic) - #12293: Fix a false positive for
Style/RedundantDoubleSplatHashBraces
when using double splat hash braces withmerge
and method chain. (@koic) - #12298: Fix a false positive for
Style/RedundantParentheses
when using a parenthesized hash literal as the first argument in a method call without parentheses. (@koic) - #12283: Fix an error for
Style/SingleLineDoEndBlock
when using single linedo
...end
with no body. (@koic) - #12312: Fix an incorrect autocorrect for
Style/HashSyntax
when braced hash key and value are the same and it is used inif
...else
. (@koic) - #12307: Fix an infinite loop error for
Layout/EndAlignment
whenEnforcedStyleAlignWith: variable
and using a conditional statement in a method argument on the same line andend
with method call is not aligned. (@koic) - #11652: Make
--auto-gen-config
generateinherit_from
correctly inside ERBif
. (@jonas054) - #12310: Drop
base64
gem from runtime dependency. (@koic) - #12300: Fix an error for
Style/IdenticalConditionalBranches
whenif
...else
with identical leading lines and using index assign. (@koic) - #12286: Fix false positives for
Style/RedundantDoubleSplatHashBraces
when using double splat with a hash literal enclosed in parenthesized ternary operator. (@koic) - #12279: Fix false positives for
Lint/EmptyConditionalBody
when missing 2ndif
body with a comment. (@koic) - #12275: Fix a false positive for
Style/RedundantDoubleSplatHashBraces
when using double splat within block argument containing a hash literal in an array literal. (@koic) - #12284: Fix false positives for
Style/SingleArgumentDig
when using some anonymous argument syntax. (@koic) - #12301: Make
Style/RedundantFilterChain
aware of safe navigation operator. (@koic)
RuboCop 1.57.1
Bug fixes
- #12271: Fix a false positive for
Lint/RedundantSafeNavigation
when using snake case constant receiver. (@koic) - #12265: Fix an error for
Layout/MultilineMethodCallIndentation
when usingarithmetic operation with block inside a grouped expression. (@koic) - #12177: Fix an incorrect autocorrect for
Style/RedundantException
. (@ydah) - #12261: Fix an infinite loop for
Layout/MultilineMethodCallIndentation
when multiline method chain with a block argument and method chain. (@ydah) - #12263: Fix false positives for
Style/RedundantDoubleSplatHashBraces
when method call for no hash braced double splat receiver. (@koic) - #12262: Fix an incorrect autocorrect for
Style/RedundantDoubleSplatHashBraces
when using double splat hash braces withmerge
method call twice. (@koic)
RuboCop 1.57
New features
- #12227: Add new
Style/SingleLineDoEndBlock
cop. (@koic) - #12246: Make
Lint/RedundantSafeNavigation
aware of constant receiver. (@koic) - #12257: Make
Style/RedundantDoubleSplatHashBraces
aware ofmerge
methods. (@koic)
Bug fixes
- #12244: Fix a false negative for
Lint/Debugger
when using debugger method inside block. (@koic) - #12231: Fix a false negative for
Metrics/ModuleLength
when defining a singleton class in a module. (@koic) - #12249: Fix a false positive
Style/IdenticalConditionalBranches
whenif
..else
with identical leading lines and assign to condition value. (@koic) - #12253: Fix
Lint/LiteralInInterpolation
to accept an empty string literal interpolated in words literal. (@knu) - #12198: Fix an error for flip-flop with beginless or endless ranges. (@koic)
- #12259: Fix an error for
Lint/MixedCaseRange
when using nested character class in regexp. (@koic) - #12237: Fix an error for
Style/NestedTernaryOperator
when a ternary operator has a nested ternary operator within anif
. (@koic) - #12228: Fix false negatives for
Style/MultilineBlockChain
when using multiline block chain with safe navigation operator. (@koic) - #12247: Fix false negatives for
Style/RedundantParentheses
when using logical or comparison expressions with redundant parentheses. (@koic) - #12226: Fix false positives for
Layout/MultilineMethodCallIndentation
when aligning methods in multiline block chain. (@koic) - #12076: Fixed an issue where the top-level cache folder was named differently during two consecutive rubocop runs. (@K-S-A)
Changes
- #12235: Enable auto parallel inspection when config file is specified. (@aboutNisblee)
- #12234: Enhance
Style/FormatString
's autocorrection when using known conversion methods whose return value is not an array. (@koic) - #12128: Make
Style/GuardClause
aware ofdefine_method
. (@koic) - #12126: Make
Style/RedundantFilterChain
aware ofselect.present?
whenActiveSupportExtensionsEnabled
config istrue
. (@koic) - #12250: Mark
Lint/RedundantRequireStatement
as unsafe autocorrect. (@koic) - #12097: Mark unsafe autocorrect for
Style/ClassEqualityComparison
. (@koic) - #12210: Mark
Style/RedundantFilterChain
as unsafe autocorrect. (@koic)
RuboCop 1.56.4
Bug fixes
- #12221: Fix a false positive for
Layout/EmptyLineAfterGuardClause
when usingreturn
before guard condition with heredoc. (@koic) - #12213: Fix a false positive for
Lint/OrderedMagicComments
when comment text# encoding: ISO-8859-1
is embedded within example code as source code comment. (@koic) - #12205: Fix an error for
Style/OperatorMethodCall
when usingfoo bar./ baz
. (@koic) - #12208: Fix an incorrect autocorrect for the
--disable-uncorrectable
command line option when registering an offense is outside a percent array. (@koic) - #12203: Fix an incorrect autocorrect for
Lint/SafeNavigationChain
when using safe navigation with comparison operator as an expression of logical operator or comparison operator's operand. (@koic) - #12206: Fix an incorrect autocorrect for
Style/OperatorMethodCall
when usingfoo./bar
. (@koic) - #12202: Fix an incorrect autocorrect for
Style/RedundantConditional
when unless/else with boolean results. (@ydah) - #12199: Fix false negatives for
Layout/MultilineMethodCallIndentation
when using safe navigation operator. (@koic)
Changes
RuboCop 1.56.3
Bug fixes
- #12151: Make
Layout/EmptyLineAfterGuardClause
allow:nocov:
directive after guard clause. (@koic) - #12195: Fix a false negative for
Layout/SpaceAfterNot
when a newline is present after!
. (@ymap) - #12192: Fix a false positive for
Layout/RedundantLineBreak
when using quoted symbols with a single newline. (@ymap) - #12190: Fix a false positive for
Layout/SpaceAroundOperators
when aligning operators vertically. (@koic) - #12171: Fix a false positive for
Style/ArrayIntersect
when using block argument forEnumerable#any?
. (@koic) - #12172: Fix a false positive for
Style/EmptyCaseCondition
when usingreturn
,break
,next
or method call before empty case condition. (@koic) - #12162: Fix an error for
Bundler/DuplicatedGroup
when there's a duplicate set of groups and thegroup
value contains a splat. (@koic) - #12182: Fix an error for
Lint/UselessAssignment
when variables are assigned using chained assignment and remain unreferenced. (@koic) - #12181: Fix an incorrect autocorrect for
Lint/UselessAssignment
when variables are assigned with sequential assignment using the comma operator and unreferenced. (@koic) - #12187: Fix an incorrect autocorrect for
Style/SoleNestedConditional
when comment is in an empty nestedif
body. (@ymap) - #12183: Fix an incorrect autocorrect for
Style/MultilineTernaryOperator
when returning a multiline ternary operator expression with safe navigation method call. (@koic) - #12168: Fix bug in
Style/ArgumentsForwarding
when there are repeated send nodes. (@owst) - #12185: Set target version for
Layout/HeredocIndentation
. (@tagliala)