Skip to content
Permalink
master
Switch branches/tags
Go to file
587 contributors

Users who have contributed to this file

@bbatsov @jonas054 @koic @rrosenblum @alexdowad @pocke @Drenmi @yujinakayama @lumeet @fatkodima @tejasbubane @marcandre
5613 lines (4649 sloc) 530 KB

Change log

master (unreleased)

1.14.0 (2021-05-05)

New features

  • #7669: New cop Bundler/GemVersion requires or forbids specifying gem versions. (@timlkelly)
  • #9758: Support TargetRubyVersion 3.1 (experimental). (@koic)
  • #9733: Add cop Layout/SingleLineBlockChain. (@jonas054)

Bug fixes

  • #9751: Style/StringLiteral doesn't autocorrect global variable interpolation. (@etiennebarrie)
  • #9731: Fix two autocorrection issues for Style/NegatedIfElseCondition. (@dvandersluis)
  • #9740: Fix an incorrect auto-correct for Style/SingleLineMethods when defining setter method. (@koic)
  • #9757: Fix a false positive for Lint/NumberConversion when :to_f is one of multiple method arguments. (@koic)
  • #9761: Fix Style/ClassAndModuleChildren false negative for compact style when a class/module is partially nested. (@dvandersluis)
  • #9748: Prevent infinite loops during symlink traversal. (@Tonkpils)
  • #9762: Update VariableForce to be able to handle case-match nodes. (@dvandersluis)
  • #9729: Fix an error for Style/IfUnlessModifier when variable assignment is used in the branch body of if modifier. (@koic)
  • #9750: Fix an incorrect auto-correct for Style/SoleNestedConditional when when using nested if within unless foo == bar. (@koic)
  • #9751: Style/StringLiteral autocorrects '\\' into "\\". (@etiennebarrie)
  • #9732: Support deprecated Socket.gethostbyaddr and Socket.gethostbyname. (@AndreiEres)
  • #9713: Fix autocorrection for block local variables in Lint/UnusedBlockArgument. (@tejasbubane)
  • #9746: Fix a false positive for Lint/UnreachableLoop when using conditional next in a loop. (@koic)

1.13.0 (2021-04-20)

New features

  • #7977: Add Layout/RedundantLineBreak cop. (@jonas054)
  • #9691: Add configuration parameter InspectBlocks to Layout/RedundantLineBreak. (@jonas054)
  • #9684: Support IgnoredMethods option for Lint/AmbguousBlockAssociation. (@gprado)
  • #9358: Support restrictive_version_specificiers option in Bundler/GemComment cop. (@RobinDaugherty)

Bug fixes

  • #5576: Fix problem with inherited Include parameters. (@jonas054)
  • #9690: Fix an incorrect auto-correct for Style/IfUnlessModifier when using a method with heredoc argument. (@koic)
  • #9681: Fix an incorrect auto-correct for Style/RedundantBegin when using modifier if single statement in begin block. (@koic)
  • #9698: Fix an error for Style/StructInheritance when extending instance of Struct without do ... end and class body is empty and single line definition. (@koic)
  • #9700: Avoid warning about Ruby version mismatch. (@marcandre)
  • #9636: Resolve symlinks when excluding directories. (@ob-stripe)
  • #9707: Fix false positive for Style/MethodCallWithArgsParentheses with omit_parentheses style on an endless defs node. (@dvandersluis)
  • #9689: Treat parens around array items the same for children and deeper descendants. (@dvandersluis)
  • #9676: Fix an error for Style/StringChars when using split without parentheses. (@koic)
  • #9712: Fix an incorrect auto-correct for Style/HashConversion when Hash[] as a method argument without parentheses. (@koic)
  • #9704: Fix an incorrect auto-correct for Style/SingleLineMethods when single line method call without parentheses. (@koic)
  • #9683: Fix an incorrect auto-correct for Style/HashConversion when using zip method without argument in Hash[]. (@koic)
  • #9715: Fix an incorrect auto-correct for EnforcedStyle: require_parentheses of Style/MethodCallWithArgsParentheses with Style/RescueModifier. (@koic)

Changes

  • #7544: Add --no-parallel (-P/--parallel can not be combined with --auto-correct). (@kwerle)
  • #9648: Drop support for Ruby 2.4. (@koic)
  • #9647: The parallel flag will now be automatically ignored when combined with --auto-correct, --auto-gen-config, or -F/--fail-fast. Previously, an error was raised and execution stopped. (@rrosenblum)

1.12.1 (2021-04-04)

Bug fixes

  • #9649: Fix when highlights contain multibyte characters. (@osyo-manga)
  • #9646: Fix an incorrect auto-correct for EnforcedStyle: require_parentheses of Style/MethodCallWithArgsParentheses with EnforcedStyle: conditionals of Style/AndOr. (@koic)
  • #9608: Fix a false positive for Layout/EmptyLineAfterGuardClause when using guard clause is after rubocop:enable comment. (@koic)
  • #9637: Allow parentheses for forwarded args in Style/MethodCallWithArgsParentheses's omit_parentheses style to avoid endless range ambiguity. (@gsamokovarov)
  • #9641: Fix Layout/MultilineMethodCallIndentation triggering on method calls that look like operators. (@dvandersluis)
  • #9638: Fix an error for Layout/LineLength when over limit at right hand side of multiple assignment. (@koic)
  • #9639: Fix Style/RedundantBegin removing comments on assignment statement correction. (@marcotc)
  • #9671: Fix an incorrect auto-correct for Lint/AmbiguousOperator with Style/MethodCallWithArgsParentheses. (@koic)
  • #9645: Fix an incorrect auto-correct for Style/SingleLineMethods when using single line class method definition. (@koic)
  • #9644: Fix an error and an incorrect auto-correct for Style/MultilineMethodSignature when line break after opening parenthesis. (@koic)
  • #9672: Fix an incorrect auto-correct for Style/HashConversion when using multi-argument Hash[] as a method argument. (@koic)

1.12.0 (2021-03-24)

New features

  • #9615: Add new Style/StringChars cop. (@koic)
  • #9629: Add AllowParenthesesInStringInterpolation configuration to Style/MethodCallWithArgsParentheses to allow parenthesized calls in string interpolation. (@gsamokovarov)
  • #9219: Allow excluding some constants from Style/Documentation. (@fsateler)
  • Add AllowNil option for Lint/SuppressedException to allow/disallow rescue nil. (@corroded)

Bug fixes

  • #9560: Fix an error for Lint/ClassMethodsDefinitions when defining class methods with class << self with comment only body. (@koic)
  • #9551: Fix a false positive for Style/UnlessLogicalOperators when using || operator and invoked method name includes "or" in the conditional branch. (@koic)
  • #9620: Allow parentheses in operator methods calls for Style/MethodCallWithArgsParentheses EnforcedStyle: omit_parentheses. (@gsamokovarov)
  • #9622: Fixed Style/BisectedAttrAccessor autocorrection to handle multiple bisected attrs in the same macro. (@dvandersluis)
  • #9606: Fix an error for Layout/IndentationConsistency when using access modifier at the top level. (@koic)
  • #9619: Fix infinite loop between Layout/IndentationWidth and Layout/RescueEnsureAlignment autocorrection. (@dvandersluis)
  • #9633: Fix an incorrect auto-correct for Lint/NumberConversion when to_i method in symbol form. (@koic)
  • #9616: Fix an incorrect auto-correct for Style/EvalWithLocation when using #instance_eval with a string argument in parentheses. (@koic)
  • #9429: Fix Style/NegatedIfElseCondition autocorrect to keep comments in correct branch. (@tejasbubane)
  • #9631: Fix an incorrect auto-correct for Style/RedundantReturn when using return with splat argument. (@koic)
  • #9627: Fix an incorrect auto-correct for Style/StructInheritance when extending instance of Struct without do ... end and class body is empty. (@koic)
  • #5953: Fix a false positive for Style/AccessModifierDeclarations when using module_function with symbol. (@koic)
  • #9593: Fix an error when processing a directory is named {}. (@koic)
  • #9599: Fix an error for Style/CaseLikeIf when using include? without a receiver. (@koic)
  • #9582: Fix incorrect auto-correct for Style/ClassEqualityComparison when comparing Module#name for equality. (@koic)
  • #9603: Fix a false positive for Style/SoleNestedConditional when using nested modifier on value assigned in condition. (@koic)
  • #9598: Fix RuboCop::MagicComment#valid_shareable_constant_value?. (@kachick)
  • #9625: Allow parentheses in yield arguments with Style/MethodCallWithArgsParentheses EnforcedStyle: omit_parentheses to fix invalid Ruby auto-correction. (@gsamokovarov)
  • #9558: Fix inconsistency when dealing with URIs that are wrapped in single quotes vs double quotes. (@dvandersluis)
  • #9613: Fix a false positive for Style/RedundantSelf when a self receiver on an lvalue of mlhs arguments. (@koic)
  • #9586: Update Naming/RescuedExceptionsVariableName to not register on inner rescues when nested. (@dvandersluis)

Changes

  • #9487: Mark Naming/MemoizedInstanceVariableName as unsafe. (@marcandre)
  • #9601: Make Style/RedundantBegin aware of redundant begin/end blocks around memoization. (@koic)
  • #9617: Disable suggested extensions when using the --stdin option. (@dvandersluis)

1.11.0 (2021-03-01)

New features

  • #5388: Add new Style/UnlessLogicalOperators cop. (@caalberts)
  • #9525: Add AllowMethodsWithArguments option to Style/SymbolProc. (@koic)

Bug fixes

  • #9520: Fix an incorrect auto-correct for Style/MultipleComparison when comparing a variable with multiple items in if and elsif conditions. (@koic)
  • #9548: Fix a false positive for Style/TrailingBodyOnMethodDefinition when endless method definition body is after newline in opening parenthesis. (@koic)
  • #9541: Fix Style/HashConversion when the correction needs to be wrapped in parens. (@dvandersluis)
  • #9533: Make metrics length cops aware of multi-line kwargs. (@koic)
  • #9523: Fix an error for Style/TrailingMethodEndStatement when endless method definition signature and body are on different lines. (@koic)
  • #9482: Return minimal known ruby version from gemspecs required_ruby_version. (@HeroProtagonist)
  • #9539: Fix an error for Style/RedundantBegin when using body of begin is empty. (@koic)
  • #9542: Fix Layout/FirstArgumentIndentation for operator methods not called as operators. (@dvandersluis, @TSMMark)

Changes

  • #9526: Add AllowSplatArgument option to Style/HashConversion and the option is true by default. (@koic)

1.10.0 (2021-02-15)

New features

  • #9478: Add new Style/HashConversion cop. (@zverok)
  • #9496: Add new Gemspec/DateAssignment cop. (@koic)
  • #8724: Add IgnoreModules configuration to Style/ConstantVisibility to not register offense for module definitions. (@tejasbubane)
  • #9403: Add autocorrect for Style/EvalWithLocation cop. (@cteece)

Bug fixes

  • #9500: Update Lint/Debugger so that only specific receivers for debug methods lead to offenses. (@dvandersluis)
  • #9499: Fix a false positive for Layout/SpaceBeforeBrackets when multiple spaces are inserted inside the left bracket. (@koic)
  • #9507: Fix an incorrect auto-correct for Lint/RedundantSplatExpansion when expanding Array.new call on method argument. (@koic)
  • #9490: Fix incorrect auto-correct for Layout/FirstArgumentIndentation when specifying EnforcedStyle: with_fixed_indentation of Layout/ArgumentAlignment and EnforcedStyle: consistent of Layout/FirstArgumentIndentation. (@koic)
  • #9497: Fix an error for Style/ExplicitBlockArgument when yield is inside block of super. (@koic)
  • #9349: Fix a false positive for Lint/MultipleComparison when using &, |, and ^ set operation operators in multiple comparison. (@koic)
  • #9511: Fix a false negative for Lint/ElseLayout when using multiple elsifs. (@koic)
  • #9513: Fix an incorrect auto-correct for Style/HashConversion when using hash argument Hash[]. (@koic)
  • #9492: Fix an incorrect auto-correct for Lint/DeprecatedOpenSSLConstant when using no argument algorithm. (@koic)

Changes

1.9.1 (2021-02-01)

New features

  • #9459: Add AllowedMethods option to Style/IfWithBooleanLiteralBranches and set nonzero? as default value. (@koic)

Bug fixes

  • #9431: Fix an error for Style/DisableCopsWithinSourceCodeDirective when using leading source comment. (@koic)
  • #9444: Fix error on colorization for offenses with Severity: info. (@tejasbubane)
  • #9448: Fix an error for Style/SoleNestedConditional when using nested unless modifier with a single expression condition. (@koic)
  • #9449: Fix an error for Style/NilComparison when using x == nil as a guard condition'. (@koic)
  • #9440: Fix Lint/SymbolConversion for implicit to_sym without a receiver. (@dvandersluis)
  • #9453: Fix infinite loop error for Layout/FirstParameterIndentation when EnforcedStyle: with_fixed_indentation is specified for Layout/ArgumentAlignment. (@koic)
  • #9466: Don't correct Style/SingleLineMethods using endless methods if the target ruby is < 3.0. (@dvandersluis)
  • #9455: Fix a false positive for Lint/SymbolConversion when hash keys that contain ":". (@koic)
  • #9454: Fix an incorrect auto-correct for Style/IfWithBooleanLiteralBranches when using elsif do_something? with boolean literal branches. (@koic)
  • #9438: Fix a false positive for Layout/SpaceBeforeBrackets when space is used in left bracket. (@koic)
  • #9457: Fix a false positive for Lint/SymbolConversion when hash keys that end with =. (@koic)
  • #9473: Fix an error for Lint/DeprecatedConstants when using __ENCODING__. (@koic)
  • #9452: Fix StyleGuideBaseURL not functioning with nested departments. (@tas50)
  • #9465: Update Metrics/ParameterLists to be able to write MaxOptionalParameters in rubocop_todo.yml. (@dvandersluis)
  • #9433: Fix an error for Style/EvalWithLocation when using eval with block argument. (@koic)

Changes

  • #9437: Improve offense message when there is an allowed range of empty lines. (@dvandersluis)
  • #9476: Mark Style/IfWithBooleanLiteralBranche as unsafe auto-correction. (@koic)

1.9.0 (2021-01-28)

New features

Bug fixes

  • #9366: Fix an incorrect auto-correct for Style/SoleNestedConditional when using method arguments without parentheses for outer condition. (@koic)
  • #9372: Fix an error for Style/IfInsideElse when nested if branch code is empty. (@koic)
  • #9374: Fix autocorrection for Layout/LineLength when the first argument to a send node is a overly long hash pair. (@dvandersluis)
  • #9387: Fix incorrect auto-correct for Style/NilComparison when using !x.nil? and EnforcedStyle: comparison. (@koic)
  • #9411: Fix false negatives for Style/EvalWithLocation for Kernel.eval and when given improper arguments. (@dvandersluis)
  • #7766: Fix Naming/RescuedExceptionsVariableName autocorrection when the rescue body returns the exception variable. (@asterite)
  • #7766: Fix Naming/RescuedExceptionsVariableName autocorrection to not change variables if the exception variable has been reassigned. (@dvandersluis)
  • #9389: Fix an infinite loop error for IncludeSemanticChanges: false of Style/NonNilCheck with EnforcedStyle: comparison of Style/NilComparison. (@koic)
  • #9384: Fix a suggestion message when not auto-correctable. (@koic)
  • #9424: Fix an incorrect auto-correct for Style/ClassMethodsDefinitions when defining class methods with class << self and there is no blank line between method definition and attribute accessor. (@koic)
  • #9370: Fix an incorrect auto-correct for Style/SoleNestedConditional when using nested unless modifier multiple conditional. (@koic)
  • #9406: Fix rubocop_todo link injection when YAML doc start sigil exists. (@dduugg)
  • #9229: Fix errors being reported with rubocop -V with an invalid config. (@dvandersluis)
  • #9425: Fix error in Layout/ClassStructure when initializer comes after private attribute macro. (@tejasbubane)

Changes

  • #9415: Change Layout/ClassStructure to detect inline modifiers. (@AndreiEres)
  • #9380: Mark Style/FloatDivision as unsafe. (@koic)
  • #9345: Make Style/AsciiComments allow copyright notice by default. (@koic)
  • #9399: Added AllowedCops configuration to Style/DisableCopsWithinSourceCodeDirective. (@dvandersluis)
  • #9327: Change Layout/EmptyLineAfterMagicComment to accept top-level shareable_constant_values directive. (@tejasbubane)
  • #7902: Change Lint/NumberConversion to detect symbol form of conversion methods. (@tejasbubane)

1.8.1 (2021-01-11)

Bug fixes

  • #9342: Fix an error for Lint/RedundantDirGlobSort when using collection.sort. (@koic)
  • #9304: Do not register an offense for Style/ExplicitBlockArgument when the yield arguments are not an exact match with the block arguments. (@dvandersluis)
  • #8281: Fix Style/WhileUntilModifier handling comments and assignment when correcting to modifier form. (@Darhazer)
  • #8229: Fix faulty calculation in UncommunicativeName. (@ohbarye)
  • #9350: Wrap in parens before replacing unless with if and !. (@magneland)
  • #9356: Fix duplicate extension cop versions when using rubocop -V. (@koic)
  • #9355: Fix Style/SingleLineMethods autocorrection to endless method when the original code had parens. (@dvandersluis)
  • #9346: Fix an incorrect auto-correct for Style/StringConcatenation when concat string include double quotes and interpolation. (@k-karen)

1.8.0 (2021-01-07)

New features

Bug fixes

  • #9298: Fix an incorrect auto-correct for Lint/RedundantCopDisableDirective when there is a blank line before inline comment. (@koic)
  • #9233: Fix Style/SoleNestedConditional copying non-relevant comments during auto-correction. (@Darhazer)
  • #9312: Fix Layout/FirstHashElementLineBreak to apply to multi-line hashes with only a single element. (@muirdm)
  • #9316: Fix Style/EmptyLiteral registering wrong offense when using a numbered block for Hash.new, i.e. Hash.new { _1[_2] = [] }. (@agargiulo)
  • #9308: Fix an error for Layout/EmptyLineBetweenDefs when using endless class method. (@koic)
  • #9314: Fix an incorrect auto-correct for Style/RedundantReturn when multiple return values have a parenthesized return value. (@koic)
  • #9335: Fix an incorrect auto-correct for EnforcedStyle: require_parentheses of Style/MethodCallWithArgsParentheses with Style/NestedParenthesizedCalls. (@koic)
  • #9290: Fix a false positive for Layout/SpaceBeforeBrackets when using array literal method argument. (@koic)
  • #9333: Fix an error for Style/IfInsideElse when using a modifier if nested inside an else after elsif. (@koic)
  • #9303: Fix an incorrect auto-correct for Style/RaiseArgs with EnforcedStyle: compact when using exception instantiation argument. (@koic)

Changes

  • #9300: Make Lint/NonDeterministicRequireOrder not to register offense when using Ruby 3.0 or higher. (@koic)
  • #9320: Support unicode-display_width v2. (@dduugg)
  • #9288: Require Parser 3.0.0.0 or higher. (@koic)
  • #9337: Add AllowedIdentifiers to Naming/VariableName. (@dvandersluis)
  • #9295: Update Style/SingleLineMethods to correct to an endless method definition if they are allowed. (@dvandersluis)
  • #9331: Mark Style/MutableConstant as unsafe. (@koic)

1.7.0 (2020-12-25)

New features

  • #9260: Support auto-correction for Style/MultilineMethodSignature. (@koic)
  • #9282: Make Style/RedundantFreeze and Style/MutableConstant cops aware of frozen regexp and range literals when using Ruby 3.0. (@koic)
  • #9223: Add new Lint/AmbiguousAssignment cop. (@fatkodima)
  • #9243: Support auto-correction for Style/CommentedKeyword. (@koic)
  • #9283: Add new Style/HashExcept cop. (@koic)
  • #9231: Add new Layout/SpaceBeforeBrackets cop. (@koic)

Bug fixes

  • #9232: Fix Style/SymbolProc registering wrong offense when using a symbol numbered block argument greater than 1, i.e. [[1, 2]].map { _2.succ }. (@tdeo)
  • #9274: Fix error in Metrics/ClassLength when the class only contains comments. (@dvandersluis)
  • #9213: Fix a false positive for Style/RedanduntFreeze when using Array#*. (@koic)
  • #9279: Add support for endless methods to Style/MethodCallWithArgsParentheses. (@dvandersluis)
  • #9245: Fix Lint/AmbiguousRegexpLiteral when given a match_with_lvasgn node. (@dvandersluis)
  • #9276: Add support for endless methods to Style/SingleLineMethods. (@dvandersluis)
  • #9225: Fix Style/LambdaCall ignoring further offenses after opposite style is detected. (@sswander)
  • #9234: Fix the error for Style/KeywordParametersOrder and make it aware of block keyword parameters. (@koic)
  • #8938: Fix some ConfigurableEnforcedStyle cops to output Exclude file lists in --auto-gen-config runs. (@h-lame)
  • #9257: Fix false positive for Style/SymbolProc when the block uses a variable from outside the block. (@dvandersluis)
  • #9251: Fix extracted cop warning when the extension is loaded using --require. (@dvandersluis)
  • #9244: When a cop defined in an extension is explicitly enabled, ensure that it remains enabled. (@dvandersluis)
  • #8046: Fix an error for Layout/HeredocArgumentClosingParenthesis when there is an argument between a heredoc argument and the closing paretheses. (@koic)
  • #9261: Fix an incorrect auto-correct for Style/MultilineWhenThen when one line for multiple condidate values of when statement. (@makicamel)
  • #9258: Fix calculation of cop department for nested departments. (@mvz)
  • #9277: Fix Layout/EmptyLineBetweenDefs error with endless method definitions. (@dvandersluis)
  • #9278: Update Style/MethodDefParentheses to ignore endless method definitions since parentheses are always required. (@dvandersluis)

Changes

  • #9212: Make Style/RedundantArgument aware of String#chomp and String#chomp!. (@koic)
  • #8482: Allow simple math for Lint/BinaryOperatorWithIdenticalOperands cop. (@fatkodima)
  • #9237: Add IgnoredPatterns configuration to Lint/UnreachableLoop to allow for block methods that share a name with an Enumerable method. (@dvandersluis)
  • #9206: Allow extensions to disable cop obsoletions. (@dvandersluis)
  • #9262: Update Style/CollectionMethods to be handle additional arguments and methods that accept a symbol instead of a block. (@dvandersluis)
  • #9235: Allow --only and --except to be able to properly qualify cops added by require. (@dvandersluis)
  • #9205: Update Naming/MemoizedInstanceVariableName to handle dynamically defined methods. (@dvandersluis)
  • #9285: Add AllowPercentLiteralArrayArgument option for Lint/RedundantSplatExpansion to enable the option by default. (@koic)
  • #9208: Use Array#bsearch instead of Array#include? to detect hidden files. (@dark-panda)
  • #9228: Suppress any config warnings for rubocop -V. (@dvandersluis)
  • #9193: Add IgnoreLiteralBranches and IgnoreConstantBranches options to Lint/DuplicateBranch. (@dvandersluis)

