Rubocop v0.17.0 Release Notes
Release Date: 2014-01-25 // over 10 years ago-
๐ New features
- ๐ New cop
ConditionPosition
checks for misplaced conditions in expressions likeif/unless/when/until
. ([@bbatsov][]) - ๐ New cop
ElseLayout
checks for odd arrangement of code in theelse
branch of a conditional expression. ([@bbatsov][]) - ๐ #694: Support Ruby 1.9.2 until June 2014. ([@yujinakayama][])
- ๐ง #702: Improve
rubocop-todo.yml
with comments about offence count, configuration parameters, and auto-correction support. ([@jonas054][]) - โ Add new command-line flag
-D/--display-cop-names
to trigger the display of cop names in offence messages. ([@bbatsov][]) - #733:
NumericLiterals
cop does auto-correction. ([@dblock][]) - #713: New cop
TrailingComma
checks for comma after the last item in a hash, array, or method call parameter list. ([@jonas054][])
๐ Changes
- #581: Extracted a new cop
AmbiguousOperator
fromSyntax
cop. It checks for ambiguous operators in the first argument of a method invocation without parentheses. ([@yujinakayama][]) - Extracted a new cop
AmbiguousRegexpLiteral
fromSyntax
cop. It checks for ambiguous regexp literals in the first argument of a method invocation without parentheses. ([@yujinakayama][]) - Extracted a new cop
UselessElseWithoutRescue
fromSyntax
cop. It checks for uselesselse
inbegin..end
withoutrescue
. ([@yujinakayama][]) - Extracted a new cop
InvalidCharacterLiteral
fromSyntax
cop. It checks for invalid character literals with a non-escaped whitespace character (e.g.?
). ([@yujinakayama][]) - โ Removed
Syntax
cop from the configuration. It no longer can be disabled and it reports only invalid syntax offences. ([@yujinakayama][]) - ๐ง #688: Output from
rubocop --show-cops
now looks like a YAML configuration file. The--show-cops
option takes a comma separated list of cops as optional argument. ([@jonas054][]) - ๐ New cop
IndentationConsistency
extracted fromIndentationWidth
, which has checked two kinds of offences until now. ([@jonas054][])
๐ Bugs fixed
- ๐ #698: Support Windows paths on command-line. ([@rifraf][])
- #498: Disable terminal ANSI escape sequences when a formatter's output is not a TTY. ([@yujinakayama][])
- #703: BracesAroundHashParameters auto-correction broken with trailing comma. ([@jonas054][])
- ๐ง #709: When
EndAlignment
has configurationAlignWith: variable
, it now handles@@a = if ...
anda, b = if ...
. ([@jonas054][]) SpaceAroundOperators
now reports an offence for@@a=0
. ([@jonas054][])- #707: Fix error on operator assignments in top level scope in
UselessAssignment
. ([@yujinakayama][]) - ๐ Fix a bug where some offences were discarded when any cop that has specific target file path (by
Include
orExclude
under each cop configuration) had run. ([@yujinakayama][]) - ๐ #724: Accept colons denoting required keyword argument (a new feature in Ruby 2.1) without trailing space in
SpaceAfterColon
. ([@jonas054][]) - The
--no-color
option works again. ([@jonas054][]) - ๐ #716: Fixed a regression in the auto-correction logic of
MethodDefParentheses
. ([@bbatsov][]) - ๐ง Inspected projects that lack a
.rubocop.yml
file, and therefore get their configuration from RuboCop'sconfig/default.yml
, no longer get configuration from RuboCop's.rubocop.yml
andrubocop-todo.yml
. ([@jonas054][]) - ๐ #730:
EndAlignment
now handles for exampleprivate def some_method
, which is allowed in Ruby 2.1. It requiresend
to be aligned withprivate
, notdef
, in such cases. ([@jonas054][]) - #744: Any new offences created by
--auto-correct
are now handled immediately and corrected when possible, so running--auto-correct
once is enough. ([@jonas054][]) - #748: Auto-correction conflict between
EmptyLinesAroundBody
andTrailingWhitespace
resolved. ([@jonas054][]) ParenthesesAroundCondition
no longer crashes on parentheses around the condition in a ternary if. ([@jonas054][])- #738: Fix a false positive in
StringLiterals
. ([@bbatsov][])
- ๐ New cop