Skip to content

Releases: rubocop/rubocop

RuboCop 1.50

11 Apr 07:15
Compare
Choose a tag to compare

New features

  • #11749: Add new Lint/DuplicateMatchPattern cop. (@koic)
  • #11773: Make Layout/ClassStructure aware of singleton class. (@koic)
  • #11779: Make Lint/RedundantStringCoercion aware of print method arguments. (@koic)
  • #11776: Make Metrics/ClassLength aware of singleton class. (@koic)
  • #11775: Make Style/TrailingBodyOnClass aware of singleton class. (@koic)

Bug fixes

  • #11758: Fix a false positive for Style/RedundantLineContinuation when line continuations for string. (@koic)
  • #11754: Fix a false positive for Style/RedundantLineContinuation when using && and || with a multiline condition. (@ydah)
  • #11765: Fix an error for Style/MultilineMethodSignature when line break after def keyword. (@koic)
  • #11762: Fix an incorrect autocorrect for Style/ClassEqualityComparison when comparing a variable or return value for equality. (@koic)
  • #11752: Fix a false positive for Style/RedundantLineContinuation when using line concatenation and calling a method without parentheses. (@koic)

RuboCop 1.49

03 Apr 07:09
Compare
Choose a tag to compare

New features

  • #11122: Add new Style/RedundantLineContinuation cop. (@ydah)
  • #11696: Add new Style/DataInheritance cop. (@ktopolski)
  • #11746: Make Layout/EndAlignment aware of pattern matching. (@koic)
  • #11750: Make Metrics/BlockNesting aware of numbered parameter. (@koic)
  • #11699: Make Style/ClassEqualityComparison aware of Class#to_s and Class#inspect for class equality comparison. (@koic)
  • #11737: Make Style/MapToHash and Style/MapToSet aware of numbered parameters. (@koic)
  • #11732: Make Style/MapToHash and Style/MapToSet aware of symbol proc. (@koic)
  • #11703: Make Naming/InclusiveLanguage support autocorrection when there is only one suggestion. (@koic)

Bug fixes

  • #11730: Fix an error for Layout/HashAlignment when using anonymous keyword rest arguments. (@koic)
  • #11704: Fix a false positive for Lint/UselessMethodDefinition when method definition with non access modifier containing only super call. (@koic)
  • #11723: Fix a false positive for Style/IfUnlessModifier when using one-line pattern matching as a if condition. (@koic)
  • #11725: Fix an error when insufficient permissions to server cache dir are granted. (@koic)
  • #11715: Ensure default configuration loads. (@koic)
  • #11742: Fix error handling in bundler standalone mode. (@composerinteralia)
  • #11712: Fix a crash in Lint/EmptyConditionalBody. (@gsamokovarov)
  • #11641: Fix a false negative for Layout/ExtraSpacing when there are many comments with extra spaces. (@nobuyo)
  • #11740: Fix a false positive for Lint/NestedMethodDefinition when nested definition inside *_eval and *_exec method call with a numblock. (@ydah)
  • #11685: Fix incorrect directive comment insertion when percent array violates Layout/LineLength cop. (@nobuyo)
  • #11706: Fix infinite loop when --disable-uncorrectable option and there is a multi-line percent array violates Layout/LineLength. (@nobuyo)
  • #11697: Fix Lint/Syntax behavior when --only is not given the cop name. (@koic)
  • #11709: Fix value omission false positive in Style/MethodCallWithArgsParentheses. (@gsamokovarov)

Changes

  • #11739: Make Style/RedundantParentheses aware of redundant method argument parentheses. (@koic)
  • #10766: Use the path given by --cache-root to be the parent for rubocop_cache dir like other ways to specify it. (@nobuyo)

RuboCop 1.48.1

13 Mar 07:00
Compare
Choose a tag to compare

Bug fixes

  • #11673: Fix incorrect Style/HashSyntax autocorrection for assignment methods. (@gsamokovarov)
  • #11682: Fix a false positive for Lint/UselessRescue when using Thread#raise in rescue clause. (@koic)
  • #11672: Fix an error for Layout/BlockEndNewline when multiline block } is not on its own line and it is used as multiple arguments. (@koic)
  • #11675: Style/AccessorGrouping: Fix sibling detection for methods with type sigs. (@issyl0)
  • #11658: Fix Lint/Debugger should not allow pry. (@ThHareau)
  • #11689: Fix Lint/Syntax behavior when Enabled: false of Lint department. (@koic)
  • #11677: Fix the severity for Lint/Syntax. (@koic)
  • #11691: Fix an error for Gemspec/DependencyVersion when method called on gem name argument for add_dependency. (@koic)

