New features
- Adjust behavior of
TrailingComma
cop to account for multi-line hashes nested within method calls. (@panthomakos) - #1719: Display an error and abort the program if input file can't be found. (@matugm)
- New cop
SpaceInsideStringInterpolation
checks for spaces within string interpolations. (@glasnt) - New cop
NestedMethodDefinition
checks for method definitions inside other methods. (@ojab) LiteralInInterpolation
cop does auto-correction. (@tmr08c)- #1865: New cop
Lint/UnneededDisable
checks forrubocop:disable
comments that can be removed. (@jonas054) EmptyElse
cop does auto-correction. (@lumeet)- Show reference links when displaying style guide links. (@rrosenblum)
Debugger
cop now checks for the Capybara debug methodsave_screenshot
. (@crazydog115)- #1282:
CaseIndentation
cop does auto-correction. (@lumeet) - #1928: Do auto-correction one offense at a time (rather than one cop at a time) if there are tabs in the code. (@jonas054)
Changes
- Prefer
SpaceInsideBlockBraces
toSpaceBeforeSemicolon
andSpaceAfterSemicolon
to avoid an infinite loop when auto-correcting. (@lumeet) - #1873: Move
ParallelAssignment
cop from Performance to Style. (@rrosenblum) - Add
getlocal
to acceptable methods ofRails/TimeZone
. (@ojab) - #1851, #1948: Change offense message for
ClassLength
andModuleLength
to match that ofMethodLength
. (@bquorning)
Bugs fixed
- Don't count required keyword args when specifying
CountKeywordArgs: false
forParameterLists
. (@sumeet) - #1879: Avoid auto-correcting hash with trailing comma into invalid code in
BracesAroundHashParameters
. (@jonas054) - #1868: Do not register an offense in
Performance/Count
whenselect
is called with symbols or strings as the parameters. (@rrosenblum) Sample
rewritten to properly handle shuffle randomness source, first/last params and non-literal ranges. (@chastell)- #1873: Modify
ParallelAssignment
to properly autocorrect when the assignment is protected by a modifier statement. (@rrosenblum) - Configure
ParallelAssignment
to work with non-standardIndentationWidths
. (@rrosenblum) - #1899: Be careful about comments when auto-correcting in
BracesAroundHashParameters
. (@jonas054) - #1897: Don't report that semicolon separated statements can be converted to modifier form in
IfUnlessModifier
(and don't auto-correct them). (@jonas054) - #1644: Don't search the entire file system when a folder is named
,
(fix for jruby and rbx). (@rrosenblum) - #1803: Don't warn for
return
fromlambda
block inNonLocalExitFromIterator
. (@ypresto) - #1905: Ignore sparse and trailing comments in
Style/Documentation
. (@RGBD) - #1923: Handle properly
for
without body inStyle/Next
. (@bbatsov) - #1901: Do not auto correct comments that are missing a note. (@rrosenblum)
- #1926: Fix crash in
Style/AlignHash
when correcting a hash with a splat in it. (@rrosenblum) - #1935: Allow
Symbol#to_proc
blocks in Performance/Size. (@m1foley)