Rubocop v0.50.0 Release Notes
Release Date: 2017-09-14 // over 6 years ago-
๐ New features
- ๐
#4464: Add
EnforcedStyleForEmptyBraces
parameter toLayout/SpaceBeforeBlockBraces
cop. ([@palkan][]) - ๐
#4453: New cop
Style/RedundantConditional
checks for conditionals that return true/false. ([@petehamilton][]) - #4448: Add new
TapFormatter
. ([@cyberdelia][]) - ๐
#4467: Add new
Style/HeredocDelimiters
cop(Note: This cop was renamed toNaming/HeredocDelimiterNaming
). ([@drenmi][]) - ๐ #4153: New cop
Lint/ReturnInVoidContext
checks for the use of a return with a value in a context where it will be ignored. ([@harold-s][]) - ๐ #4506: Add auto-correct support to
Lint/ScriptPermission
. ([@rrosenblum][]) - ๐
#4514: Add configuration options to
Style/YodaCondition
to support checking all comparison operators or equality operators only. ([@smakagon][]) - ๐ #4515: Add new
Lint/BooleanSymbol
cop. ([@droptheplot][]) - ๐
#4535: Make
Rails/PluralizationGrammar
use singular methods for-1
/-1.0
. ([@promisedlandt][]) - ๐
#4541: Add new
Rails/HasManyOrHasOneDependent
cop. ([@oboxodo][]) - ๐
#4552: Add new
Style/Dir
cop. ([@drenmi][]) - ๐
#4548: Add new
Style/HeredocDelimiterCase
cop(Note: This cop is renamed toNaming/HeredocDelimiterCase
). ([@drenmi][]) - ๐ #2943: Add new
Lint/RescueWithoutErrorClass
cop. ([@drenmi][]) - ๐
#4568: Fix auto-correction for
Style/TrailingUnderscoreVariable
. ([@smakagon][]) - ๐ #4586: Add new
Performance/UnfreezeString
cop. ([@pocke][]) - ๐
#2976: Add
Whitelist
configuration option toStyle/NestedParenthesizedCalls
cop. ([@drenmi][]) - ๐
#3965: Add new
Style/OrAssignment
cop. ([@donjar][]) - #4655: Make
rake new_cop
create parent directories if they do not already exist. ([@highb][]) - ๐ #4368: Make
Performance/HashEachMethod
inspect send nodes with any receiver. ([@gohdaniel15][]) - ๐
#4508: Add new
Style/ReturnNil
cop. ([@donjar][]) - #4629: Add Metrics/MethodLength cop for
define_method
. ([@jekuta][]) - ๐ #4702: Add new
Lint/UriEscapeUnescape
cop. ([@koic][]) - ๐ #4696: Add new
Performance/UriDefaultParser
cop. ([@koic][]) - ๐ #4694: Add new
Lint/UriRegexp
cop. ([@koic][]) - ๐
#4711: Add new
Style/MinMax
cop. ([@drenmi][]) - #4720: Add new
Bundler/InsecureProtocolSource
cop. ([@koic][]) - ๐ #4708: Add new
Lint/RedundantWithIndex
cop. ([@koic][]) - ๐ #4480: Add new
Lint/InterpolationCheck
cop. ([@GauthamGoli][]) - ๐ #4628: Add new
Lint/NestedPercentLiteral
cop. ([@asherkach][])
๐ Bug fixes
- #4709: Use cached remote config on network failure. ([@kristjan][])
- #4688: Accept yoda condition which isn't commutative. ([@fujimura][])
- ๐
#4676: Make
Style/RedundantConditional
cop work with elsif. ([@akhramov][]) - ๐
#4656: Modify
Style/ConditionalAssignment
auto-correction to work with unbracketed arrays. ([@akhramov][]) - #4615: Don't consider
<=>
a comparison method. ([@iGEL][]) - โ๏ธ #4664: Fix typos in Rails/HttpPositionalArguments. ([@JoeCohen][])
- ๐ #4618: Fix
Lint/FormatParameterMismatch
false positive if format string includes%%5B
(CGI encoded left bracket). ([@barthez][]) - ๐
#4604: Fix
Style/LambdaCall
to auto-correctobj.call
toobj.
. ([@iGEL][]) - ๐
#4443: Prevent
Style/YodaCondition
from breakingnot LITERAL
. ([@pocke][]) - ๐
#4434: Prevent bad auto-correct in
Style/Alias
for non-literal arguments. ([@drenmi][]) - ๐
#4451: Make
Style/AndOr
cop aware of comparison methods. ([@drenmi][]) - ๐ #4457: Fix false negative in
Lint/Void
with initialize and setter methods. ([@pocke][]) - ๐
#4418: Register an offense in
Style/ConditionalAssignment
when the assignment line is the longest line, and it does not exceed the max line length. ([@rrosenblum][]) - ๐
#4491: Prevent bad auto-correct in
Style/EmptyElse
for nestedif
. ([@pocke][]) - #4485: Handle 304 status for remote config files. ([@daniloisr][])
- ๐ #4529: Make
Lint/UnreachableCode
aware ofif
andcase
. ([@pocke][]) - #4469: Include permissions in file cache. ([@pocke][])
- ๐ #4270: Fix false positive in
Performance/RegexpMatch
for named captures. ([@pocke][]) - ๐ #4525: Fix regexp for checking comment config of
rubocop:disable all
inLint/UnneededDisable
. ([@meganemura][]) - ๐
#4555: Make
Style/VariableName
aware of optarg, kwarg and other arguments. ([@pocke][]) - ๐
#4481: Prevent
Style/WordArray
andStyle/SymbolArray
from registering offenses where percent arrays don't work. ([@drenmi][]) - #4447: Prevent
Layout/EmptyLineBetweenDefs
from removing too many lines. ([@drenmi][]) - ๐
#3892: Make
Style/NumericPredicate
ignore numeric comparison of global variables. ([@drenmi][]) - #4101: Skip auto-correct for literals with trailing comment and chained method call in
Layout/Multiline*BraceLayout
. ([@jonas054][]) - ๐
#4518: Fix bug where
Style/SafeNavigation
does not register an offense when there are chained method calls. ([@rrosenblum][]) - ๐
#3040: Ignore safe navigation in
Rails/Delegate
. ([@cgriego][]) - ๐ #4587: Fix false negative for void unary operators in
Lint/Void
cop. ([@pocke][]) - ๐ #4589: Fix false positive in
Performance/RegexpMatch
cop for=~
is in a class method. ([@pocke][]) - ๐ #4578: Fix false positive in
Lint/FormatParameterMismatch
for format with "asterisk" (*
) width and precision. ([@smakagon][]) - ๐ #4285: Make
Lint/DefEndAlignment
aware of multiple modifiers. ([@drenmi][]) - #4634: Handle heredoc that contains empty lines only in
Layout/IndentHeredoc
cop. ([@pocke][]) - ๐ #4646: Make
Lint/Debugger
aware ofKernel
and cbase. ([@pocke][]) - ๐
#4643: Modify
Style/InverseMethods
to not register a separate offense for an inverse method nested inside of the block of an inverse method offense. ([@rrosenblum][]) - โก๏ธ #4593: Fix false positive in
Rails/SaveBang
whensave/update_attribute
is used with acase
statement. ([@theRealNG][]) - ๐ #4322: Fix Style/MultilineMemoization from auto-correcting to invalid ruby. ([@dpostorivo][])
- #4722: Fix
rake new_cop
problem that doesn't addrequire
line. ([@koic][]) - #4723: Fix
RaiseArgs
auto-correction issue forraise
with 3 arguments. ([@smakagon][])
๐ Changes
- ๐ #4470: Improve the error message for
Lint/AssignmentInCondition
. ([@brandonweiss][]) - 0๏ธโฃ #4553: Add
node_modules
to default excludes. ([@iainbeeston][]) - ๐
#4445: Make
Style/Encoding
cop enabled by default. ([@deivid-rodriguez][]) - ๐
#4452: Add option to
Rails/Delegate
for enforcing the prefixed method name case. ([@klesse413][]) - ๐ #4493: Make
Lint/Void
cop aware ofEnumerable#each
andfor
. ([@pocke][]) - ๐ #4492: Make
Lint/DuplicateMethods
aware ofalias
andalias_method
. ([@pocke][]) - ๐ #4478: Fix confusing message of
Performance/Caller
cop. ([@pocke][]) - ๐ #4543: Make
Lint/DuplicateMethods
aware ofattr_*
methods. ([@pocke][]) - #4550: Mark
RuboCop::CLI#run
as a public API. ([@yujinakayama][]) - ๐ #4551: Make
Performance/Caller
aware ofcaller_locations
. ([@pocke][]) - ๐
#4547: Rename
Style/HeredocDelimiters
toStyle/HeredocDelimiterNaming
. ([@drenmi][]) - ๐
#4157: Enhance offense message for
Style/RedudantReturn
cop. ([@gohdaniel15][]) - ๐ #4521: Move naming related cops into their own
Naming
department. ([@drenmi][]) - ๐
#4600: Make
Style/RedundantSelf
aware of arguments of a block. ([@Envek][]) - ๐ #4658: Disable auto-correction for
Performance/TimesMap
by default. ([@Envek][])
- ๐
#4464: Add