1.6.1 (2020-12-10)

Bug fixes

  • #9196: Fix ConfigObsoletion::ExtractedCop raising errors for loaded features when bundler is not activated. (@dvandersluis)

1.6.0 (2020-12-09)

New features

  • #9125: Allow ConfigObsoletion to be extended by other RuboCop libraries. (@dvandersluis)
  • #9182: Support auto-correction for Style/RedundantArgument. (@koic)
  • #9186: Support auto-correction for Style/FloatDivision. (@koic)
  • #9167: Support auto-correct for StyleSingleLineBlockParams. (@koic)

Bug fixes

  • #9177: Remove back-ref related code from Style/SpecialGlobalVars. (@r7kamura)
  • #9160: Fix an incorrect auto-correct for Style/IfUnlessModifier and Style/SoleNestedConditional when auto-correction conflicts for guard condition. (@koic)
  • #9174: Handle send nodes with unparenthesized arguments in Style/SoleNestedConditional. (@dvandersluis)
  • #9184: Layout/EmptyLinesAroundAttributeAccessor fails if the attr_accessor is the last line of the file. (@tas50)

Changes

  • #9171: Add "did you mean" message when failing due to invalid cops in configuration. (@dvandersluis)
  • #8897: Change Style/StringConcatenation to accept line-end concatenation between two strings so that Style/LineEndConcatenation can handle it instead. (@dvandersluis)
  • #9172: Add Style/PerlBackrefs targets and change message more detailed. (@r7kamura)
  • #9187: Update formatters to output [Correctable] for correctable offenses. (@dvandersluis)
  • #9169: Add obsoletion warnings for Performance/* and Rails/* which are in separate gems now. (@dvandersluis)

1.5.2 (2020-12-04)

Bug fixes

  • #9152: Fix an incorrect auto-correct for Style/SoleNestedConditional when nested || operator modifier condition. (@koic)
  • #9161: Fix a false positive for Layout/HeredocArgumentClosingParenthesis when using subsequence closing parentheses in the same line. (@koic)
  • #9151: Fix SuggestExtensions to not suggest extensions that are installed but not direct dependencies. (@dvandersluis)
  • #8985: Fix Style/StringConcatenation autocorrect generating invalid ruby. (@tejasbubane)
  • #9155: Fix a false positive for Layout/MultilineMethodCallIndentation when multiline method chain has expected indent width and the method is preceded by splat for EnforcedStyle: indented_relative_to_receiver. (@koic)

Changes

1.5.1 (2020-12-02)

Bug fixes

  • #8684: Fix an error for Lint/InterpolationCheck cop. (@tejasbubane)
  • #9145: Fix issues with SuggestExtensions when bundler is not available, or when there is no gemfile. (@dvandersluis)
  • #9140: Fix an error for Layout/EmptyLinesAroundArguments when multiline style argument for method call without selector. (@koic)
  • #9136: Fix AllowedIdentifiers in Naming/VariableNumber to include variable assignments. (@PhilCoggins)

1.5.0 (2020-12-01)

New features

  • #9112: Add new cop Lint/UnexpectedBlockArity. (@dvandersluis)
  • #9010: Metrics/ParameterLists supports MaxOptionalParameters config parameter. (@fatkodima)
  • #9114: Support auto-correction for Style/SoleNestedConditional. (@koic)
  • #8564: Metrics/AbcSize: Add optional discount for repeated "attributes". (@marcandre)

Bug fixes

  • #8820: Fixes IfWithSemicolon autocorrection when elsif is present. (@adrian-rivera, @dvandersluis)
  • #9113: Fix a false positive for Style/MethodCallWithoutArgsParentheses when assigning to a default argument with the same name. (@koic)
  • #9115: Fix a false positive for Style/FirstArgumentIndentation when argument has expected indent width and the method is preceded by splat for EnforcedStyle: consistent_relative_to_receiver. (@koic)
  • #9128: Fix an incorrect auto-correct for Style/ClassAndModuleChildren when namespace is defined as a class in the same file. (@koic)
  • #9105: Fix an incorrect auto-correct for Style/RedundantCondition when using operator method in else. (@koic)
  • #9096: Fix #9095 use merged_config instead of config for pending new cop check. (@ThomasKoppensteiner)
  • #8053: Fix an incorrect auto-correct for Style/AndOr when or precedes and. (@koic)
  • #9097: Fix a false positive for Layout/EmptyLinesAroundArguments when blank line is inserted between method with arguments and receiver. (@koic)

Changes

  • #9122: Added tip message if any gems are loaded that have RuboCop extensions. (@dvandersluis)
  • #9104: Preset some stdlib method names for Naming/VariableNumber. (@koic)
  • #9127: Update Style/SymbolProc to be aware of numblocks. (@dvandersluis)
  • #9102: Upgrade regexp_parser to 2.0. (@knu)
  • #9100: Update ConfigObsoletion so that parameters can be deprecated but still accepted. (@dvandersluis)
  • #9108: Update Lint/UnmodifiedReduceAccumulator to handle numblocks and more than 2 arguments. (@dvandersluis)
  • #9098: Update Metrics/BlockLength and Metrics/MethodLength to use IgnoredMethods instead of ExcludedMethods in configuration. The previous key is retained for backwards compatibility. (@dvandersluis)
  • #9098: Update IgnoredMethods so that every cop that uses it will accept both strings and regexes in the configuration. (@dvandersluis)

1.4.2 (2020-11-25)

Bug fixes

  • #9083: Fix Style/RedundantArgument cop raising offense for more than one argument. (@tejasbubane)
  • #9089: Fix an incorrect auto-correct for Style/FormatString when using springf with second argument that uses an operator. (@koic)
  • #7670: Handle offenses inside heredocs for -a --disable-uncorrectable. (@jonas054)
  • #9070: Fix Lint/UnmodifiedReduceAccumulator error when the block does not have enough arguments. (@dvandersluis)

Changes

1.4.1 (2020-11-23)

Bug fixes

1.4.0 (2020-11-23)

New features

  • #7737: Add new Style/RedundantArgument cop. (@tejasbubane)
  • #9064: Add EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs and EmptyLineBetweenModuleDefs config options for Layout/EmptyLineBetweenDefs cop. (@tejasbubane)
  • #9043: Add --stderr to write all output to stderr except for the autocorrected source. (@knu)

Bug fixes

  • #9067: Fix an incorrect auto-correct for Lint::AmbiguousRegexpLiteral when passing in a regexp to a method with no receiver. (@amatsuda)
  • #9060: Fix an error for Layout/SpaceAroundMethodCallOperator when using __ENCODING__. (@koic)
  • #7338: Handle assignment with []= in MultilineMethodCallIndentation. (@jonas054)
  • #7726: Fix MultilineMethodCallIndentation indentation inside square brackets. (@jonas054)
  • #8857: Improve how Exclude properties are generated by --auto-gen-config. (@jonas054)

Changes

  • #8788: Change Style/Documentation to not trigger offense with only macros. (@tejasbubane)
  • #8993: Allow ExcludedMethods config of Metrics/MethodLength cop to contain regex. (@tejasbubane)
  • #9073: Enable Layout/LineLength's auto-correct by default. (@bbatsov)
  • #9079: Improve the gemspec to load only the necessary files without the git utility. (@piotrmurach)
  • #9059: Update Lint/UnmodifiedReduceAccumulator to accept blocks which return in the form accumulator[element]. (@dvandersluis)
  • #9072: Lint/MissingSuper: exclude method_missing and respond_to_missing?. (@marcandre)
  • #9074: Allow specifying a pull request ID when calling rake changelog:*. (@marcandre)

1.3.1 (2020-11-16)

Bug fixes

  • #9037: Fix required_ruby_version issue when using Gem::Requirement. (@cetinajero)
  • #9039: Fix stack level too deep error if target directory contains **. (@unasuke)
  • #6962: Limit Layout/ClassStructure constant order autocorrect to literal constants. (@tejasbubane)
  • #9032: Fix an error for Style/DocumentDynamicEvalDefinition when using eval-type method with interpolated string that is not heredoc without comment doc. (@koic)
  • #9049: Have Lint/ToEnumArguments accept __callee__. (@marcandre)
  • #9050: Fix a false positive for Style/NegatedIfElseCondition when if with !! condition. (@koic)
  • #9041: Fix a false positive for Naming/VariableNumber when using integer symbols. (@koic)

Changes

  • #9045: Have cut_release handle "config/default" and generate cops doc. (@marcandre)
  • #9036: Allow enums method by default for Lint/ConstantDefinitionInBlock. (@koic)
  • #9035: Only complain about SafeYAML if it causes issues. (@marcandre)

1.3.0 (2020-11-12)

New features

Bug fixes

  • #8499: Fix Style/IfUnlessModifier and Style/WhileUntilModifier to prevent an offense if there are both first-line comment and code after end block. (@dsavochkin)
  • #8996: Fix a false positive for Style/MultipleComparison when comparing two sides of the disjunction is unrelated. (@koic)
  • #8975: Fix an infinite loop when autocorrecting Layout/TrailingWhitespace + Lint/LiteralInInterpolation. (@fatkodima)
  • #8998: Fix an error for Style/NegatedIfElseCondition when using negated condition and if branch body is empty. (@koic)
  • #9008: Mark Style/InfiniteLoop as unsafe. (@marcandre)

Changes

  • #8978: Update Layout/LineLength autocorrection to be able to handle method calls with long argument lists. (@dvandersluis)
  • #9015: Update Lint/EmptyBlock to allow for empty lambdas. (@dvandersluis)
  • #9022: Add NOTE to keywords of Style/CommentAnnotation. (@koic)
  • #9011: Mark autocorrection for Lint/Loop as unsafe. (@dvandersluis)
  • #9026: Update Style/DocumentDynamicEvalDefinition to detect comment blocks that document the evaluation. (@dvandersluis)
  • #9004: Remove obsolete gem SafeYAML compatibility. (@marcandre)
  • #9023: Mark unsafe for Style/CollectionCompact. (@koic)
  • #9012: Allow AllowedIdentifiers to be specified for Naming/VariableNumber. (@dvandersluis)

1.2.0 (2020-11-05)

New features

  • #8983: Support auto-correction for Naming/HeredocDelimiterCase. (@koic)
  • #8004: Add new GitHubActionsFormatter formatter. (@lautis)
  • #8175: Add new AllowedCompactTypes option for Style/RaiseArgs. (@pdobb)
  • #8566: Add new Style/CollectionCompact cop. (@fatkodima)
  • #8925: Add --display-time option for displaying elapsed time of rubocop command. (@joshuapinter)
  • #8967: Add new Style/NegatedIfElseCondition cop. (@fatkodima)
  • #8984: Support auto-correction for Style/DoubleNegation. (@koic)
  • #8992: Support auto-correction for Lint/ElseLayout. (@koic)
  • #8988: Support auto-correction for Lint/UselessSetterCall. (@koic)
  • #8982: Support auto-correction for Naming/BinaryOperatorParameterName. (@koic)

Bug fixes

  • #8989: Fix multibyte support in the regexp node handler that led Style/RedundantRegexpEscape to malfunction and corrupt a program in auto-correction. (@knu)
  • #8912: Fix Layout/ElseAlignment for rescue/else/ensure inside do/end blocks with assignment. (@miry)
  • #8971: Fix a false alarm for # rubocop:disable Lint/EmptyBlock inline comment with Lint/RedundantCopDisableDirective. (@koic)
  • #8976: Fix an incorrect auto-correct for Style/KeywordParametersOrder when kwoptarg is before kwarg and argument parentheses omitted. (@koic)
  • #8084: Fix a bug in how Layout/SpaceAroundBlockParameters handles block parameters with a trailing comma. (@bquorning)
  • #8966: Fix Layout/SpaceInsideParens to enforce no spaces in empty parens for all styles. (@joshuapinter)

Changes

  • #5717: Support defined?-based memoization for Naming/MemoizedInstanceVariableName cop. (@fatkodima)
  • #8964: Extend Naming/VariableNumber cop to handle method names and symbols. (@fatkodima)

1.1.0 (2020-10-29)

New features

  • #8896: Add new Lint/DuplicateRegexpCharacterClassElement cop. (@owst)
  • #8895: Add new Lint/EmptyBlock cop. (@fatkodima)
  • #8934: Add new Style/SwapValues cop. (@fatkodima)
  • #7549: Add new Style/ArgumentsForwarding cop. (@koic)
  • #8859: Add new Lint/UnmodifiedReduceAccumulator cop. (@dvandersluis)
  • #8951: Support auto-correction for Style/MultipleComparison. (@koic)
  • #8953: Add AllowMethodComparison option for Lint/MultipleComparison. (@koic)
  • #8960: Add Regexp::Expression#loc and #expression to replace parsed_tree_expr_loc. (@marcandre)
  • #8930: Add rake tasks for alternative way to specify Changelog entries. (@marcandre)
  • #8940: Add new Style/DocumentDynamicEvalDefinition cop. (@fatkodima)
  • #7753: Add new Lint/ToEnumArguments cop. (@fatkodima)

Bug fixes

  • #8921: Prevent Lint/LiteralInInterpolation from removing necessary interpolation in %W[] and %I[] literals. (@knu)
  • #8708: Fix bad regexp recognition in Lint/OutOfRangeRegexpRef when there are multiple regexps. (@dvandersluis)
  • #8945: Fix changelog task to build a correct changelog item when Fix #123 is encountered. (@dvandersluis)
  • #8914: Fix autocorrection for Layout/TrailingWhitespace in heredocs. (@marcandre)
  • #8913: Fix an incorrect auto-correct for Style/RedundantRegexpCharacterClass due to quantifier. (@ysakasin)
  • #8917: Fix rubocop comment directives handling of cops with multiple levels in department name. (@fatkodima)
  • #8918: Fix a false positives for Bundler/DuplicatedGem when a gem conditionally duplicated within if-elsif or case-when statements. (@fatkodima)
  • #8933: Fix an error for Layout/EmptyLinesAroundAccessModifier when the first line is a comment. (@matthieugendreau)
  • #8954: Fix autocorrection for Style/RedundantRegexpCharacterClass with %r. (@ysakasin)

Changes

  • #8920: Remove Capybara's save_screenshot from Lint/Debugger. (@ybiquitous)
  • #8919: Require RuboCop AST 1.0.1 or higher. (@koic)
  • #8939: Accept comparisons of multiple method calls for Style/MultipleComparison. (@koic)
  • #8950: Add IgnoredMethods and IgnoredClasses to Lint/NumberConversion. (@dvandersluis)

1.0.0 (2020-10-21)

New features

  • #7944: Add MaxUnannotatedPlaceholdersAllowed option to Style/FormatStringToken cop. (@Tietew)
  • #8379: Handle redundant parentheses around an interpolated expression for Style/RedundantParentheses cop. (@fatkodima)

Bug fixes

  • #8892: Fix an error for Style/StringConcatenation when correcting nested concatenable parts. (@fatkodima)
  • #8781: Fix handling of comments in Style/SafeNavigation autocorrection. (@dvandersluis)
  • #8907: Fix an incorrect auto-correct for Layout/ClassStructure when heredoc constant is defined after public method. (@koic)
  • #8889: Cops can use new after_<type> callbacks (only for nodes that may have children nodes, like :send and unlike :sym). (@marcandre)
  • #8906: Fix a false positive for Layout/SpaceAroundOperators when upward alignment. (@koic)
  • #8585: Fix false positive in Style/RedundantSelf cop with nested self access. (@marcotc)
  • #8692: Fix Layout/TrailingWhitespace auto-correction in heredoc. (@marcandre)

Changes

  • #8882: (Potentially breaking) RuboCop assumes that Cop classes do not define new on_<type> methods at runtime (e.g. via extend in initialize). (@marcandre)
  • #7966: (Breaking) Enable all pending cops for RuboCop 1.0. (@koic)
  • #8490: (Breaking) Change logic for cop department name computation. Cops inside deep namespaces (5 or more levels deep) now belong to departments with names that are calculated by joining module names starting from the third one with slashes as separators. For example, cop Rubocop::Cop::Foo::Bar::Baz now belongs to Foo/Bar department (previously it was Bar). (@dsavochkin)
  • #8692: Default changed to disallow Layout/TrailingWhitespace in heredoc. (@marcandre)
  • #8894: Make Security/Open aware of URI.open. (@koic)
  • #8901: Fix false positive for Naming/BinaryOperatorParameterName when defining =~. (@zajn)
  • #8908: Show extension cop versions when using --verbose-version option. (@koic)

0.93.1 (2020-10-12)

Bug fixes

  • #8782: Fix incorrect autocorrection for Style/TernaryParentheses with defined?. (@dvandersluis)
  • #8867: Rework Lint/RedundantSafeNavigation to be more safe. (@fatkodima)
  • #8864: Fix false positive for Style/RedundantBegin with a postfix while or until. (@dvandersluis)
  • #8869: Fix a false positive for Style/RedundantBegin when using begin for or assignment and method call. (@koic)
  • #8862: Fix an error for Lint/AmbiguousRegexpLiteral when using regexp without method calls in nested structure. (@koic)
  • #8872: Fix an error for Metrics/ClassLength when multiple assignments to constants. (@koic)
  • #8871: Fix a false positive for Style/RedundantBegin when using begin for method argument or part of conditions. (@koic)
  • #8875: Fix an incorrect auto-correct for Style/ClassEqualityComparison when comparing class name. (@koic)
  • #8880: Fix an error for Style/ClassLength when overlapping constant assignments. (@koic)

0.93.0 (2020-10-08)

New features

Bug fixes

  • #8810: Fix multiple offense detection for Style/RaiseArgs. (@pbernays)
  • #8151: Fix a false positive for Lint/BooleanSymbol when used within %i[...]. (@fatkodima)
  • #8809: Fix multiple offense detection for Style/For. (@pbernays)
  • #8801: Fix Layout/SpaceAroundEqualsInParameterDefault only registered once in a line. (@rdunlop)
  • #8514: Correct multiple Style/MethodDefParentheses per file. (@rdunlop)
  • #8825: Fix crash in Style/ExplicitBlockArgument when code is called outside of a method. (@ghiculescu)
  • #8718: Fix undefined methods of pseudo location. (@ybiquitous)
  • #8354: Detect regexp named captures in Style/CaseLikeIf cop. (@dsavochkin)
  • #8821: Fix an incorrect autocorrect for Style/NestedTernaryOperator when using a nested ternary operator expression with no parentheses on the outside. (@koic)
  • #8834: Fix a false positive for Style/ParenthesesAsGroupedExpression when method argument parentheses are omitted and hash argument key is enclosed in parentheses. (@koic)
  • #8830: Fix bad autocorrect of Style/StringConcatenation when string includes double quotes. (@tleish)
  • #8807: Fix a false positive for Style/RedundantCondition when using assignment by hash key access. (@koic)
  • #8848: Fix a false positive for Style/CombinableLoops when using the same method with different arguments. (@dvandersluis)
  • #8843: Fix an incorrect autocorrect for Lint/AmbiguousRegexpLiteral when sending method to regexp literal receiver. (@koic)
  • #8842: Save actual status to cache, except corrected. (@hatkyinc2)
  • #8835: Fix an incorrect autocorrect for Style/RedundantInterpolation when using string interpolation for non-operator methods. (@koic)
  • #7495: Example for Lint/AmbiguousBlockAssociation cop. (@AllanSiqueira)
  • #8855: Fix an error for Layout/EmptyLinesAroundAccessModifier and Style/AccessModifierDeclarations when using only access modifier. (@koic)

Changes

  • #8803: (Breaking) RegexpNode#parsed_tree now processes regexps including interpolation (by blanking the interpolation before parsing, rather than skipping). (@owst)
  • #8625: Improve Style/RedundantRegexpCharacterClass and Style/RedundantRegexpEscape by using regexp_parser gem. (@owst)
  • #8646: Faster find of all files in TargetFinder class which improves initial startup speed. (@tleish)
  • #8102: Consider class length instead of block length for Struct.new. (@tejasbubane)
  • #7408: Make Gemspec/RequiredRubyVersion cop aware of Gem::Requirement. (@tejasbubane)

0.92.0 (2020-09-25)

New features

Bug fixes

  • #8774: Fix a false positive for Layout/ArrayAlignment with parallel assignment. (@dvandersluis)

Changes

  • #8785: Update TargetRubyVersion 2.8 to 3.0 (experimental). (@koic)
  • #8650: Faster find of hidden files in TargetFinder class which improves rubocop initial startup speed. (@tleish)
  • #8783: Disable Style/ArrayCoercion cop by default. (@koic)

0.91.1 (2020-09-23)

Bug fixes

  • #8720: Fix an error for Lint/IdentityComparison when calling object_id method without receiver in LHS or RHS. (@koic)
  • #8767: Fix a false positive for Style/RedundantReturn when a rescue has an else clause. (@fatkodima)
  • #8710: Fix a false positive for Layout/RescueEnsureAlignment when Layout/BeginEndAlignment cop is not enabled status. (@koic)
  • #8726: Fix a false positive for Naming/VariableNumber when naming multibyte character variable name. (@koic)
  • #8730: Fix an error for Lint/UselessTimes when there is a blank line in the method definition. (@koic)
  • #8740: Fix a false positive for Style/HashAsLastArrayItem when the hash is in an implicit array. (@dvandersluis)
  • #8739: Fix an error for Lint/UselessTimes when using empty block argument. (@koic)
  • #8742: Fix some assignment counts for Metrics/AbcSize. (@marcandre)
  • #8750: Fix an incorrect auto-correct for Style/MultilineWhenThen when line break for multiple condidate values of when statement. (@koic)
  • #8754: Fix an error for Style/RandomWithOffset when using a range with non-integer bounds. (@eugeneius)
  • #8756: Fix an infinite loop error for Layout/EmptyLinesAroundAccessModifier with Layout/EmptyLinesAroundBlockBody when using access modifier with block argument. (@koic)
  • #8372: Fix Lint/RedundantCopEnableDirective autocorrection to not leave orphaned empty # rubocop:enable comments. (@dvandersluis)
  • #8372: Fix Lint/RedundantCopDisableDirective autocorrection. (@dvandersluis)
  • #8764: Fix Layout/CaseIndentation not showing the cop name in output messages. (@dvandersluis)
  • #8771: Fix an error for Style/OneLineConditional when using if-then-elsif-then-end. (@koic)
  • #8576: Fix Style/IfUnlessModifier to ignore cop disable comment directives when considering conversion to the modifier form. (@dsavochkin)

