This release is mostly about fixing bugs, but it also features a few new cops.
Below is the list of all the gory details. Enjoy!
New features
- #639: Support square bracket setters in
UselessSetterCall
. (@yujinakayama) - #835:
UnneededCapitalW
cop does auto-correction. (@sfeldon) - #1092: New cop
DefEndAlignment
takes over responsibility for checkng alignment of method definitionend
s fromEndAlignment
, and is configurable. (@jonas054) - #1145: New cop
ClassCheck
enforces consistent use ofis_a?
orkind_of?
. (@bbatsov) - #1161: New cop
SpaceBeforeComma
detects spaces before a comma. (@agrimm) - #1161: New cop
SpaceBeforeSemicolon
detects spaces before a semicolon. (@agrimm) - #835: New cop
UnneededPercentQ
checks for usage of the%q
/%Q
syntax when''
or""
would do. (@jonas054) - #977: Add
AllowURI
option (enabled by default) toLineLength
cop. (@yujinakayama)
Changes
- Unused block local variables (
obj.each { |arg; this| }
) are now handled byUnusedBlockArgument
cop instead ofUselessAssignment
cop. (@yujinakayama) - #1141: Clarify in the message from
TrailingComma
that a trailing comma is never allowed for lists where some items share a line. (@jonas054)
Bugs fixed
- #1133: Handle
reduce/inject
with no arguments inEachWithObject
. (@bbatsov) - #1152: Handle
while/until
with no body inNext
. (@tamird) - Fix a false positive in
UselessSetterCall
for setter call on a local variable that contains a non-local object. (@yujinakayama) - #1158: Fix auto-correction of floating-point numbers. (@bbatsov)
- #1159: Fix checking of
begin
..end
structures, blocks, and parenthesized expressions inIndentationWidth
. (@jonas054) - #1159: More rigid conditions for when
attr
is considered an offense. (@jonas054) - #1167: Fix handling of parameters spanning multiple lines in
TrailingComma
. (@jonas054) - #1169: Fix handling of ternary op conditions in
ParenthesesAroundCondition
. (@bbatsov) - #1147: WordArray checks arrays with special characters. (@camilleldn)
- Fix a false positive against
return
in a loop inNext
cop. (@yujinakayama) - #1165: Support
rescue
/else
/ensure
bodies inIndentationWidth
. (@jonas054) - Fix false positive for aligned list of values after
when
inIndentationWidth
. (@jonas054)