Rubocop v0.47.0 Release Notes

Release Date: 2017-01-16 // over 7 years ago
  • ๐Ÿ†• New features

    • ๐Ÿš… #3822: Add Rails/FilePath cop. ([@iguchi1124][])
    • ๐Ÿ”’ #3821: Add Security/YAMLLoad cop. ([@cyberdelia][])
    • ๐Ÿ”’ #3816: Add Security/MarshalLoad cop. ([@cyberdelia][])
    • #3757: Add Auto-Correct for Bundler/OrderedGems cop. ([@pocke][])
    • Style/FrozenStringLiteralComment now supports the style never that will remove the frozen_string_literal comment. ([@rrosenblum][])
    • ๐Ÿ‘• #3795: Add Lint/MultipleCompare cop. ([@pocke][])
    • #3772: Allow exclusion of certain methods for Metrics/BlockLength. ([@NobodysNightmare][])
    • ๐Ÿ‘• #3804: Add new Lint/SafeNavigationChain cop. ([@pocke][])
    • #3670: Add CountBlocks boolean option to Metrics/BlockNesting. It allows blocks to be counted towards the nesting limit. ([@georgyangelov][])
    • ๐Ÿ’… #2992: Add a configuration to Style/ConditionalAssignment to toggle offenses for ternary expressions. ([@rrosenblum][])
    • ๐ŸŽ #3824: Add new Performance/RegexpMatch cop. ([@pocke][])
    • ๐Ÿš… #3825: Add new Rails/SkipsModelValidations cop. ([@rahulcs][])
    • ๐Ÿ’… #3737: Add new Style/MethodCallWithArgsParentheses cop. ([@dominh][])
    • ๐Ÿ“‡ Renamed MethodCallParentheses to MethodCallWithoutArgsParentheses. ([@dominh][])
    • ๐Ÿš… #3854: Add new Rails/ReversibleMigration cop. ([@sue445][])
    • #3872: Detect String#% with hash literal. ([@backus][])
    • ๐Ÿ‘• #2731: Allow configuration of method calls that create methods for Lint/UselessAccessModifier. ([@pat][])

    ๐Ÿ”„ Changes

    • ๐Ÿ”’ #3820: Rename Lint/Eval to Security/Eval. ([@cyberdelia][])
    • ๐Ÿ’… #3725: Disable Style/SingleLineBlockParams by default. ([@tejasbubane][])
    • ๐Ÿ’… #3765: Add a validation for supported styles other than EnforcedStyle. AlignWith, IndentWhenRelativeTo and EnforcedMode configurations are renamed. ([@pocke][])
    • ๐Ÿš… #3782: Add check for add_reference method by Rails/NotNullColumn cop. ([@pocke][])
    • ๐Ÿ’… #3761: Update Style/RedundantFreeze message from Freezing immutable objects is pointless. to Do not freeze immutable objects, as freezing them has no effect.. ([@lucasuyezu][])
    • #3753: Change error message of Bundler/OrderedGems to mention Alphabetize Gems. ([@tejasbubane][])
    • #3802: Ignore case when checking Gemfile order. ([@breckenedge][])
    • โž• Add missing examples in Lint cops documentation. ([@enriikke][])
    • ๐Ÿ’… Make Style/EmptyMethod cop aware of class methods. ([@drenmi][])
    • ๐Ÿ‘• #3871: Add check for void defined? and self by Lint/Void cop. ([@pocke][])
    • ๐Ÿ‘ Allow ignoring methods in Style/BlockDelimiters when using any style. ([@twe4ked][])

    ๐Ÿ› Bug fixes

    • ๐Ÿš… #3751: Avoid crash in Rails/EnumUniqueness cop. ([@pocke][])
    • ๐Ÿ’… #3766: Avoid crash in Style/ConditionalAssignment cop with masgn. ([@pocke][])
    • ๐Ÿ’… #3770: Style/RedundantParentheses Don't flag raised to a power negative numeric literals, since removing the parentheses would change the meaning of the expressions. ([@amogil][])
    • ๐Ÿ’… #3750: Register an offense in Style/ConditionalAssignment when the assignment spans multiple lines. ([@rrosenblum][])
    • ๐Ÿ’… #3775: Avoid crash in Style/HashSyntax cop with an empty hash. ([@pocke][])
    • ๐Ÿš… #3783: Maintain parentheses in Rails/HttpPositionalArguments when methods are defined with them. ([@kevindew][])
    • ๐Ÿ’… #3786: Avoid crash Style/ConditionalAssignment cop with mass assign method. ([@pocke][])
    • ๐Ÿ’… #3749: Detect corner case of Style/NumericLitterals. ([@kamaradclimber][])
    • ๐Ÿ’… #3788: Prevent bad auto-correct in Style/Next when block has nested conditionals. ([@drenmi][])
    • ๐Ÿ“š #3807: Prevent Style/Documentation and Style/DocumentationMethod from mistaking RuboCop directives for class documentation. ([@drenmi][])
    • ๐Ÿ’… #3815: Fix false positive in Style/IdenticalConditionalBranches cop when branches have same line at leading. ([@pocke][])
    • ๐Ÿ›  Fix false negative in Rails/HttpPositionalArguments where offense would go undetected if one of the request parameter names matched one of the special keyword arguments. ([@deivid-rodriguez][])
    • ๐Ÿ›  Fix false negative in Rails/HttpPositionalArguments where offense would go undetected if the :format keyword was used with other non-special keywords. ([@deivid-rodriguez][])
    • #3406: Enable cops if Enabled is not explicitly set to false. ([@metcalf][])
    • ๐Ÿ›  Fix Lint/FormatParameterMismatch for splatted last argument. ([@zverok][])
    • #3853: Fix false positive in RedundantParentheses cop with multiple expression. ([@pocke][])
    • ๐Ÿš… #3870: Avoid crash in Rails/HttpPositionalArguments. ([@pocke][])
    • ๐Ÿ‘• #3869: Prevent Lint/FormatParameterMismatch from breaking when #% is passed an empty array. ([@drenmi][])
    • #3879: Properly handle Emacs and Vim magic comments for FrozenStringLiteralComment. ([@backus][])
    • ๐Ÿ’… #3736: Fix to remove accumulator return value by auto-correction in Style/EachWithObject. ([@pocke][])