RuboCop 0.22.0
This release brings a few new cops, extended auto-correction support and plenty of bug fixes.
Below is the list of all the gory details. Enjoy!
New features
- #974: New cop
CommentIndentation
checks indentation of comments. (@jonas054) - Add new cop
EachWithObject
to prefereach_with_object
overinject
orreduce
. (@geniou) - #1010: New Cop
Next
check for conditions at the end of an interation and propose to usenext
instead. (@geniou) - The
GuardClause
cop now also looks for unless and it is configurable how many lines the body of an if / unless needs to have to not be ignored. (@geniou) - #835: New cop
UnneededPercentX
checks for%x
when backquotes would do. (@jonas054) - Add auto-correct to
UnusedBlockArgument
andUnusedMethodArgument
cops. (@hannestyden) - #1074: New cop
SpaceBeforeComment
checks for missing space between code and a comment on the same line. (@jonas054) - #1089: New option
-F
/--fail-fast
inspects files in modification time order and stop after the first file with offenses. (@jonas054)
Changes
NonNilCheck
offense reporting and autocorrect are configurable to include semantic changes. (@hannestyden)- The parameters
AllCops/Excludes
andAllCops/Includes
with finals
only give a warning and don't haltrubocop
execution. (@jonas054) - The
GuardClause
cop is no longer irgnoring a one-line body by default - see configuration. (@geniou) - #1050: Rename
rubocop-todo.yml
file to.rubocop_todo.yml
. (@geniou) - #1064: Adjust default max line length to 80. (@bbatsov)
Bugs fixed
- Allow assignment in
AlignParameters
cop. (@tommeier) - Fix
Void
andSpaceAroundOperators
for short call syntaxlambda.()
. (@biinari) - Fix
Delegate
for delegation with assignment or constant. (@geniou) - #1032: Avoid duplicate reporting when code moves around due to
--auto-correct
. (@jonas054) - #1036: Handle strings like
__FILE__
inLineEndConcatenation
. (@bbatsov) - #1006: Fix LineEndConcatenation to handle chained concatenations. (@barunio)
- #1066: Fix auto-correct for
NegatedIf
when the condition has parentheses around it. (@jonas054) - Fix
AlignParameters
with_fixed_indentation
for multi-line method calls. (@molawson) - Fix problem that appears in some installations when reading empty YAML files. (@jonas054)
- #1022: A Cop will no longer auto-correct a file that's excluded through an
Exclude
setting in the cop's configuration. (@jonas054) - Fix paths in
Exclude
config section not being recognized on Windows. (@wndhydrnt) - #1094: Fix ClassAndModuleChildren for classes with a single method. (@geniou)