Releases: rubocop/rubocop
Releases · rubocop/rubocop
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)
RuboCop v1.76.2
Bug fixes
- #14273: Fix an error for
Lint/EmptyInterpolation
when using a boolean literal inside interpolation. (@koic) - #14260: Fix an error for
Lint/UselessDefaultValueArgument
whenfetch
call without a receiver. (@koic) - #14267: Fix an error for
Style/ConditionalAssignment
cop when using one-line branches. (@viralpraxis) - #14275: Fix false positives for
Style/RedundantParentheses
when using parenthesized one-line pattern matching in endless method definition. (@koic) - #14269: Fix false positives for
Style/RedundantSelf
when local variable assignment name is used in nestedif
. (@koic) - #14286: Fix incorrect autocorrect for
Lint/SafeNavigationChain
when a safe navigation is used on the left-hand side of a-
operator when inside an array. (@koic)
Changes
- #14232: Add
AllowedPatterns
andAllowBangMethods
configuration toNaming/PredicateMethod
. (@dvandersluis) - #14268: Register operator expression range boundaries as offenses in
Lint/AmbiguousRange
. (@lovro-bikic) - #14264: Offend access modifiers used on top-level in
Lint/UselessAccessModifier
. (@lovro-bikic) - #14278: Register conditions wrapped in parentheses as offenses in
Style/MinMaxComparison
. (@lovro-bikic)
RuboCop v1.76.1
Bug fixes
- #14245: Fix an error for
Lint/EmptyInterpolation
when using primitives in interpolation. (@ka8725) - #14233: Fix an error for
Style/SafeNavigation
when using ternary expression with index access call. (@koic) - #14236: Fix an error for
Style/SafeNavigation
when using ternary expression with operator method call. (@koic) - #14249: Fix false positives for
Style/RedundantArrayFlatten
whenArray#join
is used with an argument other than the defaultnil
. (@koic) - #14239: Fix false positives for
Style/RedundantParentheses
when using one-linein
pattern matching in operator. (@koic) - #14240: Fix
Naming/PredicateMethod
cop error on empty parentheses method body. (@viralpraxis) - #14235: Fix
Style/SafeNavigation
cop error on indexed assignment in ternary expression. (@viralpraxis) - #14247: Fix
Style/SafeNavigation
invalid autocorrection on double colon method call. (@viralpraxis)
RuboCop v1.76.0
New features
- #12360: Add new
Naming/PredicateMethod
cop to check that predicate methods end with?
and non-predicate methods do not. (@dvandersluis) - #13121: Add new
Style/EmptyStringInsideInterpolation
cop. (@zopolis4) - #14091: Add new cop
Style/RedundantArrayFlatten
. (@lovro-bikic) - #14184: Add new cop
Lint/UselessOr
. (@lovro-bikic) - #14221: Enhance
Gemspec
department cops to detect offenses if specification variable isit
or a numbered parameter. (@viralpraxis) - #14166: Add new cop
Lint/UselessDefaultValueArgument
. (@lovro-bikic)
Bug fixes
- #14228: Fix a false positive for
Style/RedundantParentheses
when using a one-linerescue
expression as a method argument. (@koic) - #14224: Fix false negatives for
Style/RedundantParentheses
when using one-line pattern matching. (@koic) - #14205: False negatives in
Style/SafeNavigation
when a ternary expression is used in a method argument. (@steiley) - #14226: Fix
Lint/LiteralAsCondition
autocorrect when branches of a condition have comments. (@zopolis4)
Changes
- #14066: Add
EnforcedStyle: allow_single_line
as the default toStyle/ItBlockParameter
. (@koic) - #13788: Disable
Lint/ShadowingOuterLocalVariable
by default. (@nekketsuuu) - #14215: Recognize inequation (
!=
) inLint/IdentityComparison
. (@lovro-bikic)
RuboCop v1.75.8
Bug fixes
- #14191: Fix
Lint/FloatComparison
cop to detect floating-point number comparisons incase
statements. (@daisuke) - #14209: Fix an error for
Style/RedundantFormat
with invalid format arguments. (@earlopain) - #14200: Fix false positives for
Style/DefWithParentheses
when using endless method definition with empty parentheses and a space before=
. (@koic) - #14197: Fix infinite loop error for
EnforcedStyle: with_fixed_indentation
ofLayout/ArgumentAlignment
andEnforcedStyle: consistent
ofLayout/FirstArgumentIndentation
andLayout/HashAlignment
. (@koic) - #14204: Fix
Layout/EmptyLinesAroundAccessModifier
cop error on trailing access modifier. (@viralpraxis) - #14198: Fix
Lint/DuplicateMethods
cop error onto
option is dynamically generated andprefix
is enabled. (@viralpraxis) - #14199: Fix wrong autocorrection for
Style/MapToHash
with destructuring argument. (@lovro-bikic) - #14050: Modify condition for
rubocop:todo
EOL comment. (@jonas054)
RuboCop v1.75.7
Bug fixes
- #14185: Fix an error for
Style/IfUnlessModifierOfIfUnless
when using nested modifier. (@koic) - #14192: Fix negatives for
Layout/SpaceBeforeBrackets
when using space between method argument parentheses and left bracket. (@koic) - #14189: Fix incorrect autocorrect for
Layout/SpaceBeforeBrackets
when using space between receiver and left brackets, and a space inside left bracket. (@koic) - #14170: Fix
Style/AccessModifierDeclarations
cop error on semicolon after modifier. (@viralpraxis) - #14195: Fix
Style/AccessModifierDeclarations
cop error on symbol modifier without surrounding scope. (@viralpraxis) - #14172: Fix
Style/AccessModifierDeclarations
cop false positives when there are no method definitions and style isinline
. (@viralpraxis) - #14193: Fix
Lint/UselessAssignment
cop error when using nested assignment with splat. (@earlopain)
Changes
- #14188: Enhance
Gemspec/DuplicatedAssignment
cop to detect duplicated indexed assignment. (@viralpraxis) - #14183: Recognize
prefix
argument fordelegate
method inLint/DuplicateMethods
. (@lovro-bikic)
RuboCop v1.75.6
Bug fixes
- #14176: Fix an error for
Style/MultilineIfModifier
when using nested modifier. (@koic) - #14077: Change
nil
representation in todo file comments. (@jonas054) - #14164: Fix an error for
Lint/UselessAssignment
when variables are assigned using unary operator in chained assignment and remain unreferenced. (@koic) - #14173: Fix an error for
Style/StringConcatenation
when using implicit concatenation with string interpolation. (@koic) - #14177: Fix false positives for
Style/SoleNestedConditional
when using nestedif
andnot
in condition. (@koic) - #14152: Fix
Layout/SpaceInsideArrayLiteralBrackets
cop error on array pattern without brackets. (@viralpraxis) - #14153: Fix
Style/PercentQLiterals
cop error on Unicode escape sequence. (@viralpraxis)
Changes
- #14082: Mark
Style/ComparableBetween
as unsafe. (@earlopain) - #14181: Make
Lint/DuplicateMethods
aware of Active Support'sdelegate
method. (@lovro-bikic) - #14156: Make
Style/IfUnlessModifier
allow endless method definition in theif
body. (@koic)