RuboCop 0.21.0
This release brings a few new cops and extended auto-correction support. The most significant
change is that we've changed the syntax for excluding/including to be closer to that of shell globbing.
Below is the list of all the gory details. Enjoy!
New features
- #835: New cop
UnneededCapitalW
checks for%W
when interpolation not necessary and%w
would do. (@sfeldon) - #934: New cop
UnderscorePrefixedVariableName
checks for_
-prefixed variables that are actually used. (@yujinakayama) - #934: New cop
UnusedMethodArgument
checks for unused method arguments. (@yujinakayama) - #934: New cop
UnusedBlockArgument
checks for unused block arguments. (@yujinakayama) - #964:
RedundantBegin
cop does auto-correction. (@tamird) - #966:
RescueException
cop does auto-correction. (@tamird) - #967:
TrivialAccessors
cop does auto-correction. (@tamird) - #963: Add
AllowDSLWriters
options toTrivialAccessors
. (@tamird) - #969: Let the
Debugger
cop check for forgotten calls to byebug. (@bquorning) - #971: Configuration format deprecation warnings include the path to the problematic config file. (@bcobb)
- #490: Add EnforcedStyle config option to TrailingBlankLines. (@jonas054)
- Add
auto_correct
task to Rake integration. (@irrationalfab) - #986: The
--only
option can take a comma-separated list of cops. (@jonas054) - New Rails cop
Delegate
that checks for delegations that could be replaced by thedelegate
method. (@geniou) - Add configuration to
Encoding
cop to only enforce encoding comment if there are non ASCII characters. (@geniou)
Changes
- Removed
FinalNewline
cop as its check is now performed byTrailingBlankLines
. (@jonas054) - #1011: Pattern matching with
Dir#[]
for config parameters added. (@jonas054)
Bugs fixed
- Update description on
LineEndConcatenation
cop. (@mockdeep) - #978: Fix regression in
IndentationWidth
handling method calls. (@tamird) - #976: Fix
EndAlignment
not handling element assignment correctly. (@tamird) - #976: Fix
IndentationWidth
not handling element assignment correctly. (@tamird) - #800: Do not report
[Corrected]
in--auto-correct
mode if correction wasn't done. (@jonas054) - #968: Fix bug when running Rubocop with
-c .rubocop.yml
. (@bquorning) - #975: Fix infinite correction in
IndentationWidth
. (@jonas054) - #986: When
--lint
is used together with--only
, all lint cops are run in addition to the given cops. (@jonas054) - #997: Fix handling of file paths for matching against
Exclude
property whenrubocop .
is called. (@jonas054) - #1000: Support modifier (e.g.,
private
) anddef
on the same line (Ruby >= 2.1) inIndentationWidth
. (@jonas054) - #1001: Fix
--auto-gen-config
logic forRegexpLiteral
. (@jonas054) - #993: Do not report any offenses for the contents of an empty file. (@jonas054)
- #1016: Fix a false positive in
ConditionPosition
regarding statement modifiers. (@bbatsov) - #1014: Fix handling of strings nested in
dstr
nodes. (@bbatsov)