New features
- #6109: Add new
Bundler/GemComment
cop. (@sunny) - #6148: Add
IgnoredMethods
option toStyle/NumericPredicate
cop. (@AlexWayfer) - #6174: Add
--display-only-fail-level-offenses
to only output offenses at or above the fail level. (@robotdana) - Add autocorrect to
Style/For
. (@rrosenblum) - #6173: Add
AllowImplicitReturn
option toRails/SaveBang
cop. (@robotdana) - #6218: Add
comparison
style toStyle/NilComparison
. (@khiav223577) - Add new
Style/MultilineMethodSignature
cop. (@drenmi) - #6234: Add
Performance/ChainArrayAllocation
cop. (@schneems) - #6136: Add remote url in remote url download error message. (@ShockwaveNN)
- #5659: Make
Layout/EmptyLinesAroundClassBody
aware of specifying a superclass that breaks the line. (@koic)
Bug fixes
- #6107: Fix indentation of multiline postfix conditionals. (@jaredbeck)
- #6140: Fix
Style/DateTime
not detecting#to_datetime
. It can be configured to allow this. (@bdewater) - #6132: Fix a false negative for
Naming/FileName
whenInclude
ofAllCops
is the default setting. (@koic) - #4115: Fix false positive for unary operations in
Layout/MultilineOperationIndentation
. (@jonas054) - #6127: Fix an error for
Layout/ClosingParenthesisIndentation
when method arguments are empty with newlines. (@tatsuyafw) - #6152: Fix a false negative for
Layout/AccessModifierIndentation
when using access modifiers with arguments within nested classes. (@gmalette) - #6124: Fix
Style/IfUnlessModifier
cop for disabledLayout/Tab
cop when there is noIndentationWidth
config. (@AlexWayfer) - #6133: Fix
AllowURI
option ofMetrics/LineLength
cop for files with tabs indentation. (@AlexWayfer) - #6164: Fix incorrect autocorrect for
Style/UnneededCondition
when using operator method higher precedence than||
. (@koic) - #6138: Fix a false positive for assigning a block local variable in
Lint/ShadowedArgument
. (@jonas054) - #6022: Fix
Layout/MultilineHashBraceLayout
andLayout/MultilineArrayBraceLayout
auto-correct syntax error when there is a comment on the last element. (@bacchir) - #6175: Fix
Style/BracesAroundHashParameters
auto-correct syntax error when there is a trailing comma. (@bacchir) - #6192: Make
Style/RedundantBegin
aware of stabby lambdas. (@drenmi) - #6208: Ignore assignment methods in
Naming/PredicateName
. (@sunny) - #6196: Fix incorrect autocorrect for
Style/EmptyCaseCondition
when usingreturn
inwhen
clause and assigning the return value ofcase
. (@koic) - #6142: Ignore keyword arguments in
Rails/Delegate
. (@sunny) - #6240: Fix an auto-correct error for
Style/WordArray
when settingEnforcedStyle: brackets
and using string interpolation in%W
literal. (@koic) - #6202: Fix infinite loop when auto-correcting
Lint/RescueEnsureAlignment
whenend
is misaligned. The alignment and message are now based on the beginning position rather than theend
position. (@rrosenblum) - #6199: Don't recommend
Date
usage inStyle/DateTime
. (@deivid-rodriguez)
Changes
- #6161: Add scope methods to
Rails/FindEach
cop. Makes the cop also check for the following scopes:eager_load
,includes
,joins
,left_joins
,left_outer_joins
,preload
,references
, andunscoped
. (@repinel) - #6137: Allow
db
to allowed names ofNaming/UncommunicativeMethodParamName
cop in default config. (@mkenyon) - Update the highlighting of
Lint/DuplicateMethods
to include the method name. (@rrosenblum) - #6057: Return 0 when running
rubocop --auto-gen-conf
if the todo file is successfully created even if there are offenses. (@MagedMilad) - #4301: Turn off autocorrect for
Rails/RelativeDateConstant
by default. (@koic) - #4832: Change the path pattern (
*
) to match the hidden file. (@koic) Style/For
now highlights the entire statement rather than just the keyword. (@rrosenblum)- Disable
Performance/CaseWhenSplat
and its auto-correction by default. (@rrosenblum) - #6235: Enable
Layout/EmptyLineAfterGuardClause
cop by default. (@koic) - #6199:
Style/DateTime
has been moved to disabled by default. (@deivid-rodriguez)