gems rubocop 1.93.0
RuboCop v1.93.0

2 hours ago

New features

  • #16444: Add new InternalAffairs/InvalidNodePattern cop. (@bbatsov)
  • #16454: Add new InternalAffairs/NodeSearchAsCondition cop. (@bbatsov)
  • #16447: Add new InternalAffairs/RedundantAutocorrectIncompatibleWith cop. (@bbatsov)
  • #16346: Support the experimental prism value of AllCops: ParserEngine, which builds the AST from Prism without its parser translation layer. (@bbatsov)

Bug fixes

  • #16449: Fix a false negative for Layout/FirstArgumentIndentation when the outer method call uses safe navigation. (@bbatsov)
  • #16451: Fix a false negative for Style/ArrayCoercion when checking against ::Array. (@bbatsov)
  • #16451: Fix a false negative for Style/FetchEnvVar when using ::ENV. (@bbatsov)
  • #16451: Fix a false negative for Style/RedundantInterpolationUnfreeze when using ::String.new. (@bbatsov)
  • #16449: Fix a false negative for Style/RedundantSort when sort_by with a block argument and an index method are called with safe navigation. (@bbatsov)
  • #16445: Fix a false positive for Gemspec/RubyVersionGlobalsUsage when the file has no gem specification. (@bbatsov)
  • #16452: Fix a false positive for Lint/DuplicateRequire when require is called on a namespaced constant named Kernel. (@bbatsov)
  • #16451: Fix a false positive for Lint/ShadowingOuterLocalVariable when using ::Ractor.new. (@bbatsov)
  • #16452: Fix a false positive for Lint/UselessDefaultValueArgument when new is called on a namespaced constant named Array. (@bbatsov)
  • #16452: Fix a false positive for Style/EmptyClassDefinition when new is called on a namespaced constant named Class. (@bbatsov)
  • #16505: Fix an incorrect autocorrect for Layout/LineLength with a heredoc before a multiline endless method body. (@bbatsov)
  • #16322: Fix an incorrect autocorrect for Layout/LineLength with an endless method with a heredoc. (@Starlexxx)
  • #16425: Fix an incorrect autocorrect for Lint/NonAtomicFileOperation with then. (@koic)
  • #16490: Fix an incorrect autocorrect for Lint/RedundantCopDisableDirective with a cop that becomes redundant after a correction. (@koic)
  • #16480: Fix an incorrect autocorrect for Lint/RedundantStringCoercion with a heredoc in the receiver. (@koic)
  • #16505: Fix an incorrect autocorrect for Lint/RequireRelativeSelfPath when the value of the require is used. (@bbatsov)
  • #16441: Fix an incorrect autocorrect for Lint/RequireRelativeSelfPath with code on the same line. (@Starlexxx)
  • #16416: Fix an incorrect autocorrect for Lint/UselessAssignment with the first argument of a method call without parentheses. (@koic)
  • #16505: Fix an incorrect autocorrect for Lint/UselessTimes with a heredoc or a rescue clause in the block. (@bbatsov)
  • #16479: Fix an incorrect autocorrect for Lint/UselessTimes with an inconsistently indented body. (@koic)
  • #16437: Fix an incorrect autocorrect for Style/EmptyClassDefinition with a do...end block command call. (@koic)
  • #16466: Fix an incorrect autocorrect for Style/EmptyMethod with a heredoc. (@Starlexxx)
  • #16426: Fix an incorrect autocorrect for Style/FileWrite with code after a heredoc argument. (@koic)
  • #16403: Fix an incorrect autocorrect for Style/For with a trailing comma in the loop variable. (@Starlexxx)
  • #16434: Fix an incorrect autocorrect for Style/MultilineMethodSignature with Style/MethodDefParentheses. (@koic)
  • #16415: Fix an incorrect autocorrect for Style/MultilineTernaryOperator with a heredoc. (@koic)
  • #16505: Fix an incorrect autocorrect for Style/NonNilCheck with a heredoc opened before the receiver. (@bbatsov)
  • #16421: Fix an incorrect autocorrect for Style/OperatorMethodCall with Style/TrailingCommaInArguments. (@Starlexxx)
  • #16421: Fix an incorrect autocorrect for Style/OperatorMethodCall with a trailing comma. (@Starlexxx)
  • #16470: Fix an incorrect autocorrect for Style/RaiseArgs with a trailing comma after a heredoc. (@koic)
  • #16462: Fix an incorrect autocorrect for Style/RedundantArrayConstructor with Style/TrailingCommaInArguments. (@Starlexxx)
  • #16463: Fix an incorrect autocorrect for Style/RedundantArrayConstructor with a comment or heredoc outside the array literal. (@Starlexxx)
  • #16478: Fix an incorrect autocorrect for Style/RedundantBegin with code after a modifier condition. (@koic)
  • #16505: Fix an incorrect autocorrect for Style/RedundantEach with .each on its own line. (@bbatsov)
  • #16464: Fix an incorrect autocorrect for Style/RedundantException with a heredoc or comment in the removed source. (@Starlexxx)
  • #16469: Fix an incorrect autocorrect for Style/RedundantInitialize with a method definition used as a value. (@koic)
  • #16471: Fix an incorrect autocorrect for Style/RedundantInterpolationUnfreeze with Style/TrailingCommaInArguments. (@koic)
  • #16468: Fix an incorrect autocorrect for Style/StructInheritance and Style/DataInheritance with code after end. (@koic)
  • #16435: Fix an infinite loop for Layout/EmptyLinesAroundAccessModifier with a conditional access modifier in a block. (@koic)
  • #16436: Fix an infinite loop for Layout/EmptyLinesAroundClassBody and Layout/EmptyLinesAroundModuleBody with a statement on the class line. (@koic)
  • #16497: Avoid dropping heredoc bodies when correcting Style/DigChain. (@Starlexxx)
  • #16494: Avoid dropping heredocs and comments when correcting Style/RedundantRegexpConstructor. (@Starlexxx)
  • #16481: Avoid Style/EachWithObject when next changes the accumulator. (@Starlexxx)
  • #16450: Fix false negatives for Style/ArgumentsForwarding when anonymous arguments are all forwarded in a singleton method or with safe navigation. (@bbatsov)
  • #16448: Fix false negatives for Style/FileRead when the block uses a numbered parameter or it. (@bbatsov)
  • #16448: Fix false negatives for Style/FileWrite when the block uses a numbered parameter or it. (@bbatsov)
  • #16448: Fix false negatives for Style/HashTransformKeys and Style/HashTransformValues when the receiver is a block that uses a numbered parameter or it. (@bbatsov)
  • #16503: Fix false positives for Lint/DuplicateMethods when a method is redefined after undef, undef_method, or remove_method. (@APX403)
  • #16452: Fix false positives for Style/HashTransformKeys and Style/HashTransformValues when [] is called on a namespaced constant named Hash. (@bbatsov)
  • #16473: Preserve code after end when Style/SoleNestedConditional merges conditions. (@Starlexxx)
  • #16487: Preserve code sharing the else line in Style/NegatedIfElseCondition. (@Starlexxx)
  • #16493: Preserve escaped quotes when correcting Style/RedundantPercentQ with Style/RedundantStringEscape. (@Starlexxx)
  • #16484: Preserve heredoc bodies in Style/ArrayIntersect corrections. (@Starlexxx)
  • #16486: Preserve heredoc bodies in Style/NilComparison corrections. (@Starlexxx)
  • #16483: Preserve heredoc bodies in Style/NonNilCheck corrections. (@Starlexxx)
  • #16489: Preserve heredoc bodies in Style/RedundantInterpolation corrections. (@Starlexxx)
  • #16496: Preserve heredoc keys when correcting Style/SingleArgumentDig. (@Starlexxx)
  • #16485: Preserve heredocs and comments in Lint/NumberConversion corrections. (@Starlexxx)
  • #16501: Preserve heredocs and comments when correcting Lint/LambdaWithoutLiteralBlock. (@Starlexxx)
  • #16500: Preserve heredocs and comments when correcting Lint/UselessNumericOperation. (@Starlexxx)
  • #16502: Preserve heredocs and comments when correcting Style/RedundantSelfAssignment. (@Starlexxx)
  • #16488: Preserve neighboring statements in Style/SwapValues corrections. (@Starlexxx)
  • #16482: Preserve non-local break in Style/NilLambda. (@Starlexxx)
  • #16498: Preserve source between calls when correcting Style/RedundantEach. (@Starlexxx)
  • #16476: Replace only block argument references in Lint/UselessTimes. (@Starlexxx)
  • #16504: Fix TargetRubyVersion not being validated in a configuration file given with --config. (@bbatsov)

Changes

  • #16346: Report a ParserEngine that cannot parse the target Ruby version, or that needs the parser gem when it is not installed, as a configuration error instead of a backtrace. (@bbatsov)
  • #16346: Require RuboCop AST 1.54, which makes prism the default parser engine for Ruby 3.3+ when Prism 2.0 or later is installed. (@bbatsov)
  • #16346: Make Cop::Base#parse use the Ruby version and the parser engine of the source under investigation. (@bbatsov)
  • #16346: Parse the gemspec file with Prism when looking for the target Ruby version, unless ParserEngine is parser_whitequark. (@bbatsov)
  • #16346: Make rubocop -V show the parser engine that is used when AllCops: ParserEngine is not set. (@bbatsov)

Don't miss a new rubocop release

NewReleases is sending notifications on new releases.