Rubocop v0.52.0 Release Notes
Release Date: 2017-12-12 // over 6 years ago-
๐ New features
- ๐ #5101: Allow to specify
TargetRubyVersion
2.5. ([@walf443][]) - ๐ง #1575: Add new
Layout/ClassStructure
cop that checks whether definitions in a class are in the configured order. This cop is disabled by default. ([@jonatas][]) - ๐ New cop
Rails/InverseOf
checks for association arguments that require setting theinverse_of
option manually. ([@bdewater][]) - #4811: Add new
Layout/SpaceInsideReferenceBrackets
cop. ([@garettarrowood][]) - #4811: Add new
Layout/SpaceInsideArrayLiteralBrackets
cop. ([@garettarrowood][]) - ๐
#4252: Add new
Style/TrailingBodyOnMethodDefinition
cop. ([@garettarrowood][]) - โ Add new
Style/TrailingMethodEndStatment
cop. ([@garettarrowood][]) - #5074: Add Layout/EmptyLinesAroundArguments cop. ([@garettarrowood][])
- ๐
#4650: Add new
Style/StringHashKeys
cop. ([@donjar][]) - #1583: Add a quiet formatter. ([@drenmi][])
- โ Add new
Style/RandomWithOffset
cop. ([@donjar][]) - ๐ #4892: Add new
Lint/ShadowedArgument
cop and remove argument shadowing detection fromLint/UnusedBlockArgument
andLint/UnusedMethodArgument
. ([@akhramov][]) - ๐ #4674: Add a new
Lint/MissingCopEnableDirective
cop. ([@tdeo][]) - โ Add new
Rails/EnvironmentComparison
cop. ([@tdeo][]) - โ Add
AllowedChars
option toStyle/AsciiComments
cop. ([@hedgesky][]) - ๐
#5031: Add new
Style/EmptyBlockParameter
andStyle/EmptyLambdaParameter
cops. ([@pocke][]) - ๐ #5057: Add new
Gemspec/RequiredRubyVersion
cop. ([@koic][]) - #5087: Add new
Gemspec/RedundantAssignment
cop. ([@koic][]) - โ Add
unannotated
option toStyle/FormatStringToken
cop. ([@drenmi][]) - ๐
#5077: Add new
Rails/CreateTableWithTimestamps
cop. ([@wata727][]) - โ Add new
Style/ColonMethodDefinition
cop. ([@rrosenblum][]) - โ Add new
Style/ExtendSelf
cop. ([@drenmi][]) - ๐
#5185: Add new
Rails/RedundantReceiverInWithOptions
cop. ([@koic][]) - ๐
#5177: Add new
Rails/LexicallyScopedActionFilter
cop. ([@wata727][]) - ๐
#5173: Add new
Style/EvalWithLocation
cop. ([@pocke][]) - ๐
#5208: Add new
Rails/Presence
cop. ([@wata727][]) - ๐ Allow auto-correction of ClassAndModuleChildren. ([@siegfault][], [@melch][])
๐ Bug fixes
- #5096: Fix incorrect detection and auto-correction of multiple extend/include/prepend. ([@marcandre][])
- #5219: Fix incorrect empty line detection for block arguments in
Layout/EmptyLinesAroundArguments
. ([@garettarrowood][]) - #4662: Fix incorrect indent level detection when first line of heredoc is blank. ([@sambostock][])
- ๐
#5016: Fix a false positive for
Style/ConstantName
with constant names using non-ASCII capital letters with accents. ([@timrogers][]) - #4866: Prevent
Layout/BlockEndNewline
cop from introducing trailing whitespaces. ([@bgeuken][]) - #3396: Concise error when config. file not found. ([@jaredbeck][])
- ๐ #4881: Fix a false positive for
Performance/HashEachMethods
when unused argument(s) exists in other blocks. ([@pocke][]) - ๐ #4883: Fix auto-correction for
Performance/HashEachMethods
. ([@pocke][]) - ๐
#4896: Fix Style/DateTime wrongly triggered on classes
...::DateTime
. ([@dpostorivo][]) - ๐ #4938: Fix behavior of
Lint/UnneededDisable
, which was returning offenses even after being disabled in a comment. ([@tdeo][]) - ๐
#4887: Add undeclared configuration option
EnforcedStyleForEmptyBraces
forLayout/SpaceBeforeBlockBraces
cop. ([@drenmi][]) - #4987: Skip permission check when using stdin option. ([@mtsmfm][])
- ๐
#4909: Make
Rails/HasManyOrHasOneDependent
aware of multiple associations inwith_options
. ([@koic][]) - #4794: Fix an error in
Layout/MultilineOperationIndentation
when an operation spans multiple lines and contains a ternary expression. ([@rrosenblum][]) - ๐
#4885: Fix false offense detected by
Style/MixinUsage
cop. ([@koic][]) - ๐
#3363: Fix
Style/EmptyElse
auto-correction removes comments from branches. ([@dpostorivo][]) - #5025: Fix error with Layout/MultilineMethodCallIndentation cop and lambda.(...). ([@dpostorivo][])
- ๐
#4781: Prevent
Style/UnneededPercentQ
from breaking on strings that are concated with backslash. ([@pocke][]) - ๐
#4363: Fix
Style/PercentLiteralDelimiters
incorrectly automatically modifies escaped percent literal delimiter. ([@koic][]) - #5053: Fix
Naming/ConstantName
false offense on assigning to a nonoffensive assignment. ([@garettarrowood][]) - ๐
#5019: Fix auto-correct for
Style/HashSyntax
cop when hash is used as unspaced argument. ([@drenmi][]) - ๐
#5052: Improve accuracy of
Style/BracesAroundHashParameters
auto-correction. ([@garettarrowood][]) - ๐
#5059: Fix a false positive for
Style/MixinUsage
wheninclude
call is a method argument. ([@koic][]) - ๐ #5071: Fix a false positive in
Lint/UnneededSplatExpansion
, whenArray.new
resides in an array literal. ([@akhramov][]) - ๐ #4071: Prevent generating wrong code by Style/ColonMethodCall and Style/RedundantSelf. ([@pocke][])
- ๐
#5089: Fix false positive for
Style/SafeNavigation
when safe guarding arithmetic operation or assignment. ([@tiagotex][]) - ๐
#5099: Prevent
Style/MinMax
from breaking on implicit receivers. ([@drenmi][]) - ๐
#5079: Fix false positive for
Style/SafeNavigation
when safe guarding comparisons. ([@tiagotex][]) - ๐
#5075: Fix auto-correct for
Style/RedundantParentheses
cop when unspaced ternary is present. ([@tiagotex][]) - #5155: Fix a false negative for
Naming/ConstantName
cop when using frozen object assignment. ([@koic][]) - ๐ Fix a false positive in
Style/SafeNavigation
when the right hand side is negated. ([@rrosenblum][]) - #5128: Fix
Bundler/OrderedGems
when gems are references from variables (ignores them in the sorting). ([@tdeo][])
๐ Changes
- #4848: Exclude lambdas and procs from
Metrics/ParameterLists
. ([@reitermarkus][]) - #5120: Improve speed of RuboCop::PathUtil#smart_path. ([@walf443][])
- ๐
#4888: Improve offense message of
Style/StderrPuts
. ([@jaredbeck][]) - ๐ #4886: Fix false offense for Style/CommentedKeyword. ([@michniewicz][])
- ๐ #4977: Make
Lint/RedundantWithIndex
cop aware of offset argument. ([@koic][]) - #2679: Handle dependencies to
Metrics/LineLength: Max
when generating.rubocop_todo.yml
. ([@jonas054][]) - #4943: Make cop generator compliant with the repo's rubocop config. ([@tdeo][])
- ๐
#5011: Remove
SupportedStyles
from "Configuration parameters" in.rubocop_todo.yml
. ([@pocke][]) - ๐
Lint/RescueWithoutErrorClass
has been replaced byStyle/RescueStandardError
. ([@rrosenblum][]) - ๐ง #4811: Remove
Layout/SpaceInsideBrackets
in favor of two new configurable cops. ([@garettarrowood][]) - #5042: Make offense locations of metrics cops to contain whole a method. ([@pocke][])
- #5044: Add last_line and last_column into outputs of the JSON formatter. ([@pocke][])
- #4633: Make metrics cops aware of
define_method
. ([@pocke][]) - 0๏ธโฃ #5037: Make display cop names to enable by default. ([@pocke][])
- #4449: Make
Layout/IndentHeredoc
aware of line length. ([@pocke][]) - 0๏ธโฃ #5146: Make
--show-cops
option aware of--force-default-config
. ([@pocke][]) - ๐ #3001: Add configuration to
Lint/MissingCopEnableDirective
cop. ([@tdeo][]) - ๐ #4932: Do not fail if configuration contains
Lint/Syntax
cop with the same settings as the default. ([@tdeo][]) - ๐ #5175: Make Style/RedundantBegin aware of do-end block in Ruby 2.5. ([@pocke][])
- ๐ #5101: Allow to specify