Changes

  • #8489: Exclude method respond_to_missing? from OptionalBooleanParameter cop. (@em-gazelle)
  • #7914: Style/SafeNavigation marked as having unsafe auto-correction. (@marcandre)
  • #8749: Disable Style/IpAddresses by default in Gemfile and gemspec files. (@dvandersluis)

0.91.0 (2020-09-15)

New features

  • New option --cache-root and support for the RUBOCOP_CACHE_ROOT environment variable. Both can be used to override the AllCops: CacheRootDirectory config, especially in a CI setting. (@sascha-wolf)
  • #8582: Add new Layout/BeginEndAlignment cop. (@koic)
  • #8699: Add new Lint/IdentityComparison cop. (@koic)
  • Add new Lint/UselessTimes cop. (@dvandersluis)
  • #8707: Add new Lint/ConstantDefinitionInBlock cop. (@eugeneius)

Bug fixes

  • #8627: Fix a false positive for Lint/DuplicateRequire when same feature argument but different require method. (@koic)
  • #8674: Fix an error for Layout/EmptyLineAfterMultilineCondition when conditional is at the top level. (@fatkodima)
  • #8658: Fix a false positive for Style/RedundantSelfAssignment when calling coercion methods. (@fatkodima)
  • #8669: Fix an offense creation for Lint/EmptyFile. (@fatkodima)
  • #8607: Fix a false positive for Lint/UnreachableLoop when conditional branch includes continue statement preceding break statement. (@fatkodima)
  • #8572: Fix a false positive for Style/RedundantParentheses when parentheses are used like method argument parentheses. (@koic)
  • #8630: Fix some false positives for Style/HashTransformKeys and Style/HashTransformValues when the receiver is an array. (@eugeneius)
  • #8653: Fix a false positive for Layout/DefEndAlignment when using refinements and private def. (@koic)
  • #8655: Fix a false positive for Style/ClassAndModuleChildren when using cbase class name. (@koic)
  • #8654: Fix a false positive for Style/SafeNavigation when checking foo&.empty? in a conditional. (@koic)
  • #8660: Fix a false positive for Style/ClassAndModuleChildren when using cbase module name. (@koic)
  • #8664: Fix a false positive for Naming/BinaryOperatorParameterName when naming multibyte character method name. (@koic)
  • #8604: Fix a false positive for Bundler/DuplicatedGem when gem is duplciated in condition. (@tejasbubane)
  • #8671: Fix an error for Style/ExplicitBlockArgument when using safe navigation method call. (@koic)
  • #8681: Fix an error for Style/HashAsLastArrayItem with no_braces for empty hash. (@fsateler)
  • #8682: Fix a positive for Style/HashTransformKeys and Style/HashTransformValues when the each_with_object hash is used in the transformed key or value. (@eugeneius)
  • #8688: Mark Style/GlobalStdStream as unsafe autocorrection. (@marcandre)
  • #8642: Fix a false negative for Style/SpaceInsideHashLiteralBraces when a correct empty hash precedes the incorrect hash. (@dvandersluis)
  • #8683: Make naming cops work with non-ascii characters. (@tejasbubane)
  • #8626: Fix false negatives for Lint/UselessMethodDefinition. (@marcandre)
  • #8698: Fix cache to avoid encoding exception. (@marcandre)
  • #8704: Fix an error for Lint/AmbiguousOperator when using safe navigation operator with a unary operator. (@koic)
  • #8661: Fix an incorrect auto-correct for Style/MultilineTernaryOperator when returning a multiline ternary operator expression. (@koic)
  • #8526: Fix a false positive for Style/CaseEquality cop when the receiver is not a camel cased constant. (@koic)
  • #8673: Fix the JSON parse error when specifying --format=json and --stdin options. (@koic)

Changes

  • #8470: Do not autocorrect Style/StringConcatenation when parts of the expression are too complex. (@dvandersluis)
  • #8561: Fix Lint/UselessMethodDefinition to not register an offense when method definition includes optional arguments. (@fatkodima)
  • #8617: Fix Style/HashAsLastArrayItem to not register an offense when all items in an array are hashes. (@dvandersluis)
  • #8500: Add in? to AllowedMethods for Lint/SafeNavigationChain cop. (@tejasbubane)
  • #8629: Fix the cache being reusable in CI by using crc32 to calculate file hashes rather than mtime, which changes each CI build. (@dvandersluis)
  • #8663: Fix multiple autocorrection bugs with Style/ClassMethodsDefinitions. (@dvandersluis)
  • #8621: Add helpful Infinite Loop error message. (@iSarCasm)

0.90.0 (2020-09-01)

New features

Bug fixes

  • #8508: Fix a false positive for Style/CaseLikeIf when conditional contains comparison with a class. Mark Style/CaseLikeIf as not safe. (@fatkodima)
  • #8618: Fix an infinite loop error for Layout/EmptyLineBetweenDefs. (@fatkodima)
  • #8534: Fix Lint/BinaryOperatorWithIdenticalOperands for binary operators used as unary operators. (@marcandre)
  • #8537: Allow a trailing comment as a description comment for Bundler/GemComment. (@pocke)
  • #8507: Fix Style/RescueModifier to handle parentheses around rescue modifiers. (@dsavochkin)
  • #8527: Prevent an incorrect auto-correction for Style/CaseEquality cop when comparing with === against a regular expression receiver. (@koic)
  • #8524: Fix Layout/EmptyLinesAroundClassBody and Layout/EmptyLinesAroundModuleBody to correctly handle an access modifier as a first child. (@dsavochkin)
  • #8518: Fix Lint/ConstantResolution cop reporting offense for module and class definitions. (@tejasbubane)
  • #8158: Fix Style/MultilineWhenThen cop to correctly handle cases with multiline body. (@dsavochkin)
  • #7705: Fix Style/OneLineConditional cop to handle if/then/elsif/then/else/end cases. Add AlwaysCorrectToMultiline config option to this cop to always convert offenses to the multi-line form (false by default). (@Lykos, @dsavochkin)
  • #8590: Fix an error when auto-correcting encoding mismatch file. (@koic)
  • #8321: Enable auto-correction for Layout/{Def}EndAlignment, Lint/EmptyEnsure, Style/ClassAndModuleChildren. (@marcandre)
  • #8583: Fix Style/RedundantRegexpEscape false positive for line continuations. (@owst)
  • #8593: Fix Style/RedundantRegexpCharacterClass false positive for interpolated multi-line expressions. (@owst)
  • #8624: Fix an error with the Style/CaseLikeIf cop where it does not properly handle overridden equality methods with no arguments. (@Skipants)

Changes

  • #8413: Pending cops warning now contains snippet that can be directly copied into .rubocop.yml as well as a notice about NewCops: enable config option. (@colszowka)
  • #8362: Add numbers of correctable offenses to summary. (@nguyenquangminh0711)
  • #8513: Clarify the ruby warning mentioned in the Lint/ShadowingOuterLocalVariable documentation. (@chocolateboy)
  • #8517: Make Style/HashTransformKeys and Style/HashTransformValues aware of to_h with block. (@eugeneius)
  • #8529: Mark Style/FrozenStringLiteralComment as Safe, but with unsafe auto-correction. (@marcandre)
  • #8602: Fix usage of to_enum(:scan, regexp) to work on TruffleRuby. (@jaimerave)

0.89.1 (2020-08-10)

Bug fixes

  • #8463: Fix false positives for Lint/OutOfRangeRegexpRef when a regexp is defined and matched in separate steps. (@eugeneius)
  • #8464: Handle regexps matched with when, grep, gsub, gsub!, sub, sub!, [], slice, slice!, scan, index, rindex, partition, rpartition, start_with?, and end_with? in Lint/OutOfRangeRegexpRef. (@eugeneius)
  • #8466: Fix a false positive for Lint/UriRegexp when using regexp method without receiver. (@koic)
  • #8478: Relax Lint/BinaryOperatorWithIdenticalOperands for mathematical operations. (@marcandre)
  • #8480: Tweak callback list of Lint/MissingSuper. (@marcandre)
  • #8481: Fix autocorrect for elements with newlines in Style/SymbolArray and Style/WordArray. (@biinari)
  • #8475: Fix a false positive for Style/HashAsLastArrayItem when there are duplicate hashes in the array. (@wcmonty)
  • #8497: Fix Style/IfUnlessModifier to add parentheses when converting if-end condition inside a parenthesized method argument list. (@dsavochkin)

Changes

  • #8487: Detect < and > as comparison operators in Style/ConditionalAssignment cop. (@biinari)

0.89.0 (2020-08-05)

New features

Bug fixes

  • #8346: Allow parentheses in single-line inheritance with Style/MethodCallWithArgsParentheses EnforcedStyle: omit_parentheses to fix invalid Ruby auto-correction. (@gsamokovarov)
  • #8324: Fix crash for Layout/SpaceAroundMethodCallOperator when using Proc#call shorthand syntax. (@fatkodima)
  • #8332: Fix auto-correct in Style/ConditionalAssignment to preserve constant namespace. (@biinari)
  • #8344: Fix crash for Style/CaseLikeIf when checking against equal? and match? without a receiver. (@fatkodima)
  • #8323: Fix a false positive for Style/HashAsLastArrayItem when hash is not a last array item. (@fatkodima)
  • #8299: Fix an incorrect auto-correct for Style/RedundantCondition when using raise, rescue, or and without argument parentheses in else. (@koic)
  • #8335: Fix incorrect character class detection for nested or POSIX bracket character classes in Style/RedundantRegexpEscape. (@owst)
  • #8347: Fix an incorrect auto-correct for EnforcedStyle: hash_rockets of Style/HashSyntax with Layout/HashAlignment. (@koic)
  • #8375: Fix an infinite loop error for Style/EmptyMethod. (@koic)
  • #8385: Remove auto-correction for Lint/EnsureReturn. (@marcandre)
  • #8391: Mark Style/ArrayCoercion as not safe. (@marcandre)
  • #8406: Improve Style/AccessorGrouping's auto-correction to remove redundant blank lines. (@koic)
  • #8330: Fix a false positive for Style/MissingRespondToMissing when defined method with inline access modifier. (@koic)
  • #8422: Fix an error for Lint/SelfAssignment when using or-assignment for constant. (@koic)
  • #8423: Fix an error for Style/SingleArgumentDig when without a receiver. (@koic)
  • #8424: Fix an error for Lint/IneffectiveAccessModifier when there is begin...end before a method definition. (@koic)
  • #8006: Fix line length calculation for Style/IfUnlessModifier to correctly take into account code before the if condition when considering conversation to a single-line form. (@dsavochkin)
  • #8283: Fix line length calculation for Style/IfUnlessModifier to correctly take into account a comment on the first line when considering conversation to a single-line form. (@dsavochkin)
  • #7957: Fix line length calculation for Style/IfUnlessModifier to correctly take into account code on the last line after the end keyword when considering conversion to a single-line form. (@dsavochkin)
  • #8226: Fix Style/IfUnlessModifier to add parentheses when converting if-end condition inside an array or a hash to a single-line form. (@dsavochkin)
  • #8443: Fix an incorrect auto-correct for Style/StructInheritance when there is a comment before class declaration. (@koic)
  • #8444: Fix an error for Layout/FirstMethodArgumentLineBreak when using kwargs in super. (@koic)
  • #8448: Fix Style/NestedParenthesizedCalls to include line continuations in whitespace for auto-correct. (@biinari)

Changes

  • #8376: Style/MethodMissingSuper cop is removed in favor of new Lint/MissingSuper cop. (@fatkodima)
  • #8433: Lint/UselessComparison cop is removed in favor of new Lint/BinaryOperatorWithIdenticalOperands cop. (@fatkodima)
  • #8350: Set default max line length to 120 for Style/MultilineMethodSignature. (@koic)
  • #8338: potentially breaking. Config#for_department now returns only the config specified for that department; the 'Enabled' attribute is no longer calculated. (@marcandre)
  • #8037: (Breaking) Cop Metrics/AbcSize now counts ||=, &&=, multiple assignments, for, yield, iterating blocks. &. now count as conditions too (unless repeated on the same variable). Default bumped from 15 to 17. Consider using rubocop -a --disable-uncorrectable to ease transition. (@marcandre)
  • #8276: Cop Metrics/CyclomaticComplexity not longer counts &. when repeated on the same variable. (@marcandre)
  • #8204: (Breaking) Cop Metrics/PerceivedComplexity now counts else in case statements, &., ||=, &&= and blocks known to iterate. Default bumped from 7 to 8. Consider using rubocop -a --disable-uncorrectable to ease transition. (@marcandre)
  • #8416: Cop Lint/InterpolationCheck marked as unsafe. (@marcandre)
  • #8442: Remove RuboCop::Cop::ParserDiagnostic mixin module. (@koic)

0.88.0 (2020-07-13)

New features

Bug fixes

  • #8232: Fix a false positive for Layout/EmptyLinesAroundAccessModifier when end immediately after access modifier. (@koic)
  • #7777: Fix crash for Layout/MultilineArrayBraceLayout when comment is present after last element. (@shekhar-patil)
  • #7776: Fix crash for Layout/MultilineMethodCallBraceLayout when comment is present before closing braces. (@shekhar-patil)
  • #8282: Fix Style/IfUnlessModifier bad precedence detection. (@tejasbubane)
  • #8289: Fix Style/AccessorGrouping to not register offense for accessor with comment. (@tejasbubane)
  • #8310: Handle major version requirements in Gemspec/RequiredRubyVersion. (@eugeneius)
  • #8315: Fix crash for Style/PercentLiteralDelimiters when the source contains invalid characters. (@eugeneius)
  • #8239: Don't load .rubocop.yml files at all outside of the current project, unless they are personal configuration files and the project has no configuration. (@deivid-rodriguez)

Changes

  • #8021: Rewrite Layout/SpaceAroundMethodCallOperator cop to make it faster. (@fatkodima)
  • #8294: Add of to AllowedNames of MethodParameterName cop. (@AlexWayfer)

0.87.1 (2020-07-07)

Bug fixes

  • #8189: Fix an error for Layout/MultilineBlockLayout where spaces for a new line where not considered. (@knejad)
  • #8252: Fix a command line option name from --safe-autocorrect to --safe-auto-correct, which is compatible with RuboCop 0.86 and lower. (@koic)
  • #8259: Fix false positives for Style/BisectedAttrAccessor when accessors have different access modifiers. (@fatkodima)
  • #8253: Fix false positives for Style/AccessorGrouping when accessors have different access modifiers. (@fatkodima)
  • #8257: Fix an error for Style/BisectedAttrAccessor when using attr_reader and attr_writer with splat arguments. (@fatkodima)
  • #8239: Don't load .rubocop.yml from personal folders to check for exclusions if given a custom configuration file. (@deivid-rodriguez)
  • #8256: Fix an error for --auto-gen-config when running a cop who do not support auto-correction. (@koic)
  • #8262: Fix Lint/DeprecatedOpenSSLConstant auto-correction of OpenSSL::Cipher to use lower case, as some Linux-based systems do not accept upper cased cipher names. (@bdewater)

0.87.0 (2020-07-06)

New features

  • #7868: Cop::Base is the new recommended base class for cops. (@marcandre)
  • #3983: Add new Style/AccessorGrouping cop. (@fatkodima)
  • #8244: Add new Style/BisectedAttrAccessor cop. (@fatkodima)
  • #7458: Add new AsciiConstants option for Naming/AsciiIdentifiers. (@fatkodima)
  • #7373: Add new Style/RedundantAssignment cop. (@fatkodima)
  • #8213: Permit to specify TargetRubyVersion 2.8 (experimental). (@koic)
  • #8159: Add new CountAsOne option for code length related Metric cops. (@fatkodima)
  • #8164: Support auto-correction for Lint/InterpolationCheck. (@koic)
  • #8223: Support auto-correction for Style/IfUnlessModifierOfIfUnless. (@koic)
  • #8172: Support auto-correction for Lint/SafeNavigationWithEmpty. (@koic)

Bug fixes

  • #8039: Fix false positives for Lint/ParenthesesAsGroupedExpression in when using operators or chain functions. (@CamilleDrapier)
  • #8196: Fix a false positive for Style/RedundantFetchBlock when using with Rails.cache. (@fatkodima)
  • #8195: Fix an error for Style/RedundantFetchBlock when using #fetch with empty block. (@koic)
  • #8193: Fix a false positive for Style/RedundantRegexpCharacterClass when using [\b]. (@owst)
  • #8205: Fix a false positive for Style/RedundantRegexpCharacterClass when using a leading escaped ]. (@owst)
  • #8208: Fix Style/RedundantParentheses with hash literal as first argument to yield. (@karlwithak)
  • #8176: Don't load .rubocop.yml from personal folders to check for exclusions if there's a project configuration. (@deivid-rodriguez)

Changes

  • #7868: (Breaking) Extensive refactoring of internal classes Team, Commissioner, Corrector. Cop::Cop#corrections not completely compatible. See Upgrade Notes. (@marcandre)
  • #8156: (Breaking) rubocop -a / --autocorrect no longer run unsafe corrections; rubocop -A / --autocorrect-all run both safe and unsafe corrections. Options --safe-autocorrect is deprecated. (@marcandre)
  • #8207: (Breaking) Order for gems names now disregards underscores and dashes unless ConsiderPunctuation setting is set to true. (@marcandre)
  • #8211: Style/ClassVars cop now detects class_variable_set. (@biinari)
  • #8245: Detect top-level constants like ::Const in various cops. (@biinari)

0.86.0 (2020-06-22)

New features

  • #8147: Add new Style/RedundantFetchBlock cop. (@fatkodima)
  • #8111: Add auto-correct for Style/StructInheritance. (@tejasbubane)
  • #8113: Let expect_offense templates add variable-length whitespace with _{foo}. (@eugeneius)
  • #8148: Support auto-correction for Style/MultilineTernaryOperator. (@koic)
  • #8151: Support auto-correction for Style/NestedTernaryOperator. (@koic)
  • #8142: Add Lint/ConstantResolution cop. (@robotdana)
  • #8170: Support auto-correction for Lint/RegexpAsCondition. (@koic)
  • #8169: Support auto-correction for Lint/RaiseException. (@koic)

Bug fixes

  • #8132: Fix the problem with Naming/MethodName: EnforcedStyle: camelCase and _ or i variables. (@avrusanov)
  • #8115: Fix false negative for Lint::FormatParameterMismatch when argument contains formatting. (@andrykonchin)
  • #8131: Fix false positive for Style/RedundantRegexpEscape with escaped delimiters. (@owst)
  • #8124: Fix a false positive for Lint/FormatParameterMismatch when using named parameters with escaped %. (@koic)
  • #7979: Fix "uninitialized constant DidYouMean::SpellChecker" exception. (@bquorning)
  • #8098: Fix a false positive for Style/RedundantRegexpCharacterClass when using interpolations. (@owst)
  • #8150: Fix a false positive for Layout/EmptyLinesAroundAttributeAccessor when using attribute accessors in if ... else branches. (@koic)
  • #8179: Fix an infinite correction loop error for Layout/MultilineBlockLayout when missing newline before opening parenthesis ( for block body. (@koic)
  • #8185: Fix a false positive for Style/YodaCondition when interpolation is used on the left hand side. (@koic)

Changes

  • #8149: (Breaking) Cop Metrics/CyclomaticComplexity now counts &., ||=, &&= and blocks known to iterate. Default bumped from 6 to 7. Consider using rubocop -a --disable-uncorrectable to ease transition. (@marcandre)
  • #8146: Use UTC in RuboCop todo file generation. (@mauro-oto)
  • #8178: Mark unsafe for Lint/RaiseException. (@koic)

0.85.1 (2020-06-07)

Bug fixes

  • #8083: Fix an error for Lint/MixedRegexpCaptureTypes cop when using a regular expression that cannot be processed by regexp_parser gem. (@koic)
  • #8081: Fix a false positive for Lint/SuppressedException when empty rescue block in do block. (@koic)
  • #8096: Fix a false positive for Lint/SuppressedException when empty rescue block in defs. (@koic)
  • #8108: Fix infinite loop in Layout/HeredocIndentation auto-correct. (@jonas054)
  • #8042: Fix raising error in Lint::FormatParameterMismatch when it handles invalid format strings and add new offense. (@andrykonchin)

0.85.0 (2020-06-01)

New features

  • #6289: Add new CheckDefinitionPathHierarchy option for Naming/FileName. (@jschneid)
  • #8055: Add new Style/RedundantRegexpCharacterClass cop. (@owst)
  • #8069: New option for expect_offense to help format offense templates. (@marcandre)
  • #7908: Add new Style/RedundantRegexpEscape cop. (@owst)
  • #7978: Add new option OnlyFor to the Bundler/GemComment cop. (@ric2b)
  • #8063: Add new AllowedNames option for Naming/ClassAndModuleCamelCase. (@tejasbubane)
  • #8050: New option --display-only-failed that can be used with --format junit. Speeds up test report processing for large codebases and helps address the sorts of concerns raised at mikian/rubocop-junit-formatter #18. (@burnettk)
  • #7746: Add new Lint/MixedRegexpCaptureTypes cop. (@pocke)

Bug fixes

  • #8008: Fix an error for Lint/SuppressedException when empty rescue block in def. (@koic)
  • #8012: Fix an incorrect auto-correct for Lint/DeprecatedOpenSSLConstant when deprecated OpenSSL constant is used in a block. (@koic)
  • #8017: Fix a false positive for Lint/SuppressedException when empty rescue with comment in def. (@koic)
  • #7990: Fix resolving inherit_gem in remote configs. (@CvX)
  • #8035: Fix a false positive for Lint/DeprecatedOpenSSLConstant when using double quoted string argument. (@koic)
  • #7971: Fix an issue where --disable-uncorrectable would not update uncorrected code with rubocop:todo. (@rrosenblum)
  • #8035: Fix a false positive for Lint/DeprecatedOpenSSLConstant when argument is a variable, method, or consntant. (@koic)

Changes

  • #8056: (Breaking) Remove support for unindent/active_support/powerpack from Layout/HeredocIndentation, so it only recommends using squiggy heredoc. (@bquorning)

0.84.0 (2020-05-21)

