Rubocop v0.48.0 Release Notes
Release Date: 2017-03-26 // about 7 years ago-
๐ New features
- ๐ง #4107: New
TargetRailsVersion
configuration parameter can be used to specify which version of Rails the inspected code is intended to run on. ([@maxbeizer][]) - ๐
#4104: Add
prefix
andpostfix
styles toStyle/NegatedIf
. ([@brandonweiss][]) - ๐
#4083: Add new configuration
NumberOfEmptyLines
forStyle/EmptyLineBetweenDefs
. ([@dorian][]) - ๐
#4045: Add new configuration
Strict
forStyle/NumericLiteral
to make the change to this cop in 0.47.0 configurable. ([@iGEL][]) - 0๏ธโฃ #4005: Add new
AllCops/EnabledByDefault
option. ([@betesh][]) - #3893: Add a new configuration,
IncludeActiveSupportAliases
, toPerformance/DoublStartEndWith
. This configuration will check for ActiveSupport'sstarts_with?
andends_with?
. ([@rrosenblum][]) - ๐
#3889: Add new
Style/EmptyLineAfterMagicComment
cop. ([@backus][]) - ๐
#3800: Make
Style/EndOfLine
configurable withlf
,crlf
, andnative
(default) styles. ([@jonas054][]) - ๐
#3936: Add new
Style/MixinGrouping
cop. ([@drenmi][]) - ๐
#4003: Add new
Rails/RelativeDateConstant
cop. ([@sinsoku][]) - ๐
#3984: Add new
Style/EmptyLinesAroundBeginBody
cop. ([@pocke][]) - ๐
#3995: Add new
Style/EmptyLinesAroundExceptionHandlingKeywords
cop. ([@pocke][]) - ๐
#4019: Make configurable
Style/MultilineMemoization
cop. ([@pocke][]) - ๐ #4018: Add auto-correct
Lint/EmptyEnsure
cop. ([@pocke][]) - ๐
#4028: Add new
Style/IndentHeredoc
cop. ([@pocke][]) - ๐ #3931: Add new
Lint/AmbiguousBlockAssociation
cop. ([@smakagon][]) - โ Add new
Style/InverseMethods
cop. ([@rrosenblum][]) - ๐
#4038: Allow
default
key in theStyle/PercentLiteralDelimiters
cop config to set all preferred delimiters. ([@kddeisz][]) - โ Add
IgnoreMacros
option toStyle/MethodCallWithArgsParentheses
. ([@drenmi][]) - ๐
#3937: Add new
Rails/ActiveSupportAliases
cop. ([@tdeo][]) - โ Add new
Rails/Blank
cop. ([@rrosenblum][]) - โ Add new
Rails/Present
cop. ([@rrosenblum][]) - #4004: Allow not treating comment lines as group separators in
Bundler/OrderedGems
cop. ([@konto-andrzeja][])
๐ Changes
- โก๏ธ #4100: Rails/SaveBang should flag
update_attributes
. ([@andriymosin][]) - ๐
#4083:
Style/EmptyLineBetweenDefs
doesn't allow more than one empty line between method definitions by default (seeNumberOfEmptyLines
). ([@dorian][]) - 0๏ธโฃ #3997: Include all ruby files by default and exclude non-ruby files. ([@dorian][])
- #4012: Mark
foo[:bar]
as not complex inStyle/TernaryParentheses
cop withrequire_parentheses_when_complex
style. ([@onk][]) - ๐ #3915: Make configurable whitelist for
Lint/SafeNavigationChain
cop. ([@pocke][]) - ๐
#3944: Allow keyword arguments in
Style/RaiseArgs
cop. ([@mikegee][]) - โ Add auto-correct to
Performance/DoubleStartEndWith
. ([@rrosenblum][]) - ๐
#3951: Make
Rails/Date
cop to register an offence for a string without timezone. ([@sinsoku][]) - ๐ #4020: Fixed
new_cop.rake
suggested path. ([@dabroz][]) - #4055: Add parameters count to offense message for
Metrics/ParameterLists
cop. ([@pocke][]) - ๐ #4081: Allow
Marshal.load
if argument is aMarshal.dump
inSecurity/MarshalLoad
cop. ([@droptheplot][]) - ๐
#4124: Make
Style/SymbolArray
cop to enable by default. ([@pocke][]) - #3331: Change
Style/MultilineMethodCallIndentation
indented_relative_to_receiver
to indent relative to the receiver and not relative to the caller. ([@jfelchner][]) - #4137: Allow lines to be exempted from
IndentationWidth
by regex. ([@jfelchner][])
๐ Bug fixes
- ๐
#4007: Skip
Rails/SkipsModelValidations
for methods that don't accept arguments. ([@dorian][]) - #3923: Allow asciibetical sorting in
Bundler/OrderedGems
. ([@mikegee][]) - ๐ #3855: Make
Lint/NonLocalExitFromIterator
aware of method definitions. ([@drenmi][]) - #2643: Allow uppercase and dashes in
MagicComment
. ([@mikegee][]) - ๐
#3959: Don't wrap "percent arrays" with extra brackets when auto-correcting
Style/MutableConstant
. ([@mikegee][]) - ๐ #3978: Fix false positive in
Performance/RegexpMatch
withEnglish
module. ([@pocke][]) - #3242: Ignore
Errno::ENOENT
during cache cleanup fromFile.mtime
too. ([@mikegee][]) - ๐
#3958:
Style/SpaceInsideHashLiteralBraces
doesn't add and offence when checking an hash where a value is a left brace string (e.g. { k: '{' }). ([@nodo][]) - ๐
#4006: Prevent
Style/WhileUntilModifier
from breaking on a multiline modifier. ([@drenmi][]) - ๐
#3345: Allow
Style/WordArray
'sWordRegex
configuration value to be an instance ofString
. ([@mikegee][]) - #4013: Follow redirects for RemoteConfig. ([@buenaventure][])
- ๐ #3917: Rails/FilePath Match nodes in a method call only once. ([@unmanbearpig][])
- ๐
#3673: Fix regression on
Style/RedundantSelf
when assigning to same local variable. ([@bankair][]) - #4047: Allow
find_zone
andfind_zone!
methods inRails/TimeZone
. ([@attilahorvath][]) - โ #3457: Clear a warning and prevent new warnings. ([@mikegee][])
- ๐ #4066: Register an offense in
Lint/ShadowedException
when an exception is shadowed and there is an implicit begin. ([@rrosenblum][]) - ๐ #4001: Lint/UnneededDisable of Metrics/LineLength that isn't unneeded. ([@wkurniawan07][])
- ๐ง #3960: Let
Include
/Exclude
paths in all files beginning with.rubocop
be relative to the configuration file's directory and not to the current directory. ([@jonas054][]) - ๐ #4049: Bugfix for
Style/EmptyLiteral
cop. ([@ota42y][]) - ๐
#4112: Fix false positives about double quotes in
Style/StringLiterals
,Style/UnneededCapitalW
andStyle/UnneededPercentQ
cops. ([@pocke][]) - ๐
#4109: Fix incorrect auto correction in
Style/SelfAssignment
cop. ([@pocke][]) - ๐
#4110: Fix incorrect auto correction in
Style/BracesAroundHashParameters
cop. ([@musialik][]) - ๐
#4084: Fix incorrect auto correction in
Style/TernaryParentheses
cop. ([@musialik][]) - ๐ #4102: Fix
Security/JSONLoad
,Security/MarshalLoad
andSecurity/YAMLLoad
cops patterns not matching ::Const. ([@musialik][]) - #3580: Handle combinations of
# rubocop:disable all
and# rubocop:disable SomeCop
. ([@jonas054][]) - ๐
#4124: Fix auto correction bugs in
Style/SymbolArray
cop. ([@pocke][]) - ๐
#4128: Prevent
Style/CaseIndentation
cop from registering offenses on single-line case statements. ([@drenmi][]) - ๐
#4143: Prevent
Style/IdenticalConditionalBranches
from registering offenses when a case statement has an empty when. ([@dpostorivo][]) - #4160: Fix a regression where
UselessAssignment
cop may not properly detect useless assignments when there's only a single conditional expression in the top level scope. ([@yujinakayama][]) - #4162: Fix a false negative in
UselessAssignment
cop with nested conditionals. ([@yujinakayama][])
- ๐ง #4107: New