Releases: rubocop/rubocop
Releases Β· rubocop/rubocop
RuboCop v1.81.1
Bug fixes
- #14563: Fix incorrect autocorrection for
Lint/DeprecatedOpenSSLConstant
whenCipher
appears twice. (@koic)
Changes
- #14565: Allow multiline method chain for
Style/NumberedParameters
andStyle/ItBlockParameter
withEnforcedStyle: allow_single_line
when the block itself is on a single line. (@earlopain)
RuboCop v1.81.0
New features
- #14512: Add
Style/ArrayIntersectWithSingleElement
cop. (@r7kamura) - #10971: Support
EnforcedStyleForMultiline: diff_comma
inStyle/TrailingCommaInArguments
. (@akouryy)
Bug fixes
- #14560: Fix an error for
Style/NilComparison
cop when using thevar.==(nil)
andvar.===(nil)
syntax. (@viralpraxis) - #14535: Fix autocorrect for
Style/ExplicitBlockArgument
when there are two methods that share the same implementation. (@earlopain) - #14527: Fix false negatives for
Style/NumberedParameters
andStyle/ItBlockParameter
when using multiline method chain withEnforcedStyle: allow_single_line
. (@koic) - #14522: Fix false negatives for
Layout/MultilineOperationIndentation
when using indented code on LHS of equality operator in modifier method definition. (@koic) - #14496: Fix false negatives for
Layout/EmptyLineBetweenDefs
forAllowAdjacentOneLineDefs: false
andDefLikeMacros
that take no block. (@earlopain) - #14553: Fix false positives when
EnforcedStyle: allowed_in_returns
and!!
appears across multiple lines in return position. (@koic) - #14557: Fix false positives for
Style/RedundantParentheses
when parentheses are used around a one-linerescue
expression as a condition. (@koic) - #14525: Fix false positives for
Style/RedundantRegexpEscape
when an escaped variable sigil follows#
(e.g.,/#\@foo/
,/#\@@bar/
,/#\$baz/
). (@koic) - #14529: Fix false negative in
Layout/RescueEnsureAlignment
with a block whose send node is split over multiple lines. (@dvandersluis) - #14528: Fix
Style/RedundantFormat
when the format string has a variable width that isn't given as a literal value. (@dvandersluis) - #14541: Fix gemspec parsing error when
ParserEngine: parser_prism
is configured in a base config file. (@sudoremo) - #14544: Fix an incorrect autocorrect for
Lint/Void
when using a return value in assignment method definition. (@koic) - #14543: Fix an incorrect autocorrect for
Style/RedundantRegexpArgument
when using escaped single quote character. (@koic) - #14540: Fix an incorrect autocorrect for
Style/UnlessElse
when usingunless
withthen
. (@koic) - #14507: Fix the built-in Ruby LSP add-on not restarting when config files (
.rubocop.yml
,.rubocop_todo.yml
) change. (@earlopain) - #14514: Fix the built-in Ruby LSP add-on not respecting
.rubocop
config file. (@earlopain) - #14508: Fix the built-in Ruby LSP add-on getting in an irrecoverable state when the config is invalid on startup. (@earlopain)
- #14534: Prevent
Layout/LineLength
autocorrection from splitting a block if its receiver contains a heredoc. (@dvandersluis) - #14497: Fix a false positive for
Lint/ShadowedArgument
when assigning inside arescue
block. (@earlopain)
Changes
RuboCop v1.80.2
Bug fixes
- #14477: Fix a false positive for
Style/SafeNavigation
when using ternary expression with index access call with method chain. (@koic) - #14486: Fix false positives for
Style/RedundantParentheses
with unary operators andyield
,super
, ordefined?
. (@earlopain) - #14489: Fix false negatives for
Style/RedundantParentheses
with method calls taking argument without parentheses likereturn (x y) if z
. (@earlopain) - #14499: Fix wrong autocorrect for
Style/StringConcatenation
when a double-quoted string contains escaped quotes and interpolation. (@earlopain) - #14502: Fix wrong autocorrect for
Style/StringConcatenation
when a single-quoted string contains interpolation like'#{foo}'
. (@earlopain)
Changes
RuboCop v1.80.1
Bug fixes
- #14479: Don't invalidate cache when
--display-time
option is used on the CLI. (@lovro-bikic) - #14473: Fix a false negative for
Style/RedundantBegin
usingbegin
with multiple statements withoutrescue
orensure
. (@koic) - #14475: Fix cop errors during autocorrect for the build in LSP when analyzing as Ruby 3.4. (@earlopain)
Changes
- #14474: Fix false negative for
Layout/EndAlignment
whenend
is not on a separate line. (@lovro-bikic)
RuboCop v1.80.0
Bug fixes
- #14469: Fix an incorrect autocorrect for
Style/BitwisePredicate
when using&
with LHS flags in conjunction with==
for comparisons. (@koic) - #14459: Fix wrong autocorrect for
Style/For
with save navigation in the collection. (@earlopain) - #14435: Fix false negatives for regexp cops when
Lint/DuplicateRegexpCharacterClassElement
is enabled. (@earlopain) - #14419: Fix false positives for
Lint/UselessAssignment
when duplicate assignments appear in nestedif
branches inside a loop and the variable is used outsidewhile
loop. (@koic) - #14468: Fix false positives for
Naming/MethodName
when an operator method is defined using a string. (@koic) - #14427: Fix false positives for
Style/RedundantParentheses
whendo
...end
block is wrapped in parentheses as a method argument. (@koic) - #14441: Better hash access handling in
Style/SafeNavigation
. (@issyl0) - #14443: Fix false positive in
Layout/EmptyLinesAfterModuleInclusion
wheninclude
does not have exactly one argument. (@issyl0) - #14424: Fix
Style/SafeNavigation
cop to preserve existing safe navigation in fixed code. (@martinemde) - #14455: Follow module inclusion with nonzero args with an empty line. (@issyl0)
- #14445: Fix false positives for
Lint/UselessAssignment
withfor
loops when the variable is referenced in the collection. (@earlopain) - #14447: Fix wrong autocorrect for
Style/RedundantCondition
with a parenthesised method call in the condition. (@earlopain)
Changes
- #14428: Enhance
Lint/SelfAssignment
to handle indexed assignment with multiple arguments. (@viralpraxis) - #14464: Exclude
AutoCorrect
andInclude
from configuration parameters. (@r7kamura) - #14472: Make
Style/RedundantBegin
aware ofcase
pattern matching. (@koic) - #14448: Register array intersection size checks as offenses under
Style/ArrayIntersect
. (@lovro-bikic) - #14431: Support LSP
TextDocumentSyncKind.Incremental
. (@tmtm) - #14453: Update
Style/RedundantBegin
to registerbegin
blocks insideif
,unless
,case
,while
anduntil
as redundant. (@dvandersluis)
RuboCop v1.79.2
Bug fixes
- #11664: Cache wasn't getting used when using parallelization. (@jvlara)
- #14411: Fix false negatives for
Layout/EmptyLinesAroundClassBody
when a class body starts with a blank line and defines a multiline superclass. (@koic) - #14413: Fix a false positive for
Layout/EmptyLinesAroundArguments
with multiline strings that contain only whitespace. (@earlopain) - #14408: Fix false-positive for
Layout/EmptyLinesAfterModuleInclusion
when inclusion is called with modifier. (@r7kamura) - #14402: Fix false positives for
Lint/UselessAssignment
when duplicate assignments appear inif
branch inside a loop and the variable is used outsidewhile
loop. (@koic) - #14416: Fix false positives for
Style/MapToHash
when usingto_h
with block argument. (@koic) - #14418: Fix false positives for
Style/MapToSet
when usingto_set
with block argument. (@koic) - #14420: Fix false positives for
Style/SafeNavigation
when ternary expression with operator method call with method chain. (@koic)
Changes
- #14407: Register offense for parentheses around method calls with blocks in
Style/RedundantParentheses
. (@lovro-bikic)
RuboCop v1.79.1
Bug fixes
- #14390: Fix wrong autocorrect for
Style/ArgumentsForwarding
when the method arguments contain*
,**
or&
, and the method call containsself
as the first argument. (@earlopain) - #14399: Fix false positives for
Layout/EmptyLinesAfterModuleInclusion
whenprepend
is used with block methods. (@koic) - #14396: Fix a false positive for
Style/RedundantParentheses
when parentheses are used around a one-linerescue
expression inside a ternary operator. (@koic) - #14383: Fix false positives for
Lint/UselessAssignment
when duplicate assignments inif
branch inside a loop. (@koic) - #14394: Fix false positive for
Lint/UselessAssignment
withretry
inrescue
branch. (@earlopain) - #14386: Fix false positives for
Style/RedundantParentheses
when parentheses are used around a one-linerescue
expression inside array or hash literals. (@koic) - #14395: Fix LSP handling of URI-encoded paths with spaces. (@hakanensari)
Changes
- #14403: Enhance
Naming/MethodName
cop to detect offenses withinalias
andalias_method
calls. (@viralpraxis) - #14389: Add support for
||
toLint/LiteralAsCondition
. (@zopolis4)
RuboCop v1.79.0
New features
- #14348: Add new cop
Layout/EmptyLinesAfterModuleInclusion
. (@lovro-bikic) - #14374: Enhance
Naming/MethodName
cop to detect offenses withinData
members. (@viralpraxis)
Bug fixes
- #14373: Fix an error for
Style/ParallelAssignment
when a lambda with parallel assignment is used on the RHS. (@koic) - #14370: Fix comment duplication bug in
Style/AccessorGrouping
separated autocorrect. (@r7kamura) - #14377: Fix a false positive for
Lint/UselessAssignment
when the assignment is inside a loop body. (@5hun-s) - #14355: Fix a false negative for
Style/RedundantParentheses
when using parentheses around arescue
expression on a one-line. (@koic) - #14354: Fix incorrect autocorrect for
Style/AccessModifierDeclarations
when using a grouped access modifier declaration. (@girasquid) - #14367: Fix an incorrect autocorrect for
Style/SingleLineMethods
when defining a single-line singleton method. (@koic) - #14344: Fix incorrect autocorrect for
Style/SingleLineMethods
when a single-line method definition contains a modifier. (@koic) - #14350: Fix
Naming/MethodName
cop false positives withdefine_method
and operator names. (@viralpraxis) - #14333: Fix
Naming/PredicateMethod
ignoring the implicitnil
from missingelse
branches. (@earlopain) - #14356: Fix
Style/ItBlockParameter
cop error onalways
style and missing block body. (@viralpraxis) - #14362: Update
Lint/RequireRangeParentheses
to not register false positives when range elements span multiple lines. (@dvandersluis) - #14309: Update
Style/SoleNestedConditional
to properly correct assignments withinand
. (@dvandersluis)
Changes
- #14358: Add
tsort
gem to runtime dependency for Ruby 3.5-dev. (@koic) - #14322: Expand the scope of
Style/ItAssignment
to consider all local variable and method parameter names. (@dvandersluis) - #14378: Change
Layout/SpaceAroundKeyword
to offend for missing whitespace betweenreturn
and opening parenthesis. (@lovro-bikic) - #14360: Make
Layout/SpaceAroundOperators
aware of alternative and as pattern matchings. (@koic) - #14375: Make
Lint/RedundantSafeNavigation
aware of builtin convert methodsto_s
,to_i
,to_f
,to_a
, andto_h
. (@koic) - #13835: Add
InferNonNilReceiver
config toLint/RedundantSafeNavigation
to check previous code paths if the receiver is non-nil. (@fatkodima) - #14381: Offend
array1.any? { |elem| array2.member?(elem) }
andarray1.none? { |elem| array2.member?(elem) }
inStyle/ArrayIntersect
. (@lovro-bikic)
RuboCop v1.78.0
New features
- #14331: Enhance
Naming/MethodName
cop to detect offenses withindefine_method
calls. (@viralpraxis) - #14325: Enhance
Naming/MethodName
cop to handle offenses withinStruct
members. (@viralpraxis) - #14335: Enhance
Security/Eval
cop to detectKernel.eval
calls. (@viralpraxis)
Bug fixes
- #14343: Fix autocorrect code for
Style/HashConversion
to avoid syntax error. (@koic) - #14346: Avoid requiring parentheses for
Style/SingleLineMethods
. (@koic) - #14339: Fix bug where specifying
--format
disables parallelization. (@r7kamura) - #14300: Fix false positives for
Lint/DuplicateMethods
cop when self-alias trick is used. (@viralpraxis) - #14329: Fix false positives for
Lint/LiteralAsCondition
when a literal is used inside||
incase
condition. (@koic) - #14326: Fix additional autocorrection errors in
Style/HashConversion
for nestedHash[]
calls. (@dvandersluis) - #14031: Honor --config options on server mode. (@steiley)
- #14319: Fix the following incorrect autocorrect for
Lint/RedundantTypeConversion
when using parentheses with no arguments or any arguments. (@koic) - #14336: Fix incorrect autocorrect for
Style/ItBlockParameter
when using a single numbered parameter after multiple numbered parameters in a method chain. (@koic) - #11782: Move pending cops warning out of ConfigLoader. (@nobuyo)
Changes
- #14318: Add
WaywardPredicates
config toNaming/PredicateMethod
to handle methods that look like predicates but aren't. (@dvandersluis)
RuboCop v1.77.0
New features
- #14223: Add new
Gemspec/AttributeAssignment
cop. (@viralpraxis) - #14128: Allow long fully-qualified namespace strings to exceed max length. (@niranjan-patil)
- #14288: Add new cop
Style/CollectionQuerying
. (@lovro-bikic) - #14165: Add new
DefaultToNil
option toStyle/FetchEnvVar
cop. (@Yuhi-Sato) - #14314: Enhance
Gemspec/RequireMFA
cop autocorrect to insert MFA directive after lastmetadata
assignment. (@viralpraxis) - #14159: Enhance
Layout/SpaceInsideArrayLiteralBrackets
cop to analyze nested constant patterns. (@viralpraxis)
Bug fixes
- #14306: Fix an error for
Style/HashConversion
when using nestedHash[]
. (@koic) - #14298: Fix an error for
Style/SoleNestedConditional
when autocorrecting nested if/unless/if. (@ssagara00) - #14313: Fix a false positive for
Layout/SpaceBeforeBrackets
when call desugaredHash#[]
to lvar receiver with a space around the dot. (@koic) - #14292: Fix false positives for
Style/RedundantParentheses
when assigning a parenthesized one-linein
pattern matching. (@koic) - #14296: Fix false positives for
Style/RedundantSelf
when receiver and lvalue have the same name in or-assignment. (@koic) - #14303: Fix
Lint/SelfAssignment
to allow inline RBS comments. (@Morriar) - #14307: Fix
Style/MethodCallWithArgsParentheses
false positive on forwarded keyword argument with additional arguments. (@viralpraxis) - #14301: Fix autocorrection syntax error for multiline expressions in
Style/RedundantParentheses
. (@lovro-bikic)
Changes
- #14295: Update
Naming/PredicateMethod
to consider negation (!
/not
) as boolean values. (@dvandersluis) - #14255: Update
Naming/PredicateMethod
to treat returned predicate method calls as boolean values. (@dvandersluis)