New features

  • #7735: NodePattern and AST classes have been moved to the rubocop-ast gem. (@marcandre)
  • #7950: Add new Lint/DeprecatedOpenSSLConstant cop. (@bdewater)
  • #7976: Add AllowAliasSyntax and AllowedMethods options for Layout/EmptyLinesAroundAttributeAccessor. (@koic)
  • #7984: New rake task "check_commit" will run rspec and rubocop on files touched by the last commit. Currently available when developing from the main repository only. (@marcandre)

Bug fixes

  • #7953: Fix an error for Lint/AmbiguousOperator when a method with no arguments is used in advance. (@koic)
  • #7962: Fix a false positive for Lint/ParenthesesAsGroupedExpression when heredoc has a space between the same string as the method name and (. (@koic)
  • #7967: Style/SlicingWithRange cop now supports any expression as its first index. (@zverok)
  • #7972: Fix an incorrect autocrrect for Style/HashSyntax when using a return value uses return. (@koic)
  • #7886: Fix a bug in AllowComments logic in Lint/SuppressedException. (@jonas054)
  • #7991: Fix an error for Layout/EmptyLinesAroundAttributeAccessor when attribute method is method chained. (@koic)
  • #7993: Fix a false positive for Migration/DepartmentName when a disable comment contains an unexpected character for department name. (@koic)
  • #7983: Make the config loader Bundler-aware. (@CvX)

Changes

  • #7952: (Breaking) Change the max line length of Layout/LineLength to 120 by default. (@koic)
  • #7959: Change enforced style to conditionals for Style/AndOr. (@koic)
  • #7985: Add EnforcedStyle for Style/DoubleNegation cop and allow double nagation in contexts that use boolean as a return value. (@koic)

0.83.0 (2020-05-11)

New features

  • #7951: Include rakefile file by default. (@jethrodaniel)
  • #7921: Add new Style/SlicingWithRange cop. (@zverok)
  • #7895: Include .simplecov file by default. (@robotdana)
  • #7916: Support auto-correction for Lint/AmbiguousRegexpLiteral. (@koic)
  • #7917: Support auto-correction for Lint/UselessAccessModifier. (@koic)
  • #595: Add ERB pre-processing for configuration files. (@jonas054)
  • #7918: Support auto-correction for Lint/AmbiguousOperator. (@koic)
  • #7937: Support auto-correction for Style/IfWithSemicolon. (@koic)
  • #3696: Add AllowComments option to Lint/EmptyWhen cop. (@koic)
  • #7910: Support auto-correction for Lint/ParenthesesAsGroupedExpression. (@koic)
  • #7925: Support auto-correction for Layout/ConditionPosition. (@koic)
  • #7934: Support auto-correction for Lint/EnsureReturn. (@koic)
  • #7922: Add new Layout/EmptyLineAroundAttributeAccessor cop. (@koic)

Bug fixes

  • #7929: Fix Style/FrozenStringLiteralComment to accept frozen_string_literal anywhere in leading comment lines. (@jeffcarbs)
  • #7882: Fix Style/CaseEquality when AllowOnConstant is true and the method receiver is implicit. (@rafaelfranca)
  • #7790: Fix --parallel and --ignore-parent-exclusion combination. (@jonas054)
  • #7881: Fix --parallel and --force-default-config combination. (@jonas054)
  • #7635: Fix a false positive for Style/MultilineWhenThen when then required for a body of when is used. (@koic)
  • #7905: Fix an error when running rubocop --only or rubocop --except options without cop name argument. (@koic)
  • #7903: Fix an incorrect auto-correct for Style/HashTransformKeys and Style/HashTransformValues cops when line break before to_h method. (@diogoosorio, @koic)
  • #7899: Fix an infinite loop error for Layout/SpaceAroundOperators with Layout/ExtraSpacing when using ForceEqualSignAlignment: true. (@koic)
  • #7885: Fix Style/IfUnlessModifier logic when tabs are used for indentation. (@jonas054)
  • #7909: Fix a false positive for Lint/ParenthesesAsGroupedExpression when using an intended grouped parentheses. (@koic)
  • #7913: Fix a false positive for Lint/LiteralAsCondition when using true literal in while and similar cases. (@koic)
  • #7928: Fix a false message for Style/GuardClause when using and or or operators for guard clause in then or else branches. (@koic)
  • #7928: Fix a false positive for Style/GuardClause when assigning the result of a guard condition with else. (@koic)

Changes

  • #7860: Change AllowInHeredoc option of Layout/TrailingWhitespace to true by default. (@koic)
  • #7094: Clarify alignment in Layout/MultilineOperationIndentation. (@jonas054)
  • #4245: (Breaking) Inspect all files given on command line unless --only-recognized-file-types is given. (@jonas054)
  • #7390: (Breaking) Enabling a cop overrides disabling its department. (@jonas054)
  • #7936: Mark Lint/BooleanSymbol as unsafe. (@laurmurclar)
  • #7948: Mark unsafe for Style/OptionalArguments. (@koic)
  • #7931: Remove dependency on the jaro_winkler gem, instead depending on did_you_mean. This may be a breaking change for RuboCop libraries calling NameSimilarity#find_similar_name. (@bquorning)

0.82.0 (2020-04-16)

New features

Bug fixes

  • #7871: Fix an auto-correction bug in Lint/BooleanSymbol. (@knu)
  • #7842: Fix a false positive for Lint/RaiseException when raising Exception with explicit namespace. (@koic)
  • #7834: Fix Lint/UriRegexp to register offense with array arguments. (@tejasbubane)
  • #7841: Fix an error for Style/TrailingCommaInBlockArgs when lambda literal (->) has multiple arguments. (@koic)
  • #7842: Fix a false positive for Lint/RaiseException when Exception without cbase specified under the namespace Gem by adding AllowedImplicitNamespaces option. (@koic)
  • Style/IfUnlessModifier does not infinite-loop when auto-correcting long lines which use if/unless modifiers and have multiple statements separated by semicolons. (@alexdowad)
  • rubocop/rubocop-rails#127: Use ConfigLoader.default_configuration for the default config. (@hanachin)

Changes

  • #7867: (Breaking) Renamed Layout/Tab cop to Layout/IndentationStyle. (@DracoAter)
  • #7869: (Breaking) Drop support for Ruby 2.3. (@koic)

0.81.0 (2020-04-01)

New features

  • #7299: Add new Lint/RaiseException cop. (@denys281)
  • #7793: Prefer include? over member? in Style/CollectionMethods. (@dmolesUC)
  • #7654: Support with_fixed_indentation option for Layout/ArrayAlignment cop. (@nikitasakov)
  • #7783: Support Ruby 2.7's numbered parameter for Style/RedundantSort. (@koic)
  • #7795: Make Layout/EmptyLineAfterGuardClause aware of case where and or or is used before keyword that break control (e.g. and return). (@koic)
  • #7786: Support Ruby 2.7's pattern match for Layout/ElseAlignment cop. (@koic)
  • #7784: Support Ruby 2.7's numbered parameter for Lint/SafeNavigationChain. (@koic)
  • #7331: Add forbidden option to Style/ModuleFunction cop. (@weh)
  • #7699: Add new Lint/StructNewOverride cop. (@ybiquitous)
  • #7637: Add new Style/TrailingCommaInBlockArgs cop. (@pawptart)
  • #7809: Add auto-correction for Style/EndBlock cop. (@tejasbubane)
  • #7739: Add IgnoreNotImplementedMethods configuration to Lint/UnusedMethodArgument. (@tejasbubane)
  • #7740: Add AllowModifiersOnSymbols configuration to Style/AccessModifierDeclarations. (@tejasbubane)
  • #7812: Add auto-correction for Lint/BooleanSymbol cop. (@tejasbubane)
  • #7823: Add IgnoredMethods configuration in Metrics/AbcSize, Metrics/CyclomaticComplexity, and Metrics/PerceivedComplexity cops. (@drenmi)
  • #7816: Support Ruby 2.7's numbered parameter for Style/Lambda. (@koic)
  • #7829: Fix an error for Style/OneLineConditional when one of the branches contains next keyword. (@koic)

Bug fixes

  • #7236: Mark Style/InverseMethods auto-correct as incompatible with Style/SymbolProc. (@drenmi)
  • #7144: Fix Style/Documentation constant visibility declaration in namespace. (@AdrienSldy)
  • #7779: Fix a false positive for Style/MultilineMethodCallIndentation when using Ruby 2.7's numbered parameter. (@koic)
  • #7733: Fix rubocop-junit-formatter imcompatibility XML for JUnit formatter. (@koic)
  • #7767: Skip array literals in Style/HashTransformValues and Style/HashTransformKeys. (@tejasbubane)
  • #7791: Fix an error on auto-correction for Layout/BlockEndNewline when } of multiline block without processing is not on its own line. (@koic)
  • #7778: Fix a false positive for Layout/EndAlignment when a non-whitespace is used before the end keyword. (@koic)
  • #7806: Fix an error for Lint/ErbNewArguments cop when inspecting ActionView::Template::Handlers::ERB.new. (@koic)
  • #7814: Fix a false positive for Migrate/DepartmentName cop when inspecting an unexpected disabled comment format. (@koic)
  • #7728: Fix an error for Style/OneLineConditional when one of the branches contains a self keyword. (@koic)
  • #7825: Fix crash for Layout/MultilineMethodCallIndentation with key access to hash. (@tejasbubane)
  • #7831: Fix a false positive for Style/HashEachMethods when receiver is implicit. (@koic)

Changes

  • #7797: Allow unicode-display_width dependency version 1.7.0. (@yuritomanek)
  • #7805: Change AllowComments option of Lint/SuppressedException to true by default. (@koic)
  • #7320: Naming/MethodName now flags attr_reader/attr_writer/attr_accessor/attr. (@denys281)
  • #7813: (Breaking) Remove Lint/EndInMethod cop. (@tejasbubane)

0.80.1 (2020-02-29)

Bug fixes

  • #7719: Fix Style/NestedParenthesizedCalls cop for newline. (@tejasbubane)
  • #7709: Fix correction of Style/RedundantCondition when the else branch contains a range. (@rrosenblum)
  • #7682: Fix Style/InverseMethods autofix leaving parenthesis. (@tejasbubane)
  • #7745: Suppress a pending cop warnings when pending cop's department is disabled. (@koic)
  • #7759: Fix an error for Layout/LineLength cop when using lambda syntax that argument is not enclosed in parentheses. (@koic)

Changes

  • #7765: When warning about a pending cop, display the version with the cop added. (@koic)

0.80.0 (2020-02-18)

New features

  • #7693: NodePattern: Add ` for descendant search. (@marcandre)
  • #7577: Add AllowGemfileRubyComment configuration on Layout/LeadingCommentSpace. (@cetinajero)
  • #7663: Add new Style/HashTransformKeys and Style/HashTransformValues cops. (@djudd, @eugeneius)
  • #7619: Support auto-correct of legacy cop names for Migration/DepartmentName. (@koic)
  • #7659: Layout/LineLength auto-correct now breaks up long lines with blocks. (@maxh)
  • #7677: Add new Style/HashEachMethods cop for Hash#each_key and Hash#each_value. (@jemmaissroff)
  • Add BracesRequiredMethods parameter to Style/BlockDelimiters to require braces for specific methods such as Sorbet's sig. (@maxh)
  • #7686: Add new JUnitFormatter formatter based on rubocop-junit-formatter gem. (@koic)
  • #7715: Add Steepfile to default Include list. (@ybiquitous)

Bug fixes

  • #7644: Fix patterns with named wildcards in unions. (@marcandre)
  • #7639: Fix logical operator edge case in omit_parentheses style of Style/MethodCallWithArgsParentheses. (@gsamokovarov)
  • #7661: Fix to return correct info from multi-line regexp. (@Tietew)
  • #7655: Fix an error when processing a regexp with a line break at the start of capture parenthesis. (@koic)
  • #7647: Fix an undefined method on_numblock error when using Ruby 2.7's numbered parameters. (@hanachin)
  • #7675: Fix a false negative for Layout/SpaceBeforeFirstArg when a vertical argument positions are aligned. (@koic)
  • #7688: Fix a bug in Style/MethodCallWithArgsParentheses that made --auto-gen-config crash. (@buehmann)
  • #7203: Fix an infinite loop error for Style/TernaryParentheses with Style/RedundantParentheses when using EnforcedStyle: require_parentheses_when_complex. (@koic)
  • #7708: Make it possible to use EOL rubocop:disable comments on comment lines. (@jonas054)
  • #7712: Fix an incorrect auto-correct for Style/OrAssignment when using elsif branch. (@koic)

Changes

  • #7636: Remove console from Lint/Debugger to prevent false positives. (@gsamokovarov)
  • #7641: (Breaking) Remove Style/BracesAroundHashParameters cop. (@pocke)
  • Add the method name to highlight area of Layout/EmptyLineBetweenDefs to help provide more context. (@rrosenblum)
  • #7652: Allow pp to allowed names of Naming/MethodParameterName cop in default config. (@masarakki)
  • #7309: Mark Lint/UselessSetterCall an "not safe" and improve documentation. (@jonas054)
  • #7723: Enable Migration/DepartmentName cop by default. (@koic)

0.79.0 (2020-01-06)

New features

Bug fixes

  • #7193: Prevent Style/PercentLiteralDelimiters from changing %i literals that contain escaped delimiters. (@buehmann)
  • #7590: Fix an error for Layout/SpaceBeforeBlockBraces when using with EnforcedStyle: line_count_based of Style/BlockDelimiters cop. (@koic)
  • #7569: Make Style/YodaCondition accept __FILE__ == $0. (@koic)
  • #7576: Fix an error for Gemspec/OrderedDependencies when using a local variable in an argument of dependent gem. (@koic)
  • #7595: Make Style/NumericPredicate aware of ignored methods when specifying ignored methods. (@koic)
  • #7607: Fix Style/FrozenStringLiteralComment infinite loop when magic comments are newline-separated. (@pirj)
  • #7602: Ensure proper handling of Ruby 2.7 syntax. (@drenmi)
  • #7620: Fix a false positive for Migration/DepartmentName when a disable comment contains a plain comment. (@koic)
  • #7616: Fix an incorrect auto-correct for Style/MultilineWhenThen for when statement with then is an array or a hash. (@koic)
  • #7628: Fix an incorrect auto-correct for Layout/MultilineBlockLayout removing trailing comma with single argument. (@pawptart)
  • #7627: Fix a false negative for Migration/DepartmentName when there is space around : (e.g. # rubocop : disable). (@koic)

Changes

  • #7287: Style/FrozenStringLiteralComment is now considered unsafe. (@buehmann)

0.78.0 (2019-12-18)

New features

  • #7528: Add new Lint/NonDeterministicRequireOrder cop. (@mangara)
  • #7559: Add EnforcedStyleForExponentOperator parameter to Layout/SpaceAroundOperators cop. (@khiav223577)

Bug fixes

  • #7530: Typo in Style/TrivialAccessors's AllowedMethods. (@movermeyer)
  • #7532: Fix an error for Style/TrailingCommaInArguments when using an anonymous function with multiple line arguments with EnforcedStyleForMultiline: consistent_comma. (@koic)
  • #7534: Fix an incorrect auto-correct for Style/BlockDelimiters cop and Layout/SpaceBeforeBlockBraces cop with EnforcedStyle: no_space when using multiline braces. (@koic)
  • #7231: Fix the exit code to be 2 rather when 0 when the config file contains an unknown cop. (@jethroo)
  • #7513: Fix abrupt error on auto-correcting with --disable-uncorrectable. (@tejasbubane)
  • #7537: Fix a false positive for Layout/SpaceAroundOperators when using a Rational literal with / (e.g. 2/3r). (@koic)
  • #7029: Make Style/Attr not flag offense for custom attr method. (@tejasbubane)
  • #7574: Fix a corner case that made Style/GuardClause crash. (@buehmann)

Changes

  • #7514: Expose correctable status on offense and in formatters. (@tyler-ball)
  • #7542: (Breaking) Move LineLength cop from Metrics department to Layout department. (@koic)

0.77.0 (2019-11-27)

Bug fixes

  • #7493: Fix Style/RedundantReturn to inspect conditional constructs that are preceded by other statements. (@buehmann)
  • #7509: Fix Layout/SpaceInsideArrayLiteralBrackets to correct empty lines. (@ayacai115)
  • #7517: Style/SpaceAroundKeyword allows :: after super. (@ozydingo)
  • #7515: Fix a false negative for Style/RedundantParentheses when calling a method with safe navigation operator. (@koic)
  • #7477: Fix line length auto-correct for semicolons in string literals. (@maxh)
  • #7522: Fix a false-positive edge case (n % 2 == 2) for Style/EvenOdd. (@buehmann)
  • #7506: Make Style/IfUnlessModifier respect all settings in Metrics/LineLength. (@jonas054)

Changes

  • #7077: (Breaking) Further standardisation of cop names. (@scottmatthewman)
  • #7469: (Breaking) Replace usages of the terms Whitelist and Blacklist with better alternatives. (@koic)
  • #7502: Remove SafeMode module. (@koic)

0.76.0 (2019-10-28)

Bug fixes

  • #7439: Make Style/FormatStringToken ignore percent escapes (%%). (@buehmann)
  • #7438: Fix assignment edge-cases in Layout/MultilineAssignmentLayout. (@gsamokovarov)
  • #7449: Make Style/IfUnlessModifier respect rubocop:disable comments for Metrics/LineLength. (@jonas054)
  • #7442: Fix an incorrect auto-correct for Style/SafeNavigation when an object check followed by a method call with a comment at EOL. (@koic)
  • #7434: Fix an incorrect auto-correct for Style/MultilineWhenThen when the body of when branch starts with then. (@koic)
  • #7464: Let Performance/StartWith and Performance/EndWith correct regexes that contain forward slashes. (@eugeneius)

Changes

  • #7465: Add os to allowed names of Naming/UncommunicativeMethodParamName cop in default config. (@nijikon)
  • #7446: Add merge to list of non-mutating methods. (@cstyles)
  • #7077: (Breaking) Rename Unneeded* cops to Redundant* (e.g., Style/UnneededPercentQ becomes Style/RedundantPercentQ). (@scottmatthewman)
  • #7396: Display assignments, branches, and conditions values with the offense. (@avmnu-sng)

0.75.1 (2019-10-14)

Bug fixes

  • #7391: Support pacman formatter on Windows. (@laurenball)
  • #7407: Make Style/FormatStringToken work inside hashes. (@buehmann)
  • #7389: Fix an issue where passing a formatter might result in an error depending on what character it started with. (@jfhinchcliffe)
  • #7397: Fix extra comments being added to the correction of Style/SafeNavigation. (@rrosenblum)
  • #7378: Fix heredoc edge cases in Layout/EmptyLineAfterGuardClause. (@gsamokovarov)
  • #7404: Fix a false negative for Layout/IndentAssignment when multiple assignment with line breaks on each line. (@koic)

Changes

  • #7410: Style/FormatStringToken now finds unannotated format sequences in printf arguments. (@buehmann)
  • #6964: Set default IgnoreCopDirectives to true for Metrics/LineLength. (@jdkaplan)

0.75.0 (2019-09-30)

New features

  • #7274: Add new Lint/SendWithMixinArgument cop. (@koic)
  • #7272: Show warning message if passed string to Enabled, Safe, SafeAuto-Correct, and Auto-Correct keys in .rubocop.yml. (@unasuke)
  • #7295: Make it possible to set StyleGuideBaseURL per department. (@koic)
  • #7301: Add check for calls to remote_byebug to Lint/Debugger cop. (@riley-klingler)
  • #7321: Allow YAML aliases in .rubocop.yml. (@raymondfallon)
  • #7317: Add new formatter pacman. (@crojasaragonez)
  • #6075: Support IgnoredPatterns option for Naming/MethodName cop. (@koic)
  • #7335: Add todo as an alias to disable. --disable-uncorrectable will now disable cops using rubocop:todo instead of rubocop:disable. (@desheikh)

Bug fixes

  • #7391: Support pacman formatter on Windows. (@laurenball)
  • #7256: Fix an error of Style/RedundantParentheses on method calls where the first argument begins with a hash literal. (@halfwhole)
  • #7263: Make Layout/SpaceInsideArrayLiteralBrackets properly handle tab-indented arrays. (@buehmann)
  • #7252: Prevent infinite loops by making Layout/SpaceInsideStringInterpolation skip over interpolations that start or end with a line break. (@buehmann)
  • #7262: Lint/FormatParameterMismatch did not recognize named format sequences like %.2<name>f where the name appears after some modifiers. (@buehmann)
  • #7253: Fix an error for Lint/NumberConversion when #to_i called without a receiver. (@koic)
  • #7271, #6498: Fix an interference between Style/TrailingCommaIn*Literal and Layout/Multiline*BraceLayout for arrays and hashes. (@buehmann)
  • #7241: Make Style/FrozenStringLiteralComment match only true & false. (@tejasbubane)
  • #7290: Handle inner conditional inside else in Style/ConditionalAssignment. (@jonas054)
  • #5788: Allow block arguments on separate lines if line would be too long in Layout/MultilineBlockLayout. (@jonas054)
  • #7305: Register Style/BlockDelimiters offense when block result is assigned to an attribute. (@mvz)
  • #4802: Don't leave any Lint/UnneededCopEnableDirective offenses undetected/uncorrected. (@jonas054)
  • #7326: Fix a false positive for Style/AccessModifierDeclarations when access modifier name is used for hash literal value. (@koic)
  • #3591: Handle modifier if/unless correctly in Lint/UselessAssignment. (@jonas054)
  • #7161: Fix Style/SafeNavigation cop for preserve comments inside if expression. (@tejasbubane)
  • #5212: Avoid false positive for braces that are needed to preserve semantics in Style/BracesAroundHashParameters. (@jonas054)
  • #7353: Fix a false positive for Style/RedundantSelf when receiver and multiple assigned lvalue have the same name. (@koic)
  • #7353: Fix a false positive for Style/RedundantSelf when a self receiver is used as a method argument. (@koic)
  • #7358: Fix an incorrect auto-correct for Style/NestedModifier when parentheses are required in method arguments. (@koic)
  • #7361: Fix a false positive for Style/TernaryParentheses when only the closing parenthesis is used in the last line of condition. (@koic)
  • #7369: Fix an infinite loop error for Layout/IndentAssignment with Layout/IndentFirstArgument when using multiple assignment. (@koic)
  • #7177, #7370: When correcting alignment, do not insert spaces into string literals. (@buehmann)
  • #7367: Fix an error for Style/OrAssignment cop when then branch body is empty. (@koic)
  • #7363: Fix an incorrect auto-correct for Layout/SpaceInsideBlockBraces and Style/BlockDelimiters when using multiline empty braces. (@koic)
  • #7212: Fix a false positive for Layout/EmptyLinesAroundAccessModifier and UselessAccessModifier when using method with the same name as access modifier around a method definition. (@koic)