RuboCop 1.48

06 Mar 09:50
Compare
Choose a tag to compare

New features

Bug fixes

  • #11654: Fix a false positive for Lint/MissingSuper when no super call and when defining some method. (@koic)
  • #11661: Fix an error for Style/Documentation when namespace is a variable. (@koic)
  • #11647: Fix an error for Style/IfWithBooleanLiteralBranches when using () as a condition. (@koic)
  • #11646: Fix an error for Style/NegatedIfElseCondition when using () as a condition. (@koic)
  • #11659: Fix an incorrect autocorrect for Lint/OrAssignmentToConstant when using or-assignment to a constant in method definition. (@koic)
  • #11663: Fix an incorrect autocorrect for Style/BlockDelimiters when multi-line blocks to { and } with arithmetic operation method chain. (@koic)
  • #11638: Fix a false positive for Lint/UselessAccessModifier when using same access modifier inside and outside the included block. (@ydah)
  • #11164: Suppress server mode message with -f json. (@jasondoc3)
  • #11643: Fix incorrect shorthand autocorrections in calls inside parentheses. (@gsamokovarov)
  • #11650: Style/AccessorGrouping: Fix detection of Sorbet sig {} blocks. (@issyl0)
  • #11657: Use cop name to check if cop inside registry is enabled. Previously, it was able to cause large memory usage during linting. (@fatkodima)

Changes

  • #11482: Avoid comment deletion by Style/IfUnlessModifier when the modifier form expression has long comment. (@nobuyo)
  • #11649: Support MinBranchesCount config for Style/CaseLikeIf cop. (@fatkodima)

RuboCop 1.47

01 Mar 11:29
Compare
Choose a tag to compare

New features

Bug fixes

  • #11615: Fix a false negative for Lint/MissingSuper when no super call with Class.new block. (@koic)
  • #11615: Fix a false negative for Lint/MissingSuper when using Class.new without parent class argument. (@koic)
  • #11040: Fix a false positive for Style/IfUnlessModifier when defined?'s argument value is undefined. (@koic)
  • #11607: Fix a false positive for Style/RedundantRegexpEscape when an escaped hyphen follows after an escaped opening square bracket within a character class. (@SparLaimor)
  • #11626: Fix a false positive for Style/ZeroLengthPredicate when using File.new(path).size.zero?. (@koic)
  • #11620: Fix an error for Lint/ConstantResolution when using __ENCODING__. (@koic)
  • #11625: Fix an error for Lint/EmptyConditionalBody when missing if body and using method call for return value. (@koic)
  • #11631: Fix an incorrect autocorrect for Style/ArgumentsForwarding when using arguments forwarding for .() call. (@koic)
  • #11621: Fix an incorrect autocorrect for Layout/ClassStructure using heredoc inside method. (@fatkodima)
  • #3591: Handle modifier while and until expressions in Lint/UselessAssignment. (@bfad)
  • #11202: Fixed usage of --only flag with --auto-gen-config. (@istvanfazakas)

Changes

  • #11623: Add rubocop-capybara to suggested extensions and extension doc. (@ydah)

RuboCop 1.46

22 Feb 18:46
Compare
Choose a tag to compare

New features

  • #11569: Support TargetRubyVersion 3.3 (experimental). (@koic)

Bug fixes

  • #11574: Fix a broken shorthand syntax autocorrection. (@gsamokovarov)
  • #11599: Fix a false positive for Layout/LineContinuationSpacing when using percent literals. (@koic)
  • #11556: Fix a false positive for Lint/Debugger when p is an argument of method call. (@koic)
  • #11591: Fix a false positive for Lint/ToEnumArguments when enumerator is not created for __callee__ and __callee__ methods. (@koic)
  • #11603: Actually run temporarily enabled cops. (@tdeo)
  • #11579: Fix an error for Layout/HeredocArgumentClosingParenthesis when heredoc is a method argument in a parenthesized block argument. (@koic)
  • #11576: Fix an error for Lint/UselessRescue when rescue does not exception variable and ensure has empty body. (@koic)
  • #11608: Fix an error for Lint/RefinementImportMethods when using include on the top level. (@koic)
  • #11589: Fix an error for Layout/HeredocArgumentClosingParenthesis when heredoc is a branch body in a method argument of a parenthesized argument. (@koic)
  • #11567: Fix Layout/EndAlignment false negative. (@j-miyake)
  • #11582: Fix checking if token with large offset begins its line. (@fatkodima)
  • #11412: Mark Style/ArrayIntersect as unsafe. (@koic)
  • #11559: Fixed false positives and negatives in Style/RedundantRegexpCharacterClass when using octal escapes (e.g. "\0"). (@jaynetics)
  • #11575: Fix parentheses in value omissions for multiple assignments. (@gsamokovarov)

