New features
- #2956: Prefer
.ruby-version
toTargetRubyVersion
. (@pclalv) - #3095: Add
IndentationWidth
configuration parameter forStyle/AlignParameters
cop. (@alexdowad) - #3066: Add new
Style/ImplicitRuntimeError
cop which advises the use of an explicit exception class when raising an error. (@alexdowad) - #3018: Add new
Style/EachForSimpleLoop
cop which advises the use ofInteger#times
for simple loops which iterate a fixed number of times. (@alexdowad) - #2595: New
compact
style forStyle/SpaceInsideLiteralHashBraces
. (@alexdowad) - #2927: Add autocorrect for
Rails/Validation
cop. (@neodelf) - #3135: Add new
Rails/OutputSafety
cop. (@josh) - #3164: Add Fastlane's Fastfile to the default Includes. (@jules2689)
- #3173: Make
Style/ModuleFunction
configurable withmodule_function
andextend_self
styles. (@tjwp) - #3105: Add new
Rails/RequestReferer
cop. (@giannileggio) - #3200: Add autocorrect for
Style/EachForSimpleLoop
cop. (@tejasbubane) - #3058: Add new
Style/SpaceInsideArrayPercentLiteral
cop. (@owst) - #3058: Add new
Style/SpaceInsidePercentLiteralDelimiters
cop. (@owst) - #3179: Expose files to support testings Cops using RSpec. (@tjwp)
- #3191: Allow arbitrary comments after cop names in CommentConfig lines (e.g. rubocop:enable). (@owst)
- #3165: Add new
Lint/PercentStringArray
cop. (@owst) - #3165: Add new
Lint/PercentSymbolArray
cop. (@owst) - #3177: Add new
Style/NumericLiteralPrefix
cop. (@tejasbubane) - #1646: Add configuration style
indented_relative_to_receiver
forStyle/MultilineMethodCallIndentation
. (@jonas054) - New cop
Lint/ShadowedException
checks for the order which exceptions are rescued to avoid rescueing a less specific exception before a more specific exception. (@rrosenblum) - #3127: New cop
Lint/InheritException
checks for error classes inheriting fromException
, and instead suggestsRuntimeError
orStandardError
. (@drenmi) - Add new
Performance/PushSplat
cop. (@segiddins) - #3089: Add new
Rails/Exit
cop. (@sgringwe)
Bug fixes
- #3005: Symlink protection prevents use of caching in CI context. (@urbanautomaton)
- #3037:
Style/StringLiterals
understands that a bare '#', not '#@variable' or '#{interpolation}', does not require double quotes. (@alexdowad) - #2722:
Style/ExtraSpacing
does not attempt to align an equals sign in an argument list with one in an assignment statement. (@alexdowad) - #3133:
Style/MultilineMethodCallBraceLayout
does not register offenses for single-line calls. (@alexdowad) - #3170:
Style/MutableConstant
does not infinite-loop when correcting an array with no brackets. (@alexdowad) - #3150: Fix auto-correct for Style/MultilineArrayBraceLayout. (@jspanjers)
- #3192: Fix
Lint/UnusedBlockArgument
'sIgnoreEmptyBlocks
parameter from being removed from configuration. (@jfelchner) - #3114: Fix alignment
end
when auto-correctingStyle/EmptyElse
. (@rrosenblum) - #3120: Fix
Lint/UselessAccessModifier
reporting useless access modifiers inside {Class,Module,Struct}.new blocks. (@owst) - #3125: Fix
Rails/UniqBeforePluck
to ignoreuniq
with block. (@tejasbubane) - #3116:
Style/SpaceAroundKeyword
allows&.
method calls aftersuper
andyield
. (@segiddins) - #3131: Fix
Style/ZeroLengthPredicate
to ignoresize
andlength
variables. (@tejasbubane) - #3146: Fix
NegatedIf
andNegatedWhile
to ignore double negations. (@natalzia-paperless) - #3140:
Style/FrozenStringLiteralComment
works with file doesn't have any tokens. (@pocke) - #3154: Fix handling of
()
inStyle/RedundantParentheses
. (@lumeet) - #3155: Fix
Style/SpaceAfterNot
reporting on thenot
keyword. (@NobodysNightmare) - #3160:
Style/Lambda
fix whitespacing when auto-correcting unparenthesized arguments. (@palkan) - #2944: Don't crash on strings that span multiple lines but only have one pair of delimiters in
Style/StringLiterals
. (@jonas054) - #3157: Don't let
LineEndConcatenation
andUnneededInterpolation
make changes to the same string during auto-correct. (@jonas054) - #3187: Let
Style/BlockDelimiters
ignore blocks in all method arguments. (@jonas054) - Modify
Style/ParallelAssignment
to use implicit begins when parallel assignment uses arescue
modifier and is the only thing in the method. (@rrosenblum) - #3217: Fix output of ellipses for multi-line offense ranges in HTML formatter. (@jonas054)
- #3207: Auto-correct modifier
while
/until
andbegin
..end
+while
/until
inStyle/InfiniteLoop
. (@jonas054) - #3202: Fix
Style/EmptyElse
registering wrong offenses and thus making RuboCop crash. (@deivid-rodriguez) - #3183: Ensure
Style/SpaceInsideBlockBraces
reports offenses for multi-line blocks. (@owst) - #3017: Fix
Style/StringLiterals
to register offenses on non-ascii strings. (@deivid-rodriguez) - #3056: Fix
Style/StringLiterals
to register offenses on non-ascii strings. (@deivid-rodriguez) - #2986: Fix
RedundantBlockCall
to not report calls that pass block arguments, or where the block has been overridden. (@owst) - #3223: Return can take many arguments. (@ptarjan)
- #3239: Fix bug with --auto-gen-config and a file that does not exist. (@meganemura)
- #3138: Fix RuboCop crashing when config file contains utf-8 characters and external encoding is not utf-8. (@deivid-rodriguez)
- #3175: Generate 'Exclude' list for the cops with configurable enforced style to
.rubocop_todo.yml
if different styles are used. (@flexoid) - #3231: Make
Rails/UniqBeforePluck
more conservative. (@tjwp)
Changes
- #3149: Make
Style/HashSyntax
configurable to not report hash rocket syntax for symbols ending with ? or ! when using ruby19 style. (@owst) - #1758: Let
Style/ClosingParenthesisIndentation
followStyle/AlignParameters
configuration for method calls. (@jonas054) - #3224: Rename
Style/DeprecatedHashMethods
toStyle/PreferredHashMethods
. (@tejasbubane)