Changes

  • #7312: Mark Style/StringHashKeys as unsafe. (@prathamesh-sonpatki)
  • #7275: Make Style/VariableName aware argument names when invoking a method. (@koic)
  • #3534: Make Style/IfUnlessModifier report and auto-correct modifier lines that are too long. (@jonas054)
  • #7261: Style/FrozenStringLiteralComment no longer inserts an empty line after the comment. This is left to Layout/EmptyLineAfterMagicComment. (@buehmann)
  • #7091: Style/FormatStringToken now detects format sequences with flags and modifiers. (@buehmann)
  • #7319: Rename IgnoredMethodPatterns option to IgnoredPatterns option for Style/MethodCallWithArgsParentheses. (@koic)
  • #7345: Mark unsafe for Style/YodaCondition. (@koic)

0.74.0 (2019-07-31)

New features

  • #7219: Support auto-correct for Lint/ErbNewArguments. (@koic)

Bug fixes

  • #7217: Make Style/TrailingMethodEndStatement work on more than the first def. (@buehmann)
  • #7190: Support lower case drive letters on Windows. (@jonas054)
  • Fix the auto-correction of Lint/UnneededSplatExpansion when the splat expansion of Array.new with a block is assigned to a variable. (@rrosenblum)
  • #5628: Fix an error of Layout/SpaceInsideStringInterpolation on interpolations with multiple statements. (@buehmann)
  • #7128: Make Metrics/LineLength aware of shebang. (@koic)
  • #6861: Fix a false positive for Layout/IndentationWidth when using EnforcedStyle: outdent of Layout/AccessModifierIndentation. (@koic)
  • #7235: Fix an error where Style/ConditionalAssignment would swallow a nested if condition. (@buehmann)
  • #7242: Make Style/ConstantVisibility work on non-trivial class and module bodies. (@buehmann)

Changes

  • #5265: Improved Layout/ExtraSpacing cop to handle nested consecutive assignments. (@jfelchner)
  • #7215: Make it clear what's wrong in the message from Style/GuardClause. (@jonas054)
  • #7245: Make cops detect string interpolations in more contexts: inside of backticks, regular expressions, and symbols. (@buehmann)
  • Deprecate the SafeMode option. Users will need to upgrade rubocop-performance to 1.15.0+ before the SafeMode module is removed. (@rrosenblum)

0.73.0 (2019-07-16)

New features

Bug fixes

  • #7170: Fix a false positive for Layout/RescueEnsureAlignment when def line is preceded with private_class_method. (@tatsuyafw)
  • #7186: Fix a false positive for Style/MixinUsage when using inside multiline block and if condition is after include. (@koic)
  • #7099: Fix an error of Layout/RescueEnsureAlignment on assigned blocks. (@tatsuyafw)
  • #5088: Fix an error of Layout/MultilineMethodCallIndentation on method chains inside an argument. (@buehmann)
  • #4719: Make Layout/Tab detect tabs between string literals. (@buehmann)
  • #7203: Fix an infinite loop error for Layout/SpaceInsideBlockBraces when EnforcedStyle: no_space with SpaceBeforeBlockParameters: false are set in multiline block. (@koic)
  • #6653: Fix a bug where Layout/IndentHeredoc would remove empty lines when auto-correcting heredocs. (@buehmann)

Changes

  • #7181: Sort analyzed file alphabetically. (@pocke)
  • #7188: Include inspected file location in auto-correction error. (@pocke)

0.72.0 (2019-06-25)

New features

Bug fixes

  • #7121: Fix Style/TernaryParentheses cop to allow safe navigation operator without parentheses. (@timon)
  • #7063: Fix auto-correct in Style/TernaryParentheses cop. (@parkerfinch)
  • #7106: Fix an error for Lint/NumberConversion when #to_i called on a variable on a hash. (@koic)
  • #7107: Fix parentheses offence for numeric arguments with an operator in Style/MethodCallWithArgsParentheses. (@gsamokovarov)
  • #7119: Fix cache with non UTF-8 offense message. (@pocke)
  • #7118: Fix Style/WordArray with encoding: binary magic comment and non-ASCII string. (@pocke)
  • #7159: Fix an error for Lint/DuplicatedKey when using endless range. (@koic)
  • #7151: Fix Style/WordArray to also consider words containing hyphens. (@fwitzke)
  • #6893: Handle implicit rescue correctly in Naming/RescuedExceptionsVariableName. (@pocke, @anthony-robin)
  • #7165: Fix an auto-correct error for Style/ConditionalAssignment when without else branch'. (@koic)
  • #7171: Fix an error for Style/SafeNavigation when using unless nil? as a safeguarded'. (@koic)
  • #7130: Skip auto-correct in Style/FormatString if second argument to String#% is a variable. (@tejasbubane)
  • #7171: Fix an error for Style/SafeNavigation when using unless nil? as a safeguarded'. (@koic)

Changes

  • #5976: Remove Rails cops. (@koic)
  • #5976: Remove rubocop -R/--rails option. (@koic)
  • #7113: Rename EnforcedStyle: rails to EnabledStyle: indented_internal_methods for Layout/IndentationConsistency. (@koic)

0.71.0 (2019-05-30)

New features

  • #7084: Permit to specify TargetRubyVersion 2.7. (@koic)
  • #7092: Node patterns can now use *, + and ? for repetitions. (@marcandre)

Bug fixes

  • #7066: Fix Layout/AlignHash when mixed Hash styles are used. (@rmm5t)
  • #7073: Fix false positive in Naming/RescuedExceptionsVariableName cop. (@tejasbubane)
  • #7090: Fix Layout/EmptyLinesAroundBlockBody for multi-line method calls. (@eugeneius)
  • #6936: Fix Layout/MultilineMethodArgumentLineBreaks when bracket hash assignment on multiple lines. (@maxh)
  • Mark Layout/HeredocArgumentClosingParenthesis incompatible with Style/TrailingCommaInArguments. (@maxh)

Changes

0.70.0 (2019-05-21)

New features

  • #6649: Layout/AlignHash supports list of options. (@stoivo)
  • Add IgnoreMethodPatterns config option to Style/MethodCallWithArgsParentheses. (@tejasbubane)
  • #7059: Add EnforcedStyle to Layout/EmptyLinesAroundAccessModifier. (@koic)
  • #7052: Add AllowComments option to Lint/HandleExceptions. (@tejasbubane)

Bug fixes

  • #7013: Respect DisabledByDefault for custom cops. (@XrXr)
  • #7043: Prevent RDoc error when installing RuboCop 0.69.0 on Ubuntu. (@koic)
  • #7023: Auto-Correction for Lint/NumberConversion. (@Bhacaz)

Changes

0.69.0 (2019-05-13)

New features

  • Add support for subclassing using Class.new to Lint/InheritException. (@houli)
  • #6779: Add new cop Style/NegatedUnless that checks for unless with negative condition. (@tejasbubane)

Bug fixes

  • #6900: Fix Rails/TimeZone auto-correct Time.current to Time.zone.now. (@vfonic)
  • #6900: Fix Rails/TimeZone to prefer Time.zone.#{method} over other acceptable corrections. (@vfonic)
  • #7007: Fix Style/BlockDelimiters with braces_for_chaining style false positive, when chaining using safe navigation. (@Darhazer)
  • #6880: Fix .rubocop file parsing. (@hoshinotsuyoshi)
  • #5782: Do not auto-correct Lint/UnifiedInteger if TargetRubyVersion < 2.4. (@lavoiesl)
  • #6387: Prevent Lint/NumberConversion from reporting error with Time/DateTime. (@tejasbubane)
  • #6980: Fix Style/StringHashKeys to allow string as keys for hash arguments to gsub methods. (@tejasbubane)
  • #6969: Fix a false positive with block methods in Style/InverseMethods. (@dduugg)
  • #6729: Handle array spread for change_column_default in Rails/ReversibleMigration cop. (@tejasbubane)
  • #7033: Fix an error for Layout/EmptyLineAfterGuardClause when guard clause is a ternary operator. (@koic)
  • Replace Time.zone.current with Time.zone.today on Rails::Date cop message. (@vfonic)

Changes

  • #6945: Drop support for Ruby 2.2. (@koic)
  • #6945: Set default EnforcedStyle to squiggly option for Layout/IndentHeredoc and auto_detection option is removed. (@koic)
  • #6945: Set default EnforcedStyle to always option for Style/FrozenStringLiteralComment and when_needed option is removed. (@koic)
  • #7027: Allow unicode/display_width dependency version 1.6.0. (@tagliala)

0.68.1 (2019-04-30)

Bug fixes

  • #6993: Allowing for empty if blocks, preventing Style/SafeNavigation from crashing. (@RicardoTrindade)
  • #6995: Fix an incorrect auto-correct for Style/RedundantParentheses when enclosed in parentheses at while-post or until-post. (@koic)
  • #6996: Fix a false positive for Style/RedundantFreeze when freezing the result of String#*. (@bquorning)
  • #6998: Fix auto-correct of Naming/RescuedExceptionsVariableName to also rename all references to the variable. (@Darhazer)
  • #6992: Fix unknown default configuration for Layout/IndentFirstParameter cop. (@drenmi)
  • #6972: Fix a false positive for Style/MixinUsage when using inside block and if condition is after include. (@koic)
  • #6738: Prevent auto-correct conflict of Style/Next and Style/SafeNavigation. (@hoshinotsuyoshi)
  • #6847: Fix Style/BlockDelimiters to properly check if the node is chained when braces_for_chaining is set. (@att14)

0.68.0 (2019-04-29)

New features

  • #6973: Add always_braces to Style/BlockDelimiter. (@iGEL)
  • #6841: Node patterns can now match children in any order using <>. (@marcandre)
  • #6928: Add --init option for generate .rubocop.yml file in the current directory. (@koic)
  • Add new Layout/HeredocArgumentClosingParenthesis cop. (@maxh)
  • #6895: Add support for XDG config home for user-config. (@Mange, @tejasbubane)
  • Add initial auto-correction support to Metrics/LineLength. (@maxh)
  • Add Layout/IndentFirstParameter. (@maxh)
  • #6974: Make Layout/FirstMethodArgumentLineBreak aware of calling using super. (@koic)
  • Add new Lint/HeredocMethodCallPosition cop. (@maxh)

Bug fixes

  • Do not annotate message with cop name in JSON output. (@elebow)
  • #6914: Fix an error for Rails/RedundantAllowNil when with interpolations. (@Blue-Pix)
  • #6888: Fix an error for Rails/ActiveRecordOverride when no parent_class present. (@diachini)
  • #6941: Add missing absence validations to Rails/Validation. (@jmanian)
  • #6926: Allow nil values to unset config defaults. (@dduugg)
  • #6946: Allow Rails/ReflectionClassName to use string interpolation for class_name. (@r7kamura)
  • #6778: Fix a false positive in Style/HashSyntax cop when a hash key is an interpolated string and EnforcedStyle is ruby19_no_mixed_keys. (@tatsuyafw)
  • #6902: Fix a bug where Naming/RescuedExceptionsVariableName would handle an only first rescue for multiple rescue groups. (@tatsuyafw)
  • #6860: Prevent auto-correct conflict of Style/InverseMethods and Style/Not. (@hoshinotsuyoshi)
  • #6935: Layout/AccessModifierIndentation should ignore access modifiers that apply to specific methods. (@deivid-rodriguez)
  • #6956: Prevent auto-correct confliction of Lint/Lambda and Lint/UnusedBlockArgument. (@koic)
  • #6915: Fix false positive in Style/SafeNavigation when a modifier if is safe guarding a method call being passed to break, fail, next, raise, return, throw, and yield. (@rrosenblum)
  • #6822: Fix Lint/LiteralInInterpolation auto-correction for single quotes. (@hoshinotsuyoshi)
  • #6985: Fix an incorrect auto-correct for Lint/LiteralInInterpolation if contains array percent literal. (@yakout)
  • #7003: Fix an incorrect auto-correct for Style/InverseMethods when using BasicObject#!. (@koic)

Changes

  • #6966: Mark Rails/TimeZone as unsafe. (@vfonic)
  • #5977: Remove Performance cops. (@koic)
  • Add auto-correction to Naming/RescuedExceptionsVariableName. (@anthony-robin)
  • #6903: Handle variables prefixed with _ in Naming/RescuedExceptionsVariableName cop. (@anthony-robin)
  • #6917: Bump Bundler dependency to >= 1.15.0. (@koic)
  • Add --auto-gen-only-exclude to the command outputted in rubocop_todo.yml if the option is specified. (@dvandersluis)
  • #6887: Allow Lint/UnderscorePrefixedVariableName cop to be configured to allow use of block keyword args. (@dduugg)
  • #6885: Revert adding psych >= 3.1 as runtime dependency. (@andreaseger)
  • Rename Layout/FirstParameterIndentation to Layout/IndentFirstArgument. (@maxh)
  • Extract method call argument alignment behavior from Layout/AlignParameters into Layout/AlignArguments. (@maxh)
  • Rename IndentArray and IndentHash to IndentFirstArrayElement and IndentFirstHashElement. (@maxh)

0.67.2 (2019-04-05)

Bug fixes

  • #6882: Fix an error for Rails/RedundantAllowNil when not using both allow_nil and allow_blank. (@koic)

0.67.1 (2019-04-04)

Changes

  • #6881: Set default PreferredName to e for Naming/RescuedExceptionsVariableName. (@koic)

0.67.0 (2019-04-04)

New features

  • #5184: Add new multiline element line break cops. (@maxh)
  • Add new cop Rails/ActiveRecordOverride that checks for overriding Active Record methods instead of using callbacks. (@elebow)
  • Add new cop Rails/RedundantAllowNil that checks for cases when allow_blank makes allow_nil unnecessary in model validations. (@elebow)
  • Add new Naming/RescuedExceptionsVariableName cop. (@AdrienSldy)

Bug fixes

  • #6761: Make Naming/UncommunicativeMethodParamName account for param names prefixed with underscores. (@thomthom)
  • #6855: Fix an exception in Rails/RedundantReceiverInWithOptions when the body is empty. (@ericsullivan)
  • #6856: Fix auto-correction for Style/BlockComments when the file is missing a trailing blank line. (@ericsullivan)
  • #6858: Fix an incorrect auto-correct for Lint/ToJSON when there are no to_json arguments. (@koic)
  • #6865: Fix deactivated StyleGuideBaseURL for Layout/ClassStructure. (@aeroastro)
  • #6868: Fix Rails/LinkToBlank auto-correct bug when using symbol for target. (@r7kamura)
  • #6869: Fix false positive for Rails/LinkToBlank when rel is a symbol value. (@r7kamura)
  • Add IncludedMacros param to default rubocop config for Style/MethodCallWithArgsParentheses. (@maxh)
  • #6785: Do not register an offense for Rails/Present or Rails/Blank in an unless else context when Style/UnlessElse is enabled. (@rrosenblum)

Changes

  • #6854: Mark Rails/LexicallyScopedActionFilter as unsafe and document risks. (@urbanautomaton)
  • #5977: Warn for Performance Cops. (@koic)
  • #6637: Move LstripRstrip from Performance to Style department and rename it to Strip. (@anuja-joshi)
  • #6875: Mention block form of Struct.new in Style/StructInheritance. (@XrXr)
  • #6871: Move Performance/RedundantSortBy, Performance/UnneededSort and Performance/Sample to the Style department. (@bbatsov)

0.66.0 (2019-03-18)

New features

  • #6393: Add AllowBracesOnProceduralOneLiners option to fine-tune Style/BlockDelimiter's semantic mode. (@davearonson)
  • #6383: Add AllowBeforeTrailingComments option on Layout/ExtraSpacing cop. (@davearonson)
  • New cop Lint/SafeNavigationWithEmpty checks for foo&.empty? in conditionals. (@rspeicher)
  • Add new Style/ConstantVisibility cop for enforcing visibility declarations of class and module constants. (@drenmi)
  • #6378: Add Lint/ToJSON cop to enforce an argument when overriding #to_json. (@allcentury)
  • #6346: Add auto-correction to Rails/TimeZone. (@dcluna)
  • #6840: Node patterns now allow unlimited elements after .... (@marcandre)

Bug fixes

  • #4321: Fix false offense for Style/RedundantSelf when the method is also defined on Kernel. (@mikegee)
  • #6821: Fix false negative for Rails/LinkToBlank when _blank is a symbol. (@Intrepidd)
  • #6699: Fix infinite loop for Layout/IndentationWidth and Layout/IndentationConsistency when bad modifier indentation before good method definition. (@koic)
  • #6777: Fix a false positive for Style/TrivialAccessors when using trivial reader/writer methods at the top level. (@koic)
  • #6799: Fix errors for Style/ConditionalAssignment, Style/IdenticalConditionalBranches, Lint/ElseLayout, and Layout/IndentationWidth with empty braces. (@pocke)
  • #6802: Fix auto-correction for Style/SymbolArray with array contains interpolation when EnforcedStyle is brackets. (@pocke)
  • #6797: Fix false negative for Layout/SpaceAroundBlockParameters on block parameter with parens. (@pocke)
  • #6798: Fix infinite loop for Layout/SpaceAroundBlockParameters with EnforcedStyleInsidePipes: :space. (@pocke)
  • #6803: Fix error for Style/NumericLiterals on a literal that contains spaces. (@pocke)
  • #6801: Fix auto-correction for Style/Lambda with no-space argument. (@pocke)
  • #6804: Fix auto-correction of Style/NumericLiterals on numeric literal with exponent. (@pocke)
  • #6800: Fix an incorrect auto-correct for Rails/Validation when method arguments are enclosed in parentheses. (@koic)
  • #6808: Prevent false positive in Naming/ConstantName when assigning a frozen range. (@drenmi)
  • Fix the calculation of Metrics/AbcSize. Comparison methods and else branches add to the comparison count. (@rrosenblum)
  • #6791: Allow Rails/ReflectionClassName to use symbol argument for class_name. (@unasuke)
  • #5465: Fix Layout/ClassStructure to allow grouping macros by their visibility. (@gprado)
  • #6461: Restrict Ctrl-C handling to RuboCop's loop and simplify it to a single phase. (@deivid-rodriguez)

Changes

  • Add $stdout/$stderr and STDOUT/STDERR method calls to Rails/Output. (@elebow)
  • #6688: Add iterator? to deprecated methods and prefer block_given? instead. (@tejasbubane)
  • #6806: Remove powerpack dependency. (@dduugg)
  • #6810: Exclude gemspec file by default for Metrics/BlockLength cop. (@koic)
  • #6813: Allow unicode/display_width dependency version 1.5.0. (@tagliala)
  • Make Style/RedundantFreeze aware of methods that will produce frozen objects. (@rrosenblum)
  • #6675: Avoid printing deprecation warnings about constants. (@elmasantos)
  • #6746: Avoid offense on $stderr.puts with no arguments. (@luciamo)
  • Replace md5 with sha1 for FIPS compliance. (@dirtyharrycallahan)

0.65.0 (2019-02-19)

New features

  • #6126: Add an experimental strict mode to Style/MutableConstant that will freeze all constants, rather than just literals. (@rrosenblum)
  • Add IncludedMacros to Style/MethodCallWithArgsParentheses to allow including specific macros when IgnoreMacros is true. (@maxh)

Bug fixes

  • #6765: Fix false positives in keyword arguments for Style/MethodCallWithArgsParentheses omit_parentheses. (@gsamokovarov)
  • #6763: Fix false positives in range literals for Style/MethodCallWithArgsParentheses omit_parentheses. (@gsamokovarov)
  • #6748: Fix Style/RaiseArgs auto-correction breaking in contexts that require parentheses. (@drenmi)
  • #6751: Prevent Style/OneLineConditional from breaking on retry and break keywords. (@drenmi)
  • #6755: Prevent Style/TrailingCommaInArgument from breaking when a safe method call is chained on the offending method. (@drenmi, @hoshinotsuyoshi)

Changes

  • #6766: Drop support for Ruby 2.2.0 and 2.2.1. (@pocke)
  • #6733: Warn duplicated keys in .rubocop.yml. (@pocke)
  • #6613: Mark Style/ModuleFunction as SafeAuto-Correct: false and disable auto-correct by default. (@dduugg)

0.64.0 (2019-02-10)

New features

  • #6704: Add new Rails/ReflectionClassName cop. (@Bhacaz)
  • #6643: Support AllowParenthesesInCamelCaseMethod option on Style/MethodCallWithArgsParentheses omit_parentheses. (@dazuma)

Bug fixes

  • #6254: Fix Layout/RescueEnsureAlignment for non-local assignments. (@marcotc)
  • #6648: Fix auto-correction of Style/EmptyLiteral when Hash.new is passed as the first argument to super. (@rrosenblum)
  • #6351: Fix a false positive for Layout/ClosingParenthesisIndentation when first argument is multiline. (@antonzaytsev)
  • #6689: Support more complex argument patterns on Rails/Validation auto-correction. (@r7kamura)
  • #6668: Fix auto-correction for Style/UnneededCondition when conditional has the unless form. (@mvz)
  • #6382: Fix Layout/IndentationWidth with Layout/EndAlignment set to start_of_line. (@dischorde, @siegfault, @mhelmetag)
  • #6710: Fix Naming/MemoizedInstanceVariableName on method starts with underscore. (@pocke)
  • #6722: Fix an error for Style/OneLineConditional when then branch has no body. (@koic)
  • #6702: Fix TrailingComma regression where heredoc with commas caused false positives. (@abrom)
  • #6737: Fix an incorrect auto-correct for Rails/LinkToBlank when link_to method arguments are enclosed in parentheses. (@koic)
  • #6720: Fix detection of :native line ending for Layout/EndOfLine on JRuby. (@enkessler)

Changes

  • #6597: Style/LineEndConcatenation is now known to be unsafe for auto-correct. (@jaredbeck)
  • #6725: Mark Style/SymbolProc as unsafe for auto-correct. (@drenmi)
  • #6708: Make Style/CommentedKeyword allow the :yields: RDoc comment. (@bquorning)
  • #6749: Make some cops aware of safe navigation operator. (@hoshinotsuyoshi)

0.63.1 (2019-01-22)

Bug fixes

  • #6678: Fix Lint/DisjunctiveAssignmentInConstructor when it finds an empty constructor. (@rmm5t)
  • Do not attempt to auto-correct mass assignment or optional assignment in Rails/RelativeDateConstant. (@rrosenblum)
  • Fix auto-correction of Style/WordArray and Style/SymbolArray when all elements are on separate lines and there is a trailing comment after the closing bracket. (@rrosenblum)
  • Fix an exception that occurs when auto-correcting Layout/ClosingParenthesesIndentation when there are no arguments. (@rrosenblum)

