gems rubocop 1.88.1
RuboCop v1.88.1

8 hours ago

Bug fixes

  • #15408: Fix a crash for Bundler/GemComment with a non-literal gem option key. (@bbatsov)
  • #9571: Fix a crash for Layout/ClassStructure when a class body is a single safe-navigation call (e.g. test&.private_methods(def foo; end)). (@bbatsov)
  • #15413: Fix a crash for Gemspec/DevelopmentDependencies when AllowedGems is nil. (@bbatsov)
  • #15404: Fix a crash for Metrics/MethodLength with an anonymous define_method. (@bbatsov)
  • #15414: Fix a crash for Naming/InclusiveLanguage with nil or empty FlaggedTerms. (@bbatsov)
  • #15405: Fix a crash for Security/IoMethods with a non-string-literal argument. (@bbatsov)
  • #15330: Fix a crash for Style/EmptyStringInsideInterpolation with a modifier conditional. (@bbatsov)
  • #15351: Fix a crash for Style/OpenStructUse with a bare OpenStruct root node. (@bbatsov)
  • #15379: Fix a crash for Style/TrailingUnderscoreVariable when a nested destructuring group consists only of underscore variables. (@bbatsov)
  • #15412: Fix a false negative for Security/MarshalLoad with a proc argument. (@bbatsov)
  • #15386: Fix a false negative for Style/MethodDefParentheses with named rest arguments under EnforcedStyle: require_no_parentheses. (@bbatsov)
  • #15396: Fix a false negative for Style/MultilineMethodSignature where a signature that fits on one line was skipped because the multi-line source length was measured instead of the collapsed width. (@bbatsov)
  • #15386: Fix a false negative for Style/OptionalArguments with singleton methods. (@bbatsov)
  • #15383: Fix a false negative for Style/RedundantFilterChain with numbered-parameter blocks. (@bbatsov)
  • #15290: Fix a false negative for Lint/ToEnumArguments when a braced hash is passed to keyword parameters (e.g. to_enum(:m, { required: required })), which raises ArgumentError when the enumerator is used. (@RedZapdos123)
  • #11956: Fix a false positive for Naming/FileName when a class or module name contains multiple consecutive AllowedAcronyms. (@camallen)
  • #15324: Fix a false positive for Style/DirEmpty with a block. (@bbatsov)
  • #15326: Fix a false positive for Style/EmptyLiteral with numbered and it block parameters. (@bbatsov)
  • #15335: Fix a false positive for Style/EnvHome. (@bbatsov)
  • #15345: Fix a false positive for Style/InlineComment with rubocop:todo directives. (@bbatsov)
  • #15348: Fix a false positive for Style/MultilineIfThen. (@bbatsov)
  • #15383: Fix a false positive for Style/NumericPredicate when an allowed method encloses a numbered-parameter or it block. (@bbatsov)
  • #15389: Fix a false positive for Style/OptionHash when the options hash is forwarded with an explicit super. (@bbatsov)
  • #15350: Fix a false positive for Style/RedundantFormat with a lone format sequence. (@bbatsov)
  • #15374: Fix a false positive for Style/RedundantSelf with a rescue exception variable. (@bbatsov)
  • #15376: Fix a false positive for Style/Semicolon with a semicolon inside a string literal. (@bbatsov)
  • #15398: Fix an incorrect autocorrect for Layout/ConditionPosition that dropped a body statement sharing the condition's line via a semicolon. (@bbatsov)
  • #15399: Fix an incorrect autocorrect for Layout/EmptyComment that deleted a heredoc when removing an empty comment trailing its opener. (@bbatsov)
  • #15400: Fix an incorrect autocorrect for Layout/EmptyLineBetweenDefs that inserted a blank line inside a heredoc body when an endless method's body was a heredoc. (@bbatsov)
  • #15401: Fix an incorrect autocorrect for Layout/SpaceAroundOperators that turned **= and /= compound assignments into **//, dropping the assignment. (@bbatsov)
  • #15406: Fix an incorrect autocorrect for Naming/MemoizedInstanceVariableName. (@bbatsov)
  • #15411: Fix an incorrect autocorrect for Naming/RescuedExceptionsVariableName. (@bbatsov)
  • #15319: Fix an incorrect autocorrect for Style/DataInheritance with a brace block. (@bbatsov)
  • #15323: Fix an incorrect autocorrect for Style/EmptyCaseCondition as a yield/super argument. (@bbatsov)
  • #15323: Fix an incorrect autocorrect for Style/EmptyCaseCondition with low-precedence when values. (@bbatsov)
  • #15322: Fix an incorrect autocorrect for Style/EmptyClassDefinition with a namespaced constant. (@bbatsov)
  • #15336: Fix an incorrect autocorrect for Style/EmptyHeredoc. (@bbatsov)
  • #15332: Fix an incorrect autocorrect for Style/EvenOdd. (@bbatsov)
  • #15329: Fix an incorrect autocorrect for Style/ExactRegexpMatch with a single quote. (@bbatsov)
  • #15333: Fix an incorrect autocorrect for Style/FileNull. (@bbatsov)
  • #15334: Fix an incorrect autocorrect for Style/For. (@bbatsov)
  • #15331: Fix an incorrect autocorrect for Style/FormatString with a low-precedence argument. (@bbatsov)
  • #15331: Fix an incorrect autocorrect for Style/FormatString with a splat argument. (@bbatsov)
  • #15337: Fix an incorrect autocorrect for Style/HashSlice. (@bbatsov)
  • #15327: Fix an incorrect autocorrect for Style/HashSyntax with a multi-pair braceless return. (@bbatsov)
  • #15368: Fix an incorrect autocorrect for Style/IfWithSemicolon that changed semantics when the condition was an assignment, by parenthesizing it in the resulting ternary. (@bbatsov)
  • #15340: Fix an incorrect autocorrect for Style/KeywordArgumentsMerging with a block-pass argument. (@bbatsov)
  • #15387: Fix an incorrect autocorrect for Style/KeywordParametersOrder that inserted a spurious blank line when a keyword optional parameter already trailed the parameters list. (@bbatsov)
  • #15341: Fix an incorrect autocorrect for Style/MapIntoArray with a block-pass argument. (@bbatsov)
  • #15342: Fix an incorrect autocorrect for Style/MethodCallWithoutArgsParentheses with it() in a numbered block. (@bbatsov)
  • #15343: Fix an incorrect autocorrect for Style/MinMaxComparison with unless. (@bbatsov)
  • #15348: Fix an incorrect autocorrect for Style/MultilineMemoization with rescue/ensure. (@bbatsov)
  • #15348: Fix an incorrect autocorrect for Style/MultilineMethodSignature. (@bbatsov)
  • #15394: Fix an incorrect autocorrect for Style/NilLambda when a non-lambda proc returns nil with return. (@bbatsov)
  • #15352: Fix an incorrect autocorrect for Style/ParallelAssignment with a %i element needing quoting. (@bbatsov)
  • #15352: Fix an incorrect autocorrect for Style/ParallelAssignment with a %w element needing escaping. (@bbatsov)
  • #15366: Fix an incorrect autocorrect for Style/PercentLiteralDelimiters that produced invalid Ruby for a %s symbol whose content contains the preferred delimiter. (@bbatsov)
  • #15370: Fix an incorrect autocorrect for Style/PerlBackrefs that rewrote $+/$LAST_PAREN_MATCH to the non-equivalent Regexp.last_match(-1); these are no longer flagged. (@bbatsov)
  • #15371: Fix an incorrect autocorrect for Style/RedundantException that changed the exception message when raising RuntimeError with a nil message. (@bbatsov)
  • #15350: Fix an incorrect autocorrect for Style/RedundantFormat with a nil argument. (@bbatsov)
  • #15365: Fix an incorrect autocorrect for Style/RedundantLineContinuation that corrupted an earlier line when removing a line continuation at the end of a multi-line file. (@bbatsov)
  • #15373: Fix an incorrect autocorrect for Style/RedundantRegexpEscape that stripped a necessary \@/\$ escape after # in %r{}/%r// literals, enabling unintended interpolation. (@bbatsov)
  • #15375: Fix an incorrect autocorrect for Style/RedundantStructKeywordInit when keyword_init is not the last pair. (@bbatsov)
  • #15377: Fix an incorrect autocorrect for Style/SingleLineDoEndBlock when the block body contains a heredoc. (@bbatsov)
  • #15378: Fix an incorrect autocorrect for Style/StringHashKeys when the hash key is a heredoc. (@bbatsov)
  • #15380: Fix an incorrect autocorrect for Style/TernaryParentheses when the condition is a modifier if/unless expression. (@bbatsov)
  • #15407: Fix an infinite loop for Gemspec/RequireMFA with multiple specifications. (@bbatsov)
  • #15356: Fix an infinite loop between Lint/AssignmentInCondition and Style/RedundantParentheses when an assignment is a statement of a multi-statement begin in a condition. (@koic)
  • #14370: Fix comment duplication for Style/AccessorGrouping with a single-line trailing comment. (@bbatsov)
  • #15318: Fix --fail-fast not reporting offenses and exiting with a zero status when offenses are found. (@koic)
  • #15312: Fix false positives for Layout/BlockAlignment when EnforcedStyleAlignWith: start_of_block is used and do is on a continuation line of a parenthesisless multiline method call. (@koic)
  • #15339: Fix incorrect autocorrects for Style/HashTransformKeys and Style/HashTransformValues with a splat. (@bbatsov)
  • #15344: Fix incorrect autocorrects for Style/Lambda with block-local arguments. (@bbatsov)
  • #15311: Fix a false negative for Layout/IndentationWidth when the body of a multiline grouped expression in parentheses is not indented. (@koic)
  • #15302: Fix an incorrect autocorrect for Bundler/OrderedGems and Gemspec/OrderedDependencies when the last declaration has no trailing newline, which joined two declarations into a single line. (@koic)
  • #15307: Fix a false positive for Lint/UnescapedBracketInRegexp when a character class starts with a bare ] (e.g. /[^]]/). (@koic)

Changes

  • #15390: Mark Style/MapCompactWithConditionalBlock autocorrect as unsafe because compact also removes nil elements already present in the collection. (@bbatsov)
  • #15300: Update Metrics/PerceivedComplexity to weight simple case/in pattern branches the same as case/when branches. (@koic)

Don't miss a new rubocop release

NewReleases is sending notifications on new releases.