New features
- #6393: Add
AllowBracesOnProceduralOneLiners
option to fine-tuneStyle/BlockDelimiter
's semantic mode. (@davearonson) - #6383: Add
AllowBeforeTrailingComments
option onLayout/ExtraSpacing
cop. (@davearonson) - New cop
Lint/SafeNavigationWithEmpty
checks forfoo&.empty?
in conditionals. (@rspeicher) - Add new
Style/ConstantVisibility
cop for enforcing visibility declarations of class and module constants. (@drenmi) - #6378: Add
Lint/ToJSON
cop to enforce an argument when overriding#to_json
. (@allcentury) - #6346: Add auto-correction to
Rails/TimeZone
. (@dcluna) - #6840: Node patterns now allow unlimited elements after
...
. (@marcandre)
Bug fixes
- #4321: Fix false offense for
Style/RedundantSelf
when the method is also defined onKernel
. (@mikegee) - #6821: Fix false negative for
Rails/LinkToBlank
when_blank
is a symbol. (@Intrepidd) - #6699: Fix infinite loop for
Layout/IndentationWidth
andLayout/IndentationConsistency
when bad modifier indentation before good method definition. (@koic) - #6777: Fix a false positive for
Style/TrivialAccessors
when using trivial reader/writer methods at the top level. (@koic) - #6799: Fix errors for
Style/ConditionalAssignment
,Style/IdenticalConditionalBranches
,Lint/ElseLayout
, andLayout/IndentationWidth
with empty braces. (@pocke) - #6802: Fix auto-correction for
Style/SymbolArray
with array contains interpolation whenEnforcedStyle
isbrackets
. (@pocke) - #6797: Fix false negative for Layout/SpaceAroundBlockParameters on block parameter with parens. (@pocke)
- #6798: Fix infinite loop for
Layout/SpaceAroundBlockParameters
withEnforcedStyleInsidePipes: :space
. (@pocke) - #6803: Fix error for
Style/NumericLiterals
on a literal that contains spaces. (@pocke) - #6801: Fix auto-correction for
Style/Lambda
with no-space argument. (@pocke) - #6804: Fix auto-correction of
Style/NumericLiterals
on numeric literal with exponent. (@pocke) - #6800: Fix an incorrect auto-correct for
Rails/Validation
when method arguments are enclosed in parentheses. (@koic) - #6808: Prevent false positive in
Naming/ConstantName
when assigning a frozen range. (@drenmi) - Fix the calculation of
Metrics/AbcSize
. Comparison methods andelse
branches add to the comparison count. (@rrosenblum) - #6791: Allow
Rails/ReflectionClassName
to use symbol argument forclass_name
. (@unasuke) - #5465: Fix
Layout/ClassStructure
to allow grouping macros by their visibility. (@gprado) - #6461: Restrict
Ctrl-C
handling to RuboCop's loop and simplify it to a single phase. (@deivid-rodriguez)
Changes
- Add
$stdout
/$stderr
andSTDOUT
/STDERR
method calls toRails/Output
. (@elebow) - #6688: Add
iterator?
to deprecated methods and preferblock_given?
instead. (@tejasbubane) - #6806: Remove
powerpack
dependency. (@dduugg) - #6810: Exclude gemspec file by default for
Metrics/BlockLength
cop. (@koic) - #6813: Allow unicode/display_width dependency version 1.5.0. (@tagliala)
- Make
Style/RedundantFreeze
aware of methods that will produce frozen objects. (@rrosenblum) - #6675: Avoid printing deprecation warnings about constants. (@elmasantos)
- #6746: Avoid offense on
$stderr.puts
with no arguments. (@luciamo) - Replace md5 with sha1 for FIPS compliance. (@dirtyharrycallahan)