0.63.0 (2019-01-16)

New features

Bug fixes

  • #6627: Fix handling of hashes in trailing comma. (@abrom)
  • #6638: Fix Rails/LinkToBlank dectection to allow rel: 'noreferer. (@fwininger)
  • #6623: Fix heredoc detection in trailing comma. (@palkan)
  • #6100: Fix a false positive in Naming/ConstantName cop when rhs is a conditional expression. (@tatsuyafw)
  • #6526: Fix a wrong line highlight in Lint/ShadowedException cop. (@tatsuyafw)
  • #6617: Prevent traversal error on infinite ranges. (@drenmi)
  • #6625: Revert the "auto-exclusion of files ignored by git" feature. (@bbatsov)
  • #4460: Fix the determination of unsafe auto-correct in Style/TernaryParentheses. (@jonas054)
  • #6651: Fix auto-correct issue in Style/RegexpLiteral cop when there is string interpolation. (@roooodcastro)
  • #6670: Fix a false positive for Style/SafeNavigation when a method call safeguarded with a negative check for the object. (@koic)
  • #6633: Fix Lint/SafeNavigation complaining about use of to_d. (@tejasbubane)
  • #6575: Fix Naming/PredicateName suggesting invalid rename. (@tejasbubane)
  • #6673: Fix Style/DocumentationMethod cop to recognize documentation comments for def inline with module_function. (@tejasbubane)
  • #6648: Fix auto-correction of Style/EmptyLiteral when Hash.new is passed as the first argument to super. (@rrosenblum)

Changes

  • #6607: Improve CLI usage message for --stdin option. (@jaredbeck)
  • #6641: Specify Performance/RangeInclude as unsafe because Range#include? and Range#cover? are not equivalent. (@koic)
  • #6636: Move FlipFlop cop from Style to Lint department because flip-flop is deprecated since Ruby 2.6.0. (@koic)
  • #6661: Abandon making frozen string literals default for Ruby 3.0. (@koic)

0.62.0 (2019-01-01)

New features

  • #6580: New cop Rails/LinkToBlank checks for link_to calls with target: '_blank' and no rel: 'noopener'. (@Intrepidd)
  • #6586: New cop Lint/DisjunctiveAssignmentInConstructor checks constructors for disjunctive assignments that should be plain assignments. (@jaredbeck)

Bug fixes

  • #6560: Consider file count, not offense count, for --exclude-limit in combination with --auto-gen-only-exclude. (@jonas054)
  • #4229: Fix unexpected Style/HashSyntax consistency offence. (@timon)
  • #6500: Add offense to use in_time_zone instead of deprecated to_time_in_current_zone. (@nadiyaka)
  • #6577: Prevent Rails/Blank cop from adding offense when define the blank method. (@jonatas)
  • #6554: Prevent Layout/RescueEnsureAlignment cop from breaking on block assignment when assignment is on a separate line. (@timmcanty)
  • #6343: Optimise --auto-gen-config when Metrics/LineLength cop is disabled. (@tom-lord)
  • #6389: Fix false negative for Style/TrailingCommaInHashLiteral/Style/TrailingCommaInArrayLiteral when there is a comment in the last line. (@bayandin)
  • #6566: Fix false positive for Layout/EmptyLinesAroundAccessModifier when at the end of specifying a superclass is missing blank line. (@koic)
  • #6571: Fix a false positive for Layout/TrailingCommaInArguments when a line break before a method call and EnforcedStyleForMultiline is set to consistent_comma. (@koic)
  • #6573: Make Layout/AccessModifierIndentation work for dynamic module or class definitions. (@deivid-rodriguez)
  • #6562: Fix a false positive for Style/MethodCallWithArgsParentheses omit_parentheses enforced style after safe navigation call. (@gsamokovarov)
  • #6570: Fix a false positive for Style/MethodCallWithArgsParentheses omit_parentheses enforced style while splatting the result of a method invocation. (@gsamokovarov)
  • #6598: Fix a false positive for Style/MethodCallWithArgsParentheses omit_parentheses enforced style for calls with regexp slash literals argument. (@gsamokovarov)
  • #6598: Fix a false positive for Style/MethodCallWithArgsParentheses omit_parentheses enforced style for default argument value calls. (@gsamokovarov)
  • #6598: Fix a false positive for Style/MethodCallWithArgsParentheses omit_parentheses enforced style for argument calls with braced blocks. (@gsamokovarov)
  • #6594: Fix a false positive for Rails/OutputSafety when the receiver is a non-interpolated string literal. (@amatsuda)
  • #6574: Fix Style/AccessModifierIndentation not handling arbitrary blocks. (@deivid-rodriguez)
  • #6370: Fix the enforcing style from extend self into module_function when there are private methods. (@Ruffeng)

Changes

  • #595: Exclude files ignored by git. (@AlexWayfer)
  • #6429: Fix auto-correct in Rails/Validation to not wrap hash options with braces in an extra set of braces. (@bquorning)
  • #6533: Improved warning message for unrecognized cop parameters to include Supported parameters. (@MagedMilad)

0.61.1 (2018-12-06)

Bug fixes

  • #6550: Prevent Layout/RescueEnsureAlignment cop from breaking on assigned begin-end. (@drenmi)

0.61.0 (2018-12-05)

New features

  • #6457: Support inner slash correction on Style/RegexpLiteral. (@r7kamura)
  • #6475: Support brace correction on Style/Lambda. (@r7kamura)
  • #6469: Enforce no parentheses style in the Style/MethodCallWithArgsParentheses cop. (@gsamokovarov)
  • New cop Performance/OpenStruct checks for OpenStruct.new calls. (@xlts)

Bug fixes

  • #6433: Fix Ruby 2.5 Layout/RescueEnsureAlignment error on assigned blocks. (@gmcgibbon)
  • #6405: Fix a false positive for Lint/UselessAssignment when using a variable in a module name. (@itsWill)
  • #5934: Handle the combination of --auto-gen-config and --config FILE correctly. (@jonas054)
  • #5970: Make running --auto-gen-config in a subdirectory work. (@jonas054)
  • #6412: Fix an unknown keywords error when using Psych.safe_load with Ruby 2.6.0-preview2. (@koic)
  • #6436: Fix exit status code to be 130 when rubocop is interrupted. (@deivid-rodriguez)
  • #6443: Fix an incorrect auto-correct for Style/BracesAroundHashParameters when the opening brace is before the first hash element at same line. (@koic)
  • #6445: Treat yield and super like regular method calls in Style/AlignHash. (@mvz)
  • #3301: Don't suggest or make semantic changes to the code in Style/InfiniteLoop. (@jonas054)
  • #3586: Handle single argument spanning multiple lines in Style/TrailingCommaInArguments. (@jonas054)
  • #6478: Fix EmacsComment#encoding to match the coding variable. (@akihiro17)
  • Don't show "unrecognized parameter" warning for inherit_mode parameter to individual cop configurations. (@maxh)
  • #6449: Fix a false negative for Layout/IndentationWidth when setting EnforcedStyle: rails of Layout/IndentationConsistency and method definition indented to access modifier in a singleton class. (@koic)
  • #6482: Fix a false positive for Lint/FormatParameterMismatch when using (digit)$ flag. (@koic)
  • #6489: Fix an error for Style/UnneededCondition when if condition and then branch are the same and it has no else branch. (@koic)
  • Fix NoMethodError for Style/FrozenStringLiteral when a file contains only a shebang. (@takaram)
  • #6511: Fix an incorrect auto-correct for Style/EmptyCaseCondition when used as an argument of a method. (@koic)
  • #6509: Fix an incorrect auto-correct for Style/RaiseArgs when an exception object is assigned to a local variable. (@koic)
  • #6534: Fix a false positive for Lint/UselessAccessModifier when using private_class_method. (@dduugg)
  • #6545: Fix a regression where Performance/RedundantMerge raises an error on a sole double splat argument passed to merge!. (@mmedal)
  • #6360: Detect bad indentation in if nodes even if the first branch is empty. (@bquorning)

Changes

  • #6492: Auto-correct chunks of comment lines in Layout/CommentIndentation to avoid unnecessary iterations for rubocop -a. (@jonas054)
  • Fix --auto-gen-config when individual cops have regexp literal exclude paths. (@maxh)

0.60.0 (2018-10-26)

New features

Bug fixes

  • #6330: Fix an error for Rails/ReversibleMigration when using variable assignment. (@koic, @scottmatthewman)
  • #6331: Fix a false positive for Style/RedundantFreeze and a false negative for Style/MutableConstant when assigning a regexp object to a constant. (@koic)
  • #6334: Fix a false negative for Style/RedundantFreeze when assigning a range object to a constant. (@koic)
  • #5538: Fix false negatives in modifier cops when line length cop is disabled. (@drenmi)
  • #6340: Fix an error for Rails/ReversibleMigration when block argument is empty. (@koic)
  • #6274: Fix "[Corrected]" message being displayed even when nothing has been corrected. (@jekuta)
  • #6380: Allow use of a hyphen-separated frozen string literal in Emacs style magic comment. (@y-yagi)
  • Fix and improve LineLength cop for tab-indented code. (@AlexWayfer)

Changes

  • #3727: Enforce single spaces for key option in Layout/AlignHash cop. (@albaer)
  • #6321: Fix run of RuboCop when cache directory is not writable. (@Kevinrob)

0.59.2 (2018-09-24)

New features

  • Update Style/MethodCallWithoutArgsParentheses to highlight the closing parentheses in additition to the opening parentheses. (@rrosenblum)

Bug fixes

  • #6266: Fix a false positive for Rails/HasManyOrHasOneDependent when using associations of Active Resource. (@tejasbubane, @koic)
  • #6296: Fix an auto-correct error for Style/For when setting EnforcedStyle: each and for dose not have do or semicolon. (@autopp)
  • #6300: Fix a false positive for Layout/EmptyLineAfterGuardClause when guard clause including heredoc. (@koic)
  • #6287: Fix AllowURI option for Metrics/LineLength cop with disabled Layut/Tab cop. (@AlexWayfer)
  • #5338: Move checking of class- and module defining blocks from Metrics/BlockLength into the respective length cops. (@drenmi)
  • #2841: Fix Style/ZeroLengthPredicate false positives when inspecting Tempfile, StringIO, and File::Stat objects. (@drenmi)
  • #6305: Fix infinite loop for Layout/EmptyLinesAroundAccessModifier and Layout/EmptyLinesAroundAccessModifier when specifying a superclass that breaks the line. (@koic)
  • #6007: Fix false positive in Style/IfUnlessModifier when using named capture. (@drenmi)
  • #6311: Prevent Style/Semicolon from breaking on single line if-then-else in assignment. (@drenmi)
  • #6315: Fix an error for Rails/HasManyOrHasOneDependent when an Active Record model does not have any relations. (@koic)
  • #6316: Fix an auto-correct error for Style/For when setting EnforcedStyle: each with range provided to the for loop without a do keyword or semicolon and without enclosing parenthesis. (@lukasz-wojcik)
  • #6326: Fix an alignment source for Layout/RescueEnsureAlignment when using inline access modifier. (@andrew-aladev)

Changes

  • #6286: Allow exclusion of certain methods for Metrics/MethodLength. (@akanoi)

0.59.1 (2018-09-15)

Bug fixes

  • #6267: Fix undefined method 'method_name' for Rails/FindEach. (@Knack)
  • #6278: Fix false positive for Naming/FileName when investigating gemspecs. (@kddeisz)
  • #6256: Fix false positive for Naming/FileName when investigating dotfiles. (@sinsoku)
  • #6242: Fix Style/EmptyCaseCondition auto-correction removes comment between case and first when. (@koic)
  • #6261: Fix undefined method error for Style/RedundantBegin when calling super with a block. (@eitoball)
  • #6263: Fix an error Layout/EmptyLineAfterGuardClause when guard clause is after heredoc including string interpolation. (@koic)
  • #6281: Fix false negative in Style/MultilineMethodSignature. (@drenmi)
  • #6264: Fix an incorrect auto-correct for Layout/EmptyLineAfterGuardClause cop when if condition is after heredoc. (@koic)

Changes

  • #6272: Make Lint/UnreachableCode detect exit, exit! and abort. (@hoshinotsuyoshi)
  • #6295: Exclude #=== from Naming/BinaryOperatorParameterName. (@zverok)
  • Add + to allowed file names of Naming/FileName. (@yensaki)
  • #5303: Extract PercentLiteralCorrector class from PercentLiteral mixin. (@ryanhageman)

0.59.0 (2018-09-09)

New features

  • #6109: Add new Bundler/GemComment cop. (@sunny)
  • #6148: Add IgnoredMethods option to Style/NumericPredicate cop. (@AlexWayfer)
  • #6174: Add --display-only-fail-level-offenses to only output offenses at or above the fail level. (@robotdana)
  • Add auto-correct to Style/For. (@rrosenblum)
  • #6173: Add AllowImplicitReturn option to Rails/SaveBang cop. (@robotdana)
  • #6218: Add comparison style to Style/NilComparison. (@khiav223577)
  • Add new Style/MultilineMethodSignature cop. (@drenmi)
  • #6234: Add Performance/ChainArrayAllocation cop. (@schneems)
  • #6136: Add remote url in remote url download error message. (@ShockwaveNN)
  • #5659: Make Layout/EmptyLinesAroundClassBody aware of specifying a superclass that breaks the line. (@koic)

Bug fixes

  • #6107: Fix indentation of multiline postfix conditionals. (@jaredbeck)
  • #6140: Fix Style/DateTime not detecting #to_datetime. It can be configured to allow this. (@bdewater)
  • #6132: Fix a false negative for Naming/FileName when Include of AllCops is the default setting. (@koic)
  • #4115: Fix false positive for unary operations in Layout/MultilineOperationIndentation. (@jonas054)
  • #6127: Fix an error for Layout/ClosingParenthesisIndentation when method arguments are empty with newlines. (@tatsuyafw)
  • #6152: Fix a false negative for Layout/AccessModifierIndentation when using access modifiers with arguments within nested classes. (@gmalette)
  • #6124: Fix Style/IfUnlessModifier cop for disabled Layout/Tab cop when there is no IndentationWidth config. (@AlexWayfer)
  • #6133: Fix AllowURI option of Metrics/LineLength cop for files with tabs indentation. (@AlexWayfer)
  • #6164: Fix incorrect auto-correct for Style/UnneededCondition when using operator method higher precedence than ||. (@koic)
  • #6138: Fix a false positive for assigning a block local variable in Lint/ShadowedArgument. (@jonas054)
  • #6022: Fix Layout/MultilineHashBraceLayout and Layout/MultilineArrayBraceLayout auto-correct syntax error when there is a comment on the last element. (@bacchir)
  • #6175: Fix Style/BracesAroundHashParameters auto-correct syntax error when there is a trailing comma. (@bacchir)
  • #6192: Make Style/RedundantBegin aware of stabby lambdas. (@drenmi)
  • #6208: Ignore assignment methods in Naming/PredicateName. (@sunny)
  • #6196: Fix incorrect auto-correct for Style/EmptyCaseCondition when using return in when clause and assigning the return value of case. (@koic)
  • #6142: Ignore keyword arguments in Rails/Delegate. (@sunny)
  • #6240: Fix an auto-correct error for Style/WordArray when setting EnforcedStyle: brackets and using string interpolation in %W literal. (@koic)
  • #6202: Fix infinite loop when auto-correcting Lint/RescueEnsureAlignment when end is misaligned. The alignment and message are now based on the beginning position rather than the end position. (@rrosenblum)
  • #6199: Don't recommend Date usage in Style/DateTime. (@deivid-rodriguez)

Changes

  • #6161: Add scope methods to Rails/FindEach cop. Makes the cop also check for the following scopes: eager_load, includes, joins, left_joins, left_outer_joins, preload, references, and unscoped. (@repinel)
  • #6137: Allow db to allowed names of Naming/UncommunicativeMethodParamName cop in default config. (@mkenyon)
  • Update the highlighting of Lint/DuplicateMethods to include the method name. (@rrosenblum)
  • #6057: Return 0 when running rubocop --auto-gen-conf if the todo file is successfully created even if there are offenses. (@MagedMilad)
  • #4301: Turn off auto-correct for Rails/RelativeDateConstant by default. (@koic)
  • #4832: Change the path pattern (*) to match the hidden file. (@koic)
  • Style/For now highlights the entire statement rather than just the keyword. (@rrosenblum)
  • Disable Performance/CaseWhenSplat and its auto-correction by default. (@rrosenblum)
  • #6235: Enable Layout/EmptyLineAfterGuardClause cop by default. (@koic)
  • #6199: Style/DateTime has been moved to disabled by default. (@deivid-rodriguez)

0.58.2 (2018-07-23)

New features

  • #6105: Support {a,b} file name globs in Exclude and Include config. (@mikeyhew)

Bug fixes

  • #6103: Fix a false positive for Layout/IndentationWidth when multiple modifiers are used in a block and a method call is made at end of the block. (@koic)
  • #6084: Fix Naming/MemoizedInstanceVariableName cop to allow methods to have leading underscores. (@kenman345)
  • #6098: Fix an error for Layout/ClassStructure when there is a comment in the macro method to be auto-correct. (@koic)
  • #6115: Fix a false positive for Lint/OrderedMagicComments when using { encoding: Encoding::SJIS } hash object after frozen_string_literal magic comment. (@koic)

Changes

  • #6116: Add ip to allowed names of Naming/UncommunicativeMethodParamName cop in default config. (@nijikon)

0.58.1 (2018-07-10)

Bug fixes

  • #6071: Fix auto-correct Style/MethodCallWithArgsParentheses when arguments are method calls. (@maxh)
  • Fix Style/RedundantParentheses with hash literal as first argument to super. (@maxh)
  • #6086: Fix an error for Gemspec/OrderedDependencies when using method call to gem names in gemspec. (@koic)
  • #6089: Make Rails/BulkChangeTable aware of variable table name. (@wata727)
  • #6088: Fix an error for Layout/MultilineAssignmentLayout cop when using multi-line block defines on separate lines. (@koic)
  • #6092: Don't use the broken parser 2.5.1.1 version. (@bbatsov)

0.58.0 (2018-07-07)

New features

  • #5973: Add new Style/IpAddresses cop. (@dvandersluis)
  • #5843: Add configuration options to Naming/MemoizedInstanceVariableName cop to allow leading underscores. (@leklund)
  • #5843: Add EnforcedStyleForLeadingUnderscores to Naming/MemoizedInstanceVariableName cop to allow leading underscores. (@leklund)
  • Performance/Sample will now register an offense when using shuffle followed by at or slice. (@rrosenblum)

Bug fixes

  • #5987: Suppress errors when using ERB template in Rails/BulkChangeTable. (@wata727)
  • #4878: Fix false positive in Layout/IndentationWidth when multiple modifiers and def are on the same line. (@tatsuyafw)
  • #5966: Fix a false positive for Layout/ClosingHeredocIndentation when heredoc content is outdented compared to the closing. (@koic)
  • Fix auto-correct support check for custom cops on --auto-gen-config. (@r7kamura)
  • Fix exception that occurs when auto-correcting a modifier if statement in Style/UnneededCondition. (@rrosenblum)
  • #6025: Fix an incorrect auto-correct for Lint/UnneededCondition when using if_branch in else branch. (@koic)
  • #6029: Fix a false positive for Lint/ShadowedArgument when reassigning to splat variable. (@koic)
  • #6035: Fix error on auto-correction when Layout/LeadingBlankLines is the first cop to act. (@Vasfed)
  • #6036: Make Rails/BulkChangeTable aware of string table name. (@wata727)
  • #5467: Fix a false negative for Style/MultipleComparison when multiple comparison is not part of a conditional. (@koic)
  • #6042: Fix Lint/RedundantWithObject error on missing parameter to each_with_object. (@Vasfed)
  • #6056: Support string timestamps in Rails/CreateTableWithTimestamps cop. (@drn)
  • #6052: Fix a false positive for Style/SymbolProc when using block with adding a comma after the sole argument. (@koic)
  • #2743: Support << as a kind of assignment operator in Layout/EndAlignment. (@jonas054)
  • #6067: Prevent auto-correct error for Performance/InefficientHashSearch when a method by itself and include? method are method chaining. (@koic)

Changes

  • #6006: Remove rake repl task. (@koic)
  • #5990: Drop support for MRI 2.1. (@drenmi)
  • #3299: Lint/UselessAccessModifier now warns when private_class_method is used without arguments. (@Darhazer)
  • #6026: Exclude refine by default from Metrics/BlockLength cop. (@kddeisz)
  • #4882: Use IndentationWidth of Layout/Tab for other cops. (@AlexWayfer)

0.57.2 (2018-06-12)

Bug fixes

  • #5968: Prevent Layout/ClosingHeredocIndentation from raising an error on << heredocs. (@dvandersluis)
  • #5965: Prevent Layout/ClosingHeredocIndentation from raising an error on heredocs containing only a newline. (@drenmi)
  • Prevent a crash in Layout/IndentationConsistency cop triggered by an empty expression string interpolation. (@alexander-lazarov)
  • #5951: Prevent Style/MethodCallWithArgsParentheses from raising an error in certain cases. (@drenmi)

0.57.1 (2018-06-07)

Bug fixes

  • #5963: Allow Performance/ReverseEach to apply to any receiver. (@dvandersluis)
  • #5917: Fix erroneous warning for inherit_mode directive. (@jonas054)
  • #5380: Fix false negative in Layout/IndentationWidth when an access modifier section has an invalid indentation body. (@tatsuyafw)
  • #5909: Even when a module has no public methods, Layout/IndentationConsistency should still register an offense for private methods. (@jaredbeck)
  • #5958: Handle empty method body in Rails/BulkChangeTable. (@wata727)
  • #5954: Make Style/UnneededCondition cop accepts a case of condition and if_branch are same when using elsif branch. (@koic)

0.57.0 (2018-06-06)

New features

  • #5881: Add new Rails/BulkChangeTable cop. (@wata727)
  • #5444: Add new Style/AccessModifierDeclarations cop. (@brandonweiss)
  • #5803: Add new Style/UnneededCondition cop. (@balbesina)
  • #5406: Add new Layout/ClosingHeredocIndentation cop. (@siegfault)
  • #5823: Add new slashes style to Rails/FilePath since Ruby accepts forward slashes even on Windows. (@sunny)
  • New cop Layout/LeadingBlankLines checks for empty lines at the beginning of a file. (@rrosenblum)