Changes

  • #11586: Handle ruby2_keywords in Style/DocumentationMethod cop. (@fatkodima)
  • #11604: Make Naming/VariableNumber to allow x86_64 CPU architecture name by default. (@koic)
  • #11596: Make Style/AccessorGrouping aware of method call before accessor. (@koic)
  • #11588: Optimize Style/WordArray complex matrix check. (@sambostock)
  • #11573: Handle hash patterns and pins in Lint/OutOfRangeRegexpRef cop. (@fatkodima)
  • #11564: Remove print debug methods from default for Lint/Debugger. (@koic)

RuboCop 1.45.1

08 Feb 17:38
Compare
Choose a tag to compare

Bug fixes

  • #11552: Fix a false positive for Lint/Debugger when methods containing different method chains. (@ydah)
  • #11548: Fix an error for Style/AccessModifierDeclarations when if a non method definition was included. (@ydah)
  • #11554: Fix an error for Style/RedundantCondition when the branches contains empty hash literal argument. (@koic)
  • #11549: Fix an error for third party cops when inheriting RuboCop::Cop::Cop. (@koic)

RuboCop 1.45

08 Feb 12:30
Compare
Choose a tag to compare

New features

  • #10839: Add API for 3rd party template support. (@r7kamura)
  • #11528: Add new Style/RedundantHeredocDelimiterQuotes cop. (@koic)
  • #11188: Add a --no-detach option for --start-server. This will start the server process in the foreground, which can be helpful when running within Docker where detaching the process terminates the container. (@f1sherman)
  • #11546: Make Lint/UselessAccessModifier aware of Ruby 3.2's Data.define. (@koic)
  • #11396: Add ability to profile rubocop execution via --profile and --memory options. (@fatkodima)

Bug fixes

  • #11491: Fix a crash on Lint/UselessAssignment. (@gsamokovarov)
  • #11515: Fix a false negative for Naming/HeredocDelimiterNaming when using lowercase. (@koic)
  • #11511: Fix a false negative for Style/YodaCondition when using constant. (@koic)
  • #11520: Fix a false negative for Style/YodaExpression when using constant. (@koic)
  • #11521: Fix a false positive for Lint/FormatParameterMismatch when using Kernel.format with the interpolated number of decimal places fields match. (@koic)
  • #11545: Fix the following false positive for Lint/NestedMethodDefinition when using numbered parameter. (@koic)
  • #11535: Fix a false positive for Style/NumberedParametersLimit when only _2 or higher numbered parameter is used. (@koic)
  • #11508: Fix a false positive for Style/OperatorMethodCall when using multiple arguments for operator method. (@koic)
  • #11503: Fix a false positive for Style/RedundantCondition when using method argument with operator. (@koic)
  • #11529: Fix an incorrect autocorrect for Layout/ClassStructure when definitions that need to be sorted are defined alternately. (@ydah)
  • #11530: Fix an incorrect autocorrect for Style/AccessModifierDeclarations when multiple groupable access modifiers are defined. (@ydah)
  • #10910: Fix an incorrect autocorrect for Style/MultilineTernaryOperator when contains a comment. (@ydah)
  • #11522: Don't flag default keyword arguments in Style/ArgumentsForwarding. (@splattael)
  • #11547: Fix a false positive for Lint/NestedMethodDefinition when using Ruby 3.2's Data.define. (@koic)
  • #11537: Fix an infinite loop error for Layout/ArrayAlignment when using assigning unbracketed array elements. (@koic)
  • #11516: Fix missing parentheses in shorthand hash syntax as argument calls. (@gsamokovarov)

