Rubocop v0.48.0 Release Notes

Release Date: 2017-03-26 // about 7 years ago
  • ๐Ÿ†• New features

    • ๐Ÿ”ง #4107: New TargetRailsVersion configuration parameter can be used to specify which version of Rails the inspected code is intended to run on. ([@maxbeizer][])
    • ๐Ÿ’… #4104: Add prefix and postfix styles to Style/NegatedIf. ([@brandonweiss][])
    • ๐Ÿ’… #4083: Add new configuration NumberOfEmptyLines for Style/EmptyLineBetweenDefs. ([@dorian][])
    • ๐Ÿ’… #4045: Add new configuration Strict for Style/NumericLiteral to make the change to this cop in 0.47.0 configurable. ([@iGEL][])
    • 0๏ธโƒฃ #4005: Add new AllCops/EnabledByDefault option. ([@betesh][])
    • #3893: Add a new configuration, IncludeActiveSupportAliases, to Performance/DoublStartEndWith. This configuration will check for ActiveSupport's starts_with? and ends_with?. ([@rrosenblum][])
    • ๐Ÿ’… #3889: Add new Style/EmptyLineAfterMagicComment cop. ([@backus][])
    • ๐Ÿ’… #3800: Make Style/EndOfLine configurable with lf, crlf, and native (default) styles. ([@jonas054][])
    • ๐Ÿ’… #3936: Add new Style/MixinGrouping cop. ([@drenmi][])
    • ๐Ÿš… #4003: Add new Rails/RelativeDateConstant cop. ([@sinsoku][])
    • ๐Ÿ’… #3984: Add new Style/EmptyLinesAroundBeginBody cop. ([@pocke][])
    • ๐Ÿ’… #3995: Add new Style/EmptyLinesAroundExceptionHandlingKeywords cop. ([@pocke][])
    • ๐Ÿ’… #4019: Make configurable Style/MultilineMemoization cop. ([@pocke][])
    • ๐Ÿ‘• #4018: Add auto-correct Lint/EmptyEnsure cop. ([@pocke][])
    • ๐Ÿ’… #4028: Add new Style/IndentHeredoc cop. ([@pocke][])
    • ๐Ÿ‘• #3931: Add new Lint/AmbiguousBlockAssociation cop. ([@smakagon][])
    • โž• Add new Style/InverseMethods cop. ([@rrosenblum][])
    • ๐Ÿ’… #4038: Allow default key in the Style/PercentLiteralDelimiters cop config to set all preferred delimiters. ([@kddeisz][])
    • โž• Add IgnoreMacros option to Style/MethodCallWithArgsParentheses. ([@drenmi][])
    • ๐Ÿš… #3937: Add new Rails/ActiveSupportAliases cop. ([@tdeo][])
    • โž• Add new Rails/Blank cop. ([@rrosenblum][])
    • โž• Add new Rails/Present cop. ([@rrosenblum][])
    • #4004: Allow not treating comment lines as group separators in Bundler/OrderedGems cop. ([@konto-andrzeja][])

    ๐Ÿ”„ Changes

    • โšก๏ธ #4100: Rails/SaveBang should flag update_attributes. ([@andriymosin][])
    • ๐Ÿ’… #4083: Style/EmptyLineBetweenDefs doesn't allow more than one empty line between method definitions by default (see NumberOfEmptyLines). ([@dorian][])
    • 0๏ธโƒฃ #3997: Include all ruby files by default and exclude non-ruby files. ([@dorian][])
    • #4012: Mark foo[:bar] as not complex in Style/TernaryParentheses cop with require_parentheses_when_complex style. ([@onk][])
    • ๐Ÿ‘• #3915: Make configurable whitelist for Lint/SafeNavigationChain cop. ([@pocke][])
    • ๐Ÿ’… #3944: Allow keyword arguments in Style/RaiseArgs cop. ([@mikegee][])
    • โž• Add auto-correct to Performance/DoubleStartEndWith. ([@rrosenblum][])
    • ๐Ÿš… #3951: Make Rails/Date cop to register an offence for a string without timezone. ([@sinsoku][])
    • ๐Ÿ›  #4020: Fixed new_cop.rake suggested path. ([@dabroz][])
    • #4055: Add parameters count to offense message for Metrics/ParameterLists cop. ([@pocke][])
    • ๐Ÿ”’ #4081: Allow Marshal.load if argument is a Marshal.dump in Security/MarshalLoad cop. ([@droptheplot][])
    • ๐Ÿ’… #4124: Make Style/SymbolArray cop to enable by default. ([@pocke][])
    • #3331: Change Style/MultilineMethodCallIndentation indented_relative_to_receiver to indent relative to the receiver and not relative to the caller. ([@jfelchner][])
    • #4137: Allow lines to be exempted from IndentationWidth by regex. ([@jfelchner][])

    ๐Ÿ› Bug fixes

    • ๐Ÿš… #4007: Skip Rails/SkipsModelValidations for methods that don't accept arguments. ([@dorian][])
    • #3923: Allow asciibetical sorting in Bundler/OrderedGems. ([@mikegee][])
    • ๐Ÿ‘• #3855: Make Lint/NonLocalExitFromIterator aware of method definitions. ([@drenmi][])
    • #2643: Allow uppercase and dashes in MagicComment. ([@mikegee][])
    • ๐Ÿ’… #3959: Don't wrap "percent arrays" with extra brackets when auto-correcting Style/MutableConstant. ([@mikegee][])
    • ๐ŸŽ #3978: Fix false positive in Performance/RegexpMatch with English module. ([@pocke][])
    • #3242: Ignore Errno::ENOENT during cache cleanup from File.mtime too. ([@mikegee][])
    • ๐Ÿ’… #3958: Style/SpaceInsideHashLiteralBraces doesn't add and offence when checking an hash where a value is a left brace string (e.g. { k: '{' }). ([@nodo][])
    • ๐Ÿ’… #4006: Prevent Style/WhileUntilModifier from breaking on a multiline modifier. ([@drenmi][])
    • ๐Ÿ’… #3345: Allow Style/WordArray's WordRegex configuration value to be an instance of String. ([@mikegee][])
    • #4013: Follow redirects for RemoteConfig. ([@buenaventure][])
    • ๐Ÿš… #3917: Rails/FilePath Match nodes in a method call only once. ([@unmanbearpig][])
    • ๐Ÿ’… #3673: Fix regression on Style/RedundantSelf when assigning to same local variable. ([@bankair][])
    • #4047: Allow find_zone and find_zone! methods in Rails/TimeZone. ([@attilahorvath][])
    • โš  #3457: Clear a warning and prevent new warnings. ([@mikegee][])
    • ๐Ÿ‘• #4066: Register an offense in Lint/ShadowedException when an exception is shadowed and there is an implicit begin. ([@rrosenblum][])
    • ๐Ÿ‘• #4001: Lint/UnneededDisable of Metrics/LineLength that isn't unneeded. ([@wkurniawan07][])
    • ๐Ÿ”ง #3960: Let Include/Exclude paths in all files beginning with .rubocop be relative to the configuration file's directory and not to the current directory. ([@jonas054][])
    • ๐Ÿ›  #4049: Bugfix for Style/EmptyLiteral cop. ([@ota42y][])
    • ๐Ÿ’… #4112: Fix false positives about double quotes in Style/StringLiterals, Style/UnneededCapitalW and Style/UnneededPercentQ cops. ([@pocke][])
    • ๐Ÿ’… #4109: Fix incorrect auto correction in Style/SelfAssignment cop. ([@pocke][])
    • ๐Ÿ’… #4110: Fix incorrect auto correction in Style/BracesAroundHashParameters cop. ([@musialik][])
    • ๐Ÿ’… #4084: Fix incorrect auto correction in Style/TernaryParentheses cop. ([@musialik][])
    • ๐Ÿ”’ #4102: Fix Security/JSONLoad, Security/MarshalLoad and Security/YAMLLoad cops patterns not matching ::Const. ([@musialik][])
    • #3580: Handle combinations of # rubocop:disable all and # rubocop:disable SomeCop. ([@jonas054][])
    • ๐Ÿ’… #4124: Fix auto correction bugs in Style/SymbolArray cop. ([@pocke][])
    • ๐Ÿ’… #4128: Prevent Style/CaseIndentation cop from registering offenses on single-line case statements. ([@drenmi][])
    • ๐Ÿ’… #4143: Prevent Style/IdenticalConditionalBranches from registering offenses when a case statement has an empty when. ([@dpostorivo][])
    • #4160: Fix a regression where UselessAssignment cop may not properly detect useless assignments when there's only a single conditional expression in the top level scope. ([@yujinakayama][])
    • #4162: Fix a false negative in UselessAssignment cop with nested conditionals. ([@yujinakayama][])