Bug fixes

  • #5897: Fix Style/SymbolArray and Style/WordArray not working on arrays of size 1. (@TikiTDO)
  • #5894: Fix Rails/AssertNot to allow it to have failure message. (@koic)
  • #5888: Do not register an offense for headers or env keyword arguments in Rails/HttpPositionalArguments. (@rrosenblum)
  • Fix the indentation of auto-corrected closing squiggly heredocs. (@garettarrowood)
  • #5908: Fix Style/BracesAroundHashParameters auto-correct going past the end of the file when the closing curly brace is on the last line of a file. (@EiNSTeiN-)
  • Fix a bug where Style/FrozenStringLiteralComment would be added to the second line if the first line is empty. (@rrosenblum)
  • #5914: Make Layout/SpaceInsideReferenceBrackets aware of no_space when using nested reference brackets. (@koic)
  • #5799: Fix false positive in Style/MixinGrouping when method named include accepts block. (@Darhazer)

Changes

0.56.0 (2018-05-14)

New features

  • #5848: Add new Performance/InefficientHashSearch cop. (@JacobEvelyn)
  • #5801: Add new Rails/RefuteMethods cop. (@koic)
  • #5805: Add new Rails/AssertNot cop. (@composerinteralia)
  • #4136: Allow more robust Layout/ClosingParenthesisIndentation detection including method chaining. (@jfelchner)
  • #5699: Add consistent_relative_to_receiver style option to Layout/FirstParameterIndentation. (@jfelchner)
  • #5821: Support AR::Migration#up_only for Rails/ReversibleMigration cop. (@koic)
  • #5800: Don't show a stracktrace for invalid command-line params. (@shanecav84)
  • #5845: Add new Lint/ErbNewArguments cop. (@koic)
  • #5871: Add new Lint/SplatKeywordArguments cop. (@koic)
  • #4247: Remove hard-coded file patterns and use only Include, Exclude and the new RubyInterpreters parameters for file selection. (@jonas054)

Bug fixes

  • Fix bug in Style/EmptyMethod which concatenated the method name and first argument if no method def parentheses are used. (@thomasbrus)
  • #5819: Fix Rails/SaveBang when using negated if. (@Edouard-chin)
  • #5286: Fix Lint/SafeNavigationChain not detecting chained operators after block. (@Darhazer)
  • Fix bug where Lint/SafeNavigationConsistency registers multiple offenses for the same method call. (@rrosenblum)
  • #5713: Fix Style/CommentAnnotation reporting only the first of multiple consecutive offending lines. (@svendittmer)
  • #5791: Fix exception in Lint/SafeNavigationConsistency when there is code around the condition. (@rrosenblum)
  • #5784: Fix a false positive for Rails/HasManyOrHasOneDependent when using nested with_options. (@koic)
  • #4666: --stdin always treats input as Ruby source irregardless of filename. (@PointlessOne)
  • Fix auto-correction for Style/MethodCallWithArgsParentheses adding extra parentheses if the method argument was already parenthesized. (@dvandersluis)
  • #5668: Fix an issue where files with unknown extensions, listed in AllCops/Include were not inspected when passing the file name as an option. (@drenmi)
  • #5809: Fix exception Lint/PercentStringArray and Lint/PercentSymbolArray when the inspected file is binary encoded. (@akhramov)
  • #5840: Do not register an offense for methods that nil responds to in Lint/SafeNavigationConsistency. (@rrosenblum)
  • #5862: Fix an incorrect auto-correct for Lint/LiteralInInterpolation if contains numbers. (@koic)
  • #5868: Fix Rails/CreateTableWithTimestamps when using hash options. (@wata727)
  • #5708: Fix exception in Lint/UnneededCopEnableDirective for instruction '# rubocop:enable all'. (@balbesina)
  • Fix auto-correction of Rails/HttpPositionalArgumnets to use session instead of header. (@rrosenblum)

Changes

  • Split Style/MethodMissing into two cops, Style/MethodMissingSuper and Style/MissingRespondToMissing. (@rrosenblum)
  • #5757: Add AllowInMultilineConditions option to Style/ParenthesesAroundCondition cop. (@Darhazer)
  • #5806: Fix Layout/SpaceInsideReferenceBrackets when assigning a reference bracket to a reference bracket. (@joshuapinter)
  • #5082: Allow caching together with --auto-correct. (@jonas054)
  • Add try! to the list of whitelisted methods for Lint/SafeNavigationChain and Style/SafeNavigation. (@rrosenblum)
  • #5886: Move Style/EmptyLineAfterGuardClause cop to Layout department. (@koic)

0.55.0 (2018-04-16)

New features

Bug fixes

  • #5759: Fix Performance/RegexpMatch cop not correcting negated match operator. (@bdewater)
  • #5726: Fix false positive for :class_name option in Rails/InverseOf cop. (@bdewater)
  • #5686: Fix a regression for Style/SymbolArray and Style/WordArray for multiline Arrays. (@istateside)
  • #5730: Stop Rails/InverseOf cop allowing inverse_of: nil to opt-out. (@bdewater)
  • #5561: Fix Lint/ShadowedArgument false positive with shorthand assignments. (@akhramov)
  • #5403: Fix Naming/HeredocDelimiterNaming blacklist patterns. (@mcfisch)
  • #4298: Fix auto-correction of Performance/RegexpMatch to produce code that safe guards against the receiver being nil. (@rrosenblum)
  • #5738: Make Rails/HttpStatus ignoring hash order to fix false negative. (@pocke)
  • #5720: Fix false positive for Style/EmptyLineAfterGuardClause when guard clause is after heredoc. (@koic)
  • #5760: Fix incorrect offense location for Style/EmptyLineAfterGuardClause when guard clause is after heredoc argument. (@koic)
  • #5764: Fix Style/Unpackfirst false positive of unpack('h*').take(1). (@parkerfinch)
  • #5766: Update Style/FrozenStringLiteralComment auto-correction to insert a new line between the comment and the code. (@rrosenblum)
  • #5551: Fix Lint/Void not detecting void context in blocks with single expression. (@Darhazer)

Changes

  • #5752: Add String#delete_{prefix,suffix} to Lint/Void cop. (@bdewater)
  • #5734: Add by, on, in and at to allowed names of Naming/UncommunicativeMethodParamName cop in default config. (@AlexWayfer)
  • #5666: Add spaces as an EnforcedStyle option to Layout/SpaceInsideParens, allowing you to enforce spaces inside of parentheses. (@joshuapinter)
  • #4257: Allow specifying module name in Metrics/BlockLength's ExcludedMethods configuration option. (@akhramov)
  • #4753: Add IgnoredMethods option to Style/MethodCallWithoutArgsParentheses cop. (@Darhazer)
  • #4517: Add option to allow trailing whitespaces inside heredoc strings. (@Darhazer)
  • #5652: Make Style/OptionHash aware of implicit parameter passing to super. (@Wei-LiangChew)
  • #5451: When using --auto-gen-config, do not output offenses unless the --output-offenses flag is also passed. (@drewpterry)

0.54.0 (2018-03-21)

New features

Bug fixes

  • #5744: Teach Performance/StartWith and EndWith cops to look for Regexp#match?. (@bdewater)
  • #5683: Fix message for Naming/UncommunicativeXParamName cops. (@jlfaber)
  • #5680: Fix Layout/ElseAlignment for rescue/else/ensure inside do/end blocks. (@YukiJikumaru)
  • #5642: Fix Style/Documentation :nodoc: for compact-style nested modules/classes. (@ojab)
  • #5648: Suggest valid memoized instance variable for predicate method. (@satyap)
  • #5670: Suggest valid memoized instance variable for bang method. (@pocke)
  • #5623: Fix Bundler/OrderedGems when a group includes duplicate gems. (@colorbox)
  • #5633: Fix broken --fail-fast. (@mmyoji)
  • #5630: Fix false positive for Style/FormatStringToken when using placeholder arguments in format method. (@koic)
  • #5651: Fix NoMethodError when specified config file that does not exist. (@onk)
  • #5647: Fix encoding method of RuboCop::MagicComment::SimpleComment. (@htwroclau)
  • #5619: Do not register an offense in Style/InverseMethods when comparing constants with <, >, <=, or >=. If the code is being used to determine class hierarchy, the correction might not be accurate. (@rrosenblum)
  • #5641: Disable Style/TrivialAccessors auto-correction for def with private. (@pocke)
  • Fix bug where Style/SafeNavigation does not auto-correct all chained methods resulting in a Lint/SafeNavigationChain offense. (@rrosenblum)
  • #5436: Allow empty kwrest args in UncommunicativeName cops. (@pocke)
  • #5674: Fix auto-correction of Layout/EmptyComment when the empty comment appears on the same line as code. (@rrosenblum)
  • #5679: Fix a false positive for Style/EmptyLineAfterGuardClause when guard clause is before rescue or ensure. (@koic)
  • #5694: Match Rails versions with multiple digits when reading the TargetRailsVersion from the bundler lock files. (@roberts1000)
  • #5700: Fix a false positive for Style/EmptyLineAfterGuardClause when guard clause is before else. (@koic)
  • Fix false positive in Naming/ConstantName when using conditional assignment. (@drenmi)

Changes

  • #5626: Change Naming/UncommunicativeMethodParamName add to to allowed names in default config. (@unused)
  • #5640: Warn about user configuration overriding other user configuration only with --debug. (@jonas054)
  • #5637: Fix error for Layout/SpaceInsideArrayLiteralBrackets when contains an array literal as an argument after a heredoc is started. (@koic)
  • #5610: Use gems.locked or Gemfile.lock to determine the best TargetRubyVersion when it is not specified in the config. (@roberts1000)
  • #5390: Allow exceptions to Style/InlineComment for inline comments which enable or disable rubocop cops. (@jfelchner)
  • Add progress bar to offenses formatter. (@drewpterry)
  • #5498: Correct IndentHeredoc message for Ruby 2.3 when using <<~ operator with invalid indentation. (@hamada14)

0.53.0 (2018-03-05)

New features

Bug fixes

  • #4105: Fix Lint/IndentationWidth when Lint/EndAlignment is configured with start_of_line. (@brandonweiss)
  • #5453: Fix erroneous downcase in Performance/Casecmp auto-correction. (@walinga)
  • #5343: Fix offense detection in Style/TrailingMethodEndStatement. (@garettarrowood)
  • #5334: Fix semicolon removal for Style/TrailingBodyOnMethodDefinition auto-correction. (@garettarrowood)
  • #5350: Fix Metric/LineLength false offenses for URLs in double quotes. (@garettarrowood)
  • #5333: Fix Layout/EmptyLinesAroundArguments false positives for inline access modifiers. (@garettarrowood)
  • #5339: Fix Layout/EmptyLinesAroundArguments false positives for multiline heredoc arguments. (@garettarrowood)
  • #5383: Fix Rails/Presence false detection of receiver for locally defined blank? & present? methods. (@garettarrowood)
  • #5314: Fix false positives for Lint/NestedPercentLiteral when percent characters are nested. (@asherkach)
  • #5357: Fix Lint/InterpolationCheck false positives on escaped interpolations. (@pocke)
  • #5409: Fix multiline indent for Style/SymbolArray and Style/WordArray auto-correct. (@flyerhzm)
  • #5393: Fix Rails/Delegate's false positive with a method call with arguments. (@pocke)
  • #5348: Fix false positive for Style/SafeNavigation when safe guarding more comparison methods. (@rrosenblum)
  • #4889: Auto-correcting Style/SafeNavigation will add safe navigation to all methods in a method chain. (@rrosenblum)
  • #5287: Do not register an offense in Style/SafeNavigation if there is an unsafe method used in a method chain. (@rrosenblum)
  • #5401: Fix Style/RedundantReturn to trigger when begin-end, rescue, and ensure blocks present. (@asherkach)
  • #5426: Make Rails/InverseOf accept inverse_of: nil to opt-out. (@wata727)
  • #5448: Improve Rails/LexicallyScopedActionFilter. (@wata727)
  • #3947: Fix false positive for Rails/FilePath when using Rails.root.join in string interpolation of argument. (@koic)
  • #5479: Fix false positives for Rails/Presence when using with elsif. (@wata727)
  • #5427: Fix exception when executing from a different drive on Windows. (@orgads)
  • #5429: Detect tabs other than indentation by Layout/Tab. (@pocke)
  • #5496: Fix a false positive of Style/FormatStringToken with unrelated format call. (@pocke)
  • #5503: Fix Rails/CreateTableWithTimestamps false positive when using to_proc syntax. (@wata727)
  • #5512: Improve Lint/Void to detect Kernel#tap as method that ignores the block's value. (@untitaker)
  • #5520: Fix Style/RedundantException auto-correction does not keep parenthesization. (@dpostorivo)
  • #5524: Return the instance based on the new type when calls RuboCop::AST::Node#updated. (@wata727)
  • #5527: Avoid behavior-changing corrections in Style/SafeNavigation. (@jonas054)
  • #5539: Fix compilation error and ruby code generation when passing args to funcall and predicates. (@Edouard-chin)
  • #4669: Use binary file contents for cache key so changing EOL characters invalidates the cache. (@jonas054)
  • #3947: Fix false positive for Performance::RegexpMatch when using MatchData before guard clause. (@koic)
  • #5515: Fix Style/EmptyElse auto-correct for nested if and case statements. (@asherkach)
  • #5582: Fix end alignment for variable assignment with line break after = in Layout/EndAlignment. (@jonas054)
  • #5602: Fix false positive for Style/ColonMethodCall when using Java package namespace. (@koic)
  • #5603: Fix falsy offense for Style/RedundantSelf with pseudo variables. (@pocke)
  • #5547: Fix auto-correction of of Layout/BlockEndNewline when there is top level code outside of a class. (@rrosenblum)
  • #5599: Fix the suggestion being used by Lint/NumberConversion to use base 10 with Integer. (@rrosenblum)
  • #5534: Fix Style/EachWithObject auto-correction leaves an empty line. (@flyerhzm)
  • Fix Layout/EmptyLinesAroundAccessModifier false-negative when next string after access modifier started with end. (@unkmas)

Changes

  • #5589: Remove Performance/HashEachMethods cop as it no longer provides a performance benefit. (@urbanautomaton)
  • #3394: Remove Style/TrailingCommmaInLiteral in favor of two new cops. (@garettarrowood)
  • Rename Lint/UnneededDisable to Lint/UnneededCopDisableDirective. (@garettarrowood)
  • #5365: Add *.gemfile to Bundler cop target. (@sue445)
  • #4477: Warn when user configuration overrides other user configuration. (@jonas054)
  • #5240: Make Style/StringHashKeys to accepts environment variables. (@pocke)
  • #5395: Always exit 2 when specified configuration file does not exist. (@pocke)
  • #5402: Remove undefined ActiveSupport::TimeZone#strftime method from defined dangerous methods of Rails/TimeZone cop. (@koic)
  • #4704: Move Lint/EndAlignment, Lint/DefEndAlignment, Lint/BlockAlignment, and Lint/ConditionPosition to the Layout namespace. (@bquorning)
  • #5283: Change file path output by Formatter::JSONFormatter from relative path to smart path. (@koic)
  • Style/SafeNavigation will now register an offense for methods that nil responds to. (@rrosenblum)
  • #5542: Exclude .git/ by default. (@pocke)
  • Tell Read the Docs to build downloadable docs. (@eostrom)
  • Change Style/SafeNavigation to no longer register an offense for method chains exceeding 2 methods. (@rrosenblum)
  • Remove auto-correction from Lint/SafeNavigationChain. (@rrosenblum)
  • Change the highlighting of Lint/SafeNavigationChain to highlight the entire method chain beyond the safe navigation portion. (@rrosenblum)

0.52.1 (2017-12-27)

Bug fixes

  • #5241: Fix an error for Layout/AlignHash when using a hash including only a keyword splat. (@wata727)
  • #5245: Make Style/FormatStringToken to allow regexp token. (@pocke)
  • #5224: Fix false positives for Layout/EmptyLinesAroundArguments operating on blocks. (@garettarrowood)
  • #5234: Fix a false positive for Rails/HasManyOrHasOneDependent when using class_name option. (@koic)
  • #5273: Fix Style/EvalWithLocation reporting bad line offset. (@pocke)
  • #5228: Handle overridden Metrics/LineLength:Max for --auto-gen-config. (@jonas054)
  • #5226: Suppress false positives for Rails/RedundantReceiverInWithOptions when including another receiver in with_options. (@wata727)
  • #5259: Fix false positives in Style/CommentedKeyword. (@garettarrowood)
  • #5238: Fix error when #present? or #blank? is used in if or unless modifier. (@eitoball)
  • #5261: Fix a false positive for Style/MixinUsage when using inside class or module. (@koic)
  • #5289: Fix Layout/SpaceInsideReferenceBrackets and Layout/SpaceInsideArrayLiteralBrackets configuration conflicts. (@garettarrowood)
  • #4444: Fix Style/AutoResourceCleanup shouldn't flag File.open(...).close. (@dpostorivo)
  • #5278: Fix deprecation check to use loaded_path in warning. (@chrishulton)
  • #5293: Fix a regression for Rails/HasManyOrHasOneDependent when using a option of has_many or has_one association. (@koic)
  • #5223: False offences in :unannotated Style/FormatStringToken. (@nattfodd)
  • #5258: Fix incorrect auto-correction for Rails/Presence when the else block is multiline. (@wata727)
  • #5297: Improve inspection for Rails/InverseOf when including through or polymorphic options. (@wata727)
  • #5281: Fix issue where --auto-gen-config might fail on invalid YAML. (@bquorning)
  • #5313: Fix Style/HashSyntax from stripping quotes off of symbols during auto-correction for ruby22+. (@garettarrowood)
  • #5315: Fix a false positive of Layout/RescueEnsureAlignment in Ruby 2.5. (@pocke)
  • #5236: Fix false positives for Rails/InverseOf when using with_options. (@wata727)
  • #5291: Fix multiline indent for Style/BracesAroundHashParameters auto-correct. (@flyerhzm)
  • #3318: Look for .ruby-version in parent directories. (@ybiquitous)

Changes

0.52.0 (2017-12-12)

New features

  • #5101: Allow to specify TargetRubyVersion 2.5. (@walf443)
  • #1575: Add new Layout/ClassStructure cop that checks whether definitions in a class are in the configured order. This cop is disabled by default. (@jonatas)
  • New cop Rails/InverseOf checks for association arguments that require setting the inverse_of option manually. (@bdewater)
  • #4811: Add new Layout/SpaceInsideReferenceBrackets cop. (@garettarrowood)
  • #4811: Add new Layout/SpaceInsideArrayLiteralBrackets cop. (@garettarrowood)
  • #4252: Add new Style/TrailingBodyOnMethodDefinition cop. (@garettarrowood)
  • Add new Style/TrailingMethodEndStatment cop. (@garettarrowood)
  • #5074: Add Layout/EmptyLinesAroundArguments cop. (@garettarrowood)
  • #4650: Add new Style/StringHashKeys cop. (@donjar)
  • #1583: Add a quiet formatter. (@drenmi)
  • Add new Style/RandomWithOffset cop. (@donjar)
  • #4892: Add new Lint/ShadowedArgument cop and remove argument shadowing detection from Lint/UnusedBlockArgument and Lint/UnusedMethodArgument. (@akhramov)
  • #4674: Add a new Lint/MissingCopEnableDirective cop. (@tdeo)
  • Add new Rails/EnvironmentComparison cop. (@tdeo)
  • Add AllowedChars option to Style/AsciiComments cop. (@hedgesky)
  • #5031: Add new Style/EmptyBlockParameter and Style/EmptyLambdaParameter cops. (@pocke)
  • #5057: Add new Gemspec/RequiredRubyVersion cop. (@koic)
  • #5087: Add new Gemspec/RedundantAssignment cop. (@koic)
  • Add unannotated option to Style/FormatStringToken cop. (@drenmi)
  • #5077: Add new Rails/CreateTableWithTimestamps cop. (@wata727)
  • Add new Style/ColonMethodDefinition cop. (@rrosenblum)
  • Add new Style/ExtendSelf cop. (@drenmi)
  • #5185: Add new Rails/RedundantReceiverInWithOptions cop. (@koic)
  • #5177: Add new Rails/LexicallyScopedActionFilter cop. (@wata727)
  • #5173: Add new Style/EvalWithLocation cop. (@pocke)
  • #5208: Add new Rails/Presence cop. (@wata727)
  • Allow auto-correction of ClassAndModuleChildren. (@siegfault, @melch)

Bug fixes

  • #5096: Fix incorrect detection and auto-correction of multiple extend/include/prepend. (@marcandre)
  • #5219: Fix incorrect empty line detection for block arguments in Layout/EmptyLinesAroundArguments. (@garettarrowood)
  • #4662: Fix incorrect indent level detection when first line of heredoc is blank. (@sambostock)
  • #5016: Fix a false positive for Style/ConstantName with constant names using non-ASCII capital letters with accents. (@timrogers)
  • #4866: Prevent Layout/BlockEndNewline cop from introducing trailing whitespaces. (@bgeuken)
  • #3396: Concise error when config. file not found. (@jaredbeck)
  • #4881: Fix a false positive for Performance/HashEachMethods when unused argument(s) exists in other blocks. (@pocke)
  • #4883: Fix auto-correction for Performance/HashEachMethods. (@pocke)
  • #4896: Fix Style/DateTime wrongly triggered on classes ...::DateTime. (@dpostorivo)
  • #4938: Fix behavior of Lint/UnneededDisable, which was returning offenses even after being disabled in a comment. (@tdeo)
  • #4887: Add undeclared configuration option EnforcedStyleForEmptyBraces for Layout/SpaceBeforeBlockBraces cop. (@drenmi)
  • #4987: Skip permission check when using stdin option. (@mtsmfm)
  • #4909: Make Rails/HasManyOrHasOneDependent aware of multiple associations in with_options. (@koic)
  • #4794: Fix an error in Layout/MultilineOperationIndentation when an operation spans multiple lines and contains a ternary expression. (@rrosenblum)
  • #4885: Fix false offense detected by Style/MixinUsage cop. (@koic)
  • #3363: Fix Style/EmptyElse auto-correction removes comments from branches. (@dpostorivo)
  • #5025: Fix error with Layout/MultilineMethodCallIndentation cop and lambda.(...). (@dpostorivo)
  • #4781: Prevent Style/UnneededPercentQ from breaking on strings that are concated with backslash. (@pocke)
  • #4363: Fix Style/PercentLiteralDelimiters incorrectly automatically modifies escaped percent literal delimiter. (@koic)
  • #5053: Fix Naming/ConstantName false offense on assigning to a nonoffensive assignment. (@garettarrowood)
  • #5019: Fix auto-correct for Style/HashSyntax cop when hash is used as unspaced argument. (@drenmi)
  • #5052: Improve accuracy of Style/BracesAroundHashParameters auto-correction. (@garettarrowood)
  • #5059: Fix a false positive for Style/MixinUsage when include call is a method argument. (@koic)
  • #5071: Fix a false positive in Lint/UnneededSplatExpansion, when Array.new resides in an array literal. (@akhramov)
  • #4071: Prevent generating wrong code by Style/ColonMethodCall and Style/RedundantSelf. (@pocke)
  • #5089: Fix false positive for Style/SafeNavigation when safe guarding arithmetic operation or assignment. (@tiagotex)
  • #5099: Prevent Style/MinMax from breaking on implicit receivers. (@drenmi)
  • #5079: Fix false positive for Style/SafeNavigation when safe guarding comparisons. (@tiagotex)
  • #5075: Fix auto-correct for Style/RedundantParentheses cop when unspaced ternary is present. (@tiagotex)
  • #5155: Fix a false negative for Naming/ConstantName cop when using frozen object assignment. (@koic)
  • Fix a false positive in Style/SafeNavigation when the right hand side is negated. (@rrosenblum)
  • #5128: Fix Bundler/OrderedGems when gems are references from variables (ignores them in the sorting). (@tdeo)

