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 like if/unless/when/until. ([@bbatsov][])
    • ๐Ÿ†• New cop ElseLayout checks for odd arrangement of code in the else 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 from Syntax cop. It checks for ambiguous operators in the first argument of a method invocation without parentheses. ([@yujinakayama][])
    • Extracted a new cop AmbiguousRegexpLiteral from Syntax cop. It checks for ambiguous regexp literals in the first argument of a method invocation without parentheses. ([@yujinakayama][])
    • Extracted a new cop UselessElseWithoutRescue from Syntax cop. It checks for useless else in begin..end without rescue. ([@yujinakayama][])
    • Extracted a new cop InvalidCharacterLiteral from Syntax 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 from IndentationWidth, 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 configuration AlignWith: variable, it now handles @@a = if ... and a, 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 or Exclude 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's config/default.yml, no longer get configuration from RuboCop's .rubocop.yml and rubocop-todo.yml. ([@jonas054][])
    • ๐Ÿ’Ž #730: EndAlignment now handles for example private def some_method, which is allowed in Ruby 2.1. It requires end to be aligned with private, not def, 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 and TrailingWhitespace resolved. ([@jonas054][])
    • ParenthesesAroundCondition no longer crashes on parentheses around the condition in a ternary if. ([@jonas054][])
    • #738: Fix a false positive in StringLiterals. ([@bbatsov][])