Changes

  • #11504: Allow initialize method in Style/DocumentationMethod. (@koic)
  • #11541: Enable autocorrection for Layout/LineContinuationLeadingSpace. (@eugeneius)
  • #11542: Mark Layout/AssignmentIndentation as safe and Lint/AssignmentInCondition as unsafe for autocorrection. (@eugeneius)
  • #11517: Make Lint/Debugger aware of p, PP.pp, and pp methods. (@koic)
  • #11539: Remove bundler from default AllowedGems of Gemspec/DevelopmentDependencies. (@koic)

RuboCop 1.44.1

25 Jan 12:36
Compare
Choose a tag to compare

Bug fixes

  • #11492: Fix an error for Lint/Void when configuring CheckForMethodsWithNoSideEffects: true. (@koic)
  • #11400: Fix an incorrect autocorrect for Naming/BlockForwarding and Lint/AmbiguousOperator when autocorrection conflicts for ambiguous splat argument. (@fatkodima)
  • #11483: Fix Layout/ClosingParenthesisIndentation for keyword splat arguments. (@fatkodima)
  • #11487: Fix a false positive for Lint/FormatParameterMismatch when format string is only interpolated string. (@ydah)
  • #11485: Fix a false positive for Lint/UselessAssignment when using numbered block parameter. (@koic)

RuboCop 1.44

23 Jan 10:47
Compare
Choose a tag to compare

New features

  • #11410: Add new Style/InvertibleUnlessCondition cop. (@fatkodima)
  • #11338: Add new Style/ComparableClamp cop. (@koic)
  • #11350: Make Lint/DeprecatedClassMethods aware of deprecated attr with boolean 2nd argument. (@koic)
  • #11457: Make Metrics/BlockNesting aware of pattern matching. (@koic)
  • #11458: Make Metrics/CyclomaticComplexity aware of pattern matching. (@koic)
  • #11469: Add Gemspec/DevelopmentDependencies cop. (@sambostock)

Bug fixes

  • #11445: Fix an incorrect autocorrect for Style/BlockDelimiters when there is a comment after the closing brace and bracket. (@koic)
  • #11428: Apply value omission exceptions in super invocations. (@gsamokovarov)
  • #11420: Fix a false positive for Lint/UselessRescue when using exception variable in ensure clause. (@koic)
  • #11460: Fix an error for Style/OperatorMethodCall when using foo.> 42. (@koic)
  • #11456: Fix value omissions in yield invocations. (@gsamokovarov)
  • #11467: Fix a false negative for Style/MethodCallWithoutArgsParentheses when calling method on a receiver and assigning to a variable with the same name. (@koic)
  • #11430: Fix an infinite loop error for Layout/BlockEndNewline when multiline blocks with newlines before the ; end. (@koic)
  • #11442: Fix a crash during anonymous rest argument forwarding. (@gsamokovarov)
  • #11447: Fix an incorrect autocorrect for Style/RedundantDoubleSplatHashBraces when using nested double splat hash braces. (@koic)
  • #11459: Make Lint/UselessRuby2Keywords aware of conditions. (@splattael)
  • #11415: Fix a false positive for Lint/UselessMethodDefinition when method definition contains rest arguments. (@koic)
  • #11418: Fix a false positive for Style/MethodCallWithArgsParentheses when using anonymous rest arguments or anonymous keyword rest arguments. (@koic)
  • #11431: Fix a crash in Style/HashSyntax. (@gsamokovarov)
  • #11444: Fix a false positive for Lint/ShadowingOuterLocalVariable when using numbered block parameter. (@koic)
  • #11477: Fix an error when using YAML alias with server mode. (@koic)
  • #11419: Fix a false positive for Style/RedundantRequireStatement when using pretty_inspect. (@koic)
  • #11439: Fix an incorrect autocorrect for Style/MinMaxComparison when using a < b a : b with elsif/else. (@ydah)
  • #11464: Fix a false negative for Lint/FormatParameterMismatch when include interpolated string. (@ydah)
  • #11425: Fix a false negative for Lint/Void when using methods that takes blocks. (@krishanbhasin-shopify)
  • #11437: Fix an error for Style/AccessModifierDeclarations when access modifier is inlined with a method on the top level. (@koic)
  • #11455: Fix crash with super value_omission: followed by a method call. (@gsamokovarov)

Changes

  • #11465: Make Style/Semicolon aware of redundant semicolon in block. (@koic)
  • #11471: Change to not output not configured warning when renamed and pending cop. (@ydah)