Changes

  • #4848: Exclude lambdas and procs from Metrics/ParameterLists. (@reitermarkus)
  • #5120: Improve speed of RuboCop::PathUtil#smart_path. (@walf443)
  • #4888: Improve offense message of Style/StderrPuts. (@jaredbeck)
  • #4886: Fix false offense for Style/CommentedKeyword. (@michniewicz)
  • #4977: Make Lint/RedundantWithIndex cop aware of offset argument. (@koic)
  • #2679: Handle dependencies to Metrics/LineLength: Max when generating .rubocop_todo.yml. (@jonas054)
  • #4943: Make cop generator compliant with the repo's rubocop config. (@tdeo)
  • #5011: Remove SupportedStyles from "Configuration parameters" in .rubocop_todo.yml. (@pocke)
  • Lint/RescueWithoutErrorClass has been replaced by Style/RescueStandardError. (@rrosenblum)
  • #4811: Remove Layout/SpaceInsideBrackets in favor of two new configurable cops. (@garettarrowood)
  • #5042: Make offense locations of metrics cops to contain whole a method. (@pocke)
  • #5044: Add last_line and last_column into outputs of the JSON formatter. (@pocke)
  • #4633: Make metrics cops aware of define_method. (@pocke)
  • #5037: Make display cop names to enable by default. (@pocke)
  • #4449: Make Layout/IndentHeredoc aware of line length. (@pocke)
  • #5146: Make --show-cops option aware of --force-default-config. (@pocke)
  • #3001: Add configuration to Lint/MissingCopEnableDirective cop. (@tdeo)
  • #4932: Do not fail if configuration contains Lint/Syntax cop with the same settings as the default. (@tdeo)
  • #5175: Make Style/RedundantBegin aware of do-end block in Ruby 2.5. (@pocke)

0.51.0 (2017-10-18)

New features

  • #4791: Add new Rails/UnknownEnv cop. (@pocke)
  • #4690: Add new Lint/UnneededRequireStatement cop. (@koic)
  • #4813: Add new Style/StderrPuts cop. (@koic)
  • #4796: Add new Lint/RedundantWithObject cop. (@koic)
  • #4663: Add new Style/CommentedKeyword cop. (@donjar)
  • Add IndentationWidth configuration for Layout/Tab cop. (@rrosenblum)
  • #4854: Add new Lint/RegexpAsCondition cop. (@pocke)
  • #4862: Add MethodDefinitionMacros option to Naming/PredicateName cop. (@koic)
  • #4874: Add new Gemspec/OrderedDependencies cop. (@sue445)
  • #4840: Add new Style/MixinUsage cop. (@koic)
  • #1952: Add new Style/DateTime cop. (@dpostorivo)
  • #4727: Make Lint/Void check for nonmutating methods as well. (@donjar)

Bug fixes

  • #3312: Make Rails/Date Correct false positive on #to_time for strings ending in UTC-"Z".(@erikdstock)
  • #4741: Make Style/SafeNavigation correctly exclude methods called without dot. (@drenmi)
  • #4740: Make Lint/RescueWithoutErrorClass aware of modifier form rescue. (@drenmi)
  • #4745: Make Style/SafeNavigation ignore negated continuations. (@drenmi)
  • #4732: Prevent Performance/HashEachMethods from registering an offense when #each follows #to_a. (@drenmi)
  • #4730: False positive on Lint/InterpolationCheck. (@koic)
  • #4751: Prevent Rails/HasManyOrHasOneDependent cop from registering offense if :through option was specified. (@smakagon)
  • #4737: Fix ReturnInVoidContext cop when return is in top scope. (@frodsan)
  • #4776: Non utf-8 magic encoding comments are now respected. (@deivid-rodriguez)
  • #4241: Prevent Rails/Blank and Rails/Present from breaking when there is no explicit receiver. (@rrosenblum)
  • #4814: Prevent Rails/Blank from breaking on send with an argument. (@pocke)
  • #4759: Make Naming/HeredocDelimiterNaming and Naming/HeredocDelimiterCase aware of more delimiter patterns. (@drenmi)
  • #4823: Make Lint/UnusedMethodArgument and Lint/UnusedBlockArgument aware of overriding assignments. (@akhramov)
  • #4830: Prevent Lint/BooleanSymbol from truncating symbol's value in the message when offense is located in the new syntax hash. (@akhramov)
  • #4747: Fix Rails/HasManyOrHasOneDependent cop incorrectly flags with_options blocks. (@koic)
  • #4836: Make Rails/OutputSafety aware of safe navigation operator. (@drenmi)
  • #4843: Make Lint/ShadowedException cop aware of same system error code. (@koic)
  • #4757: Make Style/TrailingUnderscoreVariable work for nested assignments. (@donjar)
  • #4597: Fix Style/StringLiterals cop not registering an offense on single quoted strings containing an escaped single quote when configured to use double quotes. (@promisedlandt)
  • #4850: Lint/UnusedMethodArgument respects IgnoreEmptyMethods setting by ignoring unused method arguments for singleton methods. (@jmks)
  • #2040: Document how to write a custom cop. (@jonatas)

Changes

  • #4746: The Lint/InvalidCharacterLiteral cop has been removed since it was never being actually triggered. (@deivid-rodriguez)
  • #4789: Analyzing code that needs to support MRI 1.9 is no longer supported. (@deivid-rodriguez)
  • #4582: Severity and other common parameters can be configured on department level. (@jonas054)
  • #4787: Analyzing code that needs to support MRI 2.0 is no longer supported. (@deivid-rodriguez)
  • #4787: RuboCop no longer installs on MRI 2.0. (@deivid-rodriguez)
  • #4266: Download the inherited config files of a remote file from the same remote. (@tdeo)
  • #4853: Make Lint/LiteralInCondition cop aware of ! and not. (@pocke)
  • #4864: Rename Lint/LiteralInCondition to Lint/LiteralAsCondition. (@pocke)

0.50.0 (2017-09-14)

New features

  • #4464: Add EnforcedStyleForEmptyBraces parameter to Layout/SpaceBeforeBlockBraces cop. (@palkan)
  • #4453: New cop Style/RedundantConditional checks for conditionals that return true/false. (@petehamilton)
  • #4448: Add new TapFormatter. (@cyberdelia)
  • #4467: Add new Style/HeredocDelimiters cop(Note: This cop was renamed to Naming/HeredocDelimiterNaming). (@drenmi)
  • #4153: New cop Lint/ReturnInVoidContext checks for the use of a return with a value in a context where it will be ignored. (@harold-s)
  • #4506: Add auto-correct support to Lint/ScriptPermission. (@rrosenblum)
  • #4514: Add configuration options to Style/YodaCondition to support checking all comparison operators or equality operators only. (@smakagon)
  • #4515: Add new Lint/BooleanSymbol cop. (@droptheplot)
  • #4535: Make Rails/PluralizationGrammar use singular methods for -1 / -1.0. (@promisedlandt)
  • #4541: Add new Rails/HasManyOrHasOneDependent cop. (@oboxodo)
  • #4552: Add new Style/Dir cop. (@drenmi)
  • #4548: Add new Style/HeredocDelimiterCase cop(Note: This cop is renamed to Naming/HeredocDelimiterCase). (@drenmi)
  • #2943: Add new Lint/RescueWithoutErrorClass cop. (@drenmi)
  • #4568: Fix auto-correction for Style/TrailingUnderscoreVariable. (@smakagon)
  • #4586: Add new Performance/UnfreezeString cop. (@pocke)
  • #2976: Add Whitelist configuration option to Style/NestedParenthesizedCalls cop. (@drenmi)
  • #3965: Add new Style/OrAssignment cop. (@donjar)
  • #4655: Make rake new_cop create parent directories if they do not already exist. (@highb)
  • #4368: Make Performance/HashEachMethod inspect send nodes with any receiver. (@gohdaniel15)
  • #4508: Add new Style/ReturnNil cop. (@donjar)
  • #4629: Add Metrics/MethodLength cop for define_method. (@jekuta)
  • #4702: Add new Lint/UriEscapeUnescape cop. (@koic)
  • #4696: Add new Performance/UriDefaultParser cop. (@koic)
  • #4694: Add new Lint/UriRegexp cop. (@koic)
  • #4711: Add new Style/MinMax cop. (@drenmi)
  • #4720: Add new Bundler/InsecureProtocolSource cop. (@koic)
  • #4708: Add new Lint/RedundantWithIndex cop. (@koic)
  • #4480: Add new Lint/InterpolationCheck cop. (@GauthamGoli)
  • #4628: Add new Lint/NestedPercentLiteral cop. (@asherkach)

Bug fixes

  • #4709: Use cached remote config on network failure. (@kristjan)
  • #4688: Accept yoda condition which isn't commutative. (@fujimura)
  • #4676: Make Style/RedundantConditional cop work with elsif. (@akhramov)
  • #4656: Modify Style/ConditionalAssignment auto-correction to work with unbracketed arrays. (@akhramov)
  • #4615: Don't consider <=> a comparison method. (@iGEL)
  • #4664: Fix typos in Rails/HttpPositionalArguments. (@JoeCohen)
  • #4618: Fix Lint/FormatParameterMismatch false positive if format string includes %%5B (CGI encoded left bracket). (@barthez)
  • #4604: Fix Style/LambdaCall to auto-correct obj.call to obj.. (@iGEL)
  • #4443: Prevent Style/YodaCondition from breaking not LITERAL. (@pocke)
  • #4434: Prevent bad auto-correct in Style/Alias for non-literal arguments. (@drenmi)
  • #4451: Make Style/AndOr cop aware of comparison methods. (@drenmi)
  • #4457: Fix false negative in Lint/Void with initialize and setter methods. (@pocke)
  • #4418: Register an offense in Style/ConditionalAssignment when the assignment line is the longest line, and it does not exceed the max line length. (@rrosenblum)
  • #4491: Prevent bad auto-correct in Style/EmptyElse for nested if. (@pocke)
  • #4485: Handle 304 status for remote config files. (@daniloisr)
  • #4529: Make Lint/UnreachableCode aware of if and case. (@pocke)
  • #4469: Include permissions in file cache. (@pocke)
  • #4270: Fix false positive in Performance/RegexpMatch for named captures. (@pocke)
  • #4525: Fix regexp for checking comment config of rubocop:disable all in Lint/UnneededDisable. (@meganemura)
  • #4555: Make Style/VariableName aware of optarg, kwarg and other arguments. (@pocke)
  • #4481: Prevent Style/WordArray and Style/SymbolArray from registering offenses where percent arrays don't work. (@drenmi)
  • #4447: Prevent Layout/EmptyLineBetweenDefs from removing too many lines. (@drenmi)
  • #3892: Make Style/NumericPredicate ignore numeric comparison of global variables. (@drenmi)
  • #4101: Skip auto-correct for literals with trailing comment and chained method call in Layout/Multiline*BraceLayout. (@jonas054)
  • #4518: Fix bug where Style/SafeNavigation does not register an offense when there are chained method calls. (@rrosenblum)
  • #3040: Ignore safe navigation in Rails/Delegate. (@cgriego)
  • #4587: Fix false negative for void unary operators in Lint/Void cop. (@pocke)
  • #4589: Fix false positive in Performance/RegexpMatch cop for =~ is in a class method. (@pocke)
  • #4578: Fix false positive in Lint/FormatParameterMismatch for format with "asterisk" (*) width and precision. (@smakagon)
  • #4285: Make Lint/DefEndAlignment aware of multiple modifiers. (@drenmi)
  • #4634: Handle heredoc that contains empty lines only in Layout/IndentHeredoc cop. (@pocke)
  • #4646: Make Lint/Debugger aware of Kernel and cbase. (@pocke)
  • #4643: Modify Style/InverseMethods to not register a separate offense for an inverse method nested inside of the block of an inverse method offense. (@rrosenblum)
  • #4593: Fix false positive in Rails/SaveBang when save/update_attribute is used with a case statement. (@theRealNG)
  • #4322: Fix Style/MultilineMemoization from auto-correcting to invalid ruby. (@dpostorivo)
  • #4722: Fix rake new_cop problem that doesn't add require line. (@koic)
  • #4723: Fix RaiseArgs auto-correction issue for raise with 3 arguments. (@smakagon)

Changes

  • #4470: Improve the error message for Lint/AssignmentInCondition. (@brandonweiss)
  • #4553: Add node_modules to default excludes. (@iainbeeston)
  • #4445: Make Style/Encoding cop enabled by default. (@deivid-rodriguez)
  • #4452: Add option to Rails/Delegate for enforcing the prefixed method name case. (@klesse413)
  • #4493: Make Lint/Void cop aware of Enumerable#each and for. (@pocke)
  • #4492: Make Lint/DuplicateMethods aware of alias and alias_method. (@pocke)
  • #4478: Fix confusing message of Performance/Caller cop. (@pocke)
  • #4543: Make Lint/DuplicateMethods aware of attr_* methods. (@pocke)
  • #4550: Mark RuboCop::CLI#run as a public API. (@yujinakayama)
  • #4551: Make Performance/Caller aware of caller_locations. (@pocke)
  • #4547: Rename Style/HeredocDelimiters to Style/HeredocDelimiterNaming. (@drenmi)
  • #4157: Enhance offense message for Style/RedudantReturn cop. (@gohdaniel15)
  • #4521: Move naming related cops into their own Naming department. (@drenmi)
  • #4600: Make Style/RedundantSelf aware of arguments of a block. (@Envek)
  • #4658: Disable auto-correction for Performance/TimesMap by default. (@Envek)

0.49.1 (2017-05-29)

Bug fixes

  • #4411: Handle properly safe navigation in Style/YodaCondition. (@bbatsov)
  • #4412: Handle properly literal comparisons in Style/YodaCondition. (@bbatsov)
  • Handle properly class variables and global variables in Style/YodaCondition. (@bbatsov)
  • #4392: Fix the auto-correct of Style/Next when the end is misaligned. (@rrosenblum)
  • #4407: Prevent Performance/RegexpMatch from blowing up on match without arguments. (@pocke)
  • #4414: Handle pseudo-assignments in for loops in Style/ConditionalAssignment. (@bbatsov)
  • #4419: Handle combination AllCops: DisabledByDefault: true and Rails: Enabled: true. (@jonas054)
  • #4422: Fix missing space in message for Style/MultipleComparison. (@timrogers)
  • #4420: Ensure Style/EmptyMethod honours indentation when auto-correcting. (@drenmi)
  • #4442: Prevent Style/WordArray from breaking on strings that aren't valid UTF-8. (@pocke)
  • #4441: Prevent Layout/SpaceAroundBlockParameters from breaking on lambda. (@pocke)

Changes

  • #4436: Display 'Running parallel inspection' only with --debug. (@pocke)

0.49.0 (2017-05-24)

New features

  • #117: Add --parallel option for running RuboCop in multiple processes or threads. (@jonas054)
  • Add auto-correct support to Style/MixinGrouping. (@rrosenblum)
  • #4236: Add new Rails/ApplicationJob and Rails/ApplicationRecord cops. (@tjwp)
  • #4078: Add new Performance/Caller cop. (@alpaca-tc)
  • #4314: Check slow hash accessing in Array#sort by Performance/CompareWithBlock. (@pocke)
  • #3438: Add new Style/FormatStringToken cop. (@backus)
  • #4342: Add new Lint/ScriptPermission cop. (@yhirano55)
  • #4145: Add new Style/YodaCondition cop. (@smakagon)
  • #4403: Add public API Cop.autocorrect_incompatible_with for specifying other cops that should not auto-correct together. (@backus)
  • #4354: Add auto-correct to Style/FormatString. (@hoshinotsuyoshi)
  • #4021: Add new Style/MultipleComparison cop. (@dabroz)
  • New Lint/RescueType cop. (@rrosenblum)
  • #4328: Add --ignore-parent-exclusion flag to ignore AllCops/Exclude inheritance. (@nelsonjr)

Changes

  • #4262: Add new MinSize configuration to Style/SymbolArray, consistent with the same configuration in Style/WordArray. (@scottmatthewman)
  • #3400: Remove auto-correct support from Lint/Debugger. (@ilansh)
  • #4278: Move all cops dealing with whitespace into a new department called Layout. (@jonas054)
  • #4320: Update Rails/OutputSafety to disallow wrapping raw or html_safe with safe_join. (@klesse413)
  • #4336: Store rubocop_cache in safer directories. (@jonas054)
  • #4361: Use relative path for offense message in Lint/DuplicateMethods. (@pocke)
  • #4385: Include .jb file by default. (@pocke)

Bug fixes

  • #4265: Require a space before first argument of a method call in Style/SpaceBeforeFirstArg cop. (@cjlarose)
  • #4237: Fix false positive in Lint/AmbiguousBlockAssociation cop for lambdas. (@smakagon)
  • #4242: Add Capfile to the list of known Ruby filenames. (@bbatsov)
  • #4240: Handle ||= in Rails/RelativeDateConstant. (@bbatsov)
  • #4241: Prevent Rails/Blank and Rails/Present from breaking when there is no explicit receiver. (@rrosenblum)
  • #4249: Handle multiple assignment in Rails/RelativeDateConstant. (@bbatsov)
  • #4250: Improve a bit the Ruby code detection config. (@bbatsov)
  • #4283: Fix Style/EmptyCaseCondition auto-correct bug - when first when branch includes comma-delimited alternatives. (@ilansh)
  • #4268: Handle end-of-line comments when auto-correcting Style/EmptyLinesAroundAccessModifier. (@vergenzt)
  • #4275: Prevent Style/MethodCallWithArgsParentheses from blowing up on yield. (@drenmi)
  • #3969: Handle multiline method call alignment for arguments to methods. (@jonas054)
  • #4304: Allow enabling whole departments when DisabledByDefault is true. (@jonas054)
  • #4264: Prevent Rails/SaveBang from blowing up when using the assigned variable in a hash. (@drenmi)
  • #4310: Treat paths containing invalid byte sequences as non-matches. (@mclark)
  • #4063: Fix Rails/ReversibleMigration misdetection. (@gprado)
  • #4339: Fix false positive in Security/Eval cop for multiline string lietral. (@pocke)
  • #4339: Fix false negative in Security/Eval cop for Binding#eval. (@pocke)
  • #4327: Prevent Layout/SpaceInsidePercentLiteralDelimiters from registering offenses on execute-strings. (@drenmi)
  • #4371: Prevent Style/MethodName from complaining about unary operator definitions. (@drenmi)
  • #4366: Prevent Performance/RedundantMerge from blowing up on double splat arguments. (@drenmi)
  • #4352: Fix the auto-correct of Style/AndOr when Enumerable accessors ([]) are used. (@rrosenblum)
  • #4393: Prevent Style/InverseMethods from registering an offense for methods that are double negated. (@rrosenblum)
  • #4394: Prevent some cops from breaking on safe navigation operator. (@drenmi)
  • #4260: Prevent Rails/SkipsModelValidations from registering an offense for FileUtils.touch. (@rrosenblum)

0.48.1 (2017-04-03)

Changes

  • #4219: Add a link to style guide for Style/IndentationConsistency cop. (@pocke)
  • #4168: Removed -n option. (@sadovnik)
  • #4039: Change Style/PercentLiteralDelimiters default configuration to match Style Guide update. (@drenmi)
  • #4235: Improved copy of offense message in Lint/AmbiguousBlockAssociation cop. (@smakagon)

Bug fixes

  • #4171: Prevent Rails/Blank from breaking when RHS of or is a naked falsiness check. (@drenmi)
  • #4189: Make Lint/AmbiguousBlockAssociation aware of lambdas passed as arguments. (@drenmi)
  • #4179: Prevent Rails/Blank from breaking when LHS of or is a naked falsiness check. (@rrosenblum)
  • #4172: Fix false positives in Style/MixinGrouping cop. (@drenmi)
  • #4185: Make Lint/NestedMethodDefinition aware of #*_exec class of methods. (@drenmi)
  • #4197: Fix false positive in Style/RedundantSelf cop with parallel assignment. (@drenmi)
  • #4199: Fix incorrect auto correction in Style/SymbolArray and Style/WordArray cop. (@pocke)
  • #4218: Make Lint/NestedMethodDefinition aware of class shovel scope. (@drenmi)
  • #4198: Make Lint/AmbguousBlockAssociation aware of operator methods. (@drenmi)
  • #4152: Make Style/MethodCallWithArgsParentheses not require parens on setter methods. (@drenmi)
  • #4226: Show in --help output that --stdin takes a file name argument. (@jonas054)
  • #4217: Fix false positive in Rails/FilePath cop with non string argument. (@soutaro)
  • #4106: Make Style/TernaryParentheses unsafe auto-correct detector aware of literals and constants. (@drenmi)
  • #4228: Fix false positive in Lint/AmbiguousBlockAssociation cop. (@smakagon)
  • #4234: Fix false positive in Rails/RelativeDate for lambdas and procs. (@smakagon)

0.48.0 (2017-03-26)

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)
  • #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)
  • #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)

0.47.1 (2017-01-18)

Bug fixes

  • #3911: Prevent a crash in Performance/RegexpMatch cop with module definition. (@pocke)
  • #3908: Prevent Style/AlignHash from breaking on a keyword splat when using enforced table style. (@drenmi)
  • #3918: Prevent Rails/EnumUniqueness from breaking on a non-literal hash value. (@drenmi)
  • #3914: Fix department resolution for third party cops required through configuration. (@backus)
  • #3846: NodePattern works for hyphenated node types. (@alexdowad)
  • #3922: Prevent Style/NegatedIf from breaking on negated ternary. (@drenmi)
  • #3915: Fix a false positive