Releases: rubocop/rubocop
Releases · rubocop/rubocop
RuboCop 1.50
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 afterdef
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
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 ofClass#to_s
andClass#inspect
for class equality comparison. (@koic) - #11737: Make
Style/MapToHash
andStyle/MapToSet
aware of numbered parameters. (@koic) - #11732: Make
Style/MapToHash
andStyle/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 onlysuper
call. (@koic) - #11723: Fix a false positive for
Style/IfUnlessModifier
when using one-line pattern matching as aif
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 violatesLayout/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
RuboCop 1.48.1
Bug fixes
- #11673: Fix incorrect
Style/HashSyntax
autocorrection for assignment methods. (@gsamokovarov) - #11682: Fix a false positive for
Lint/UselessRescue
when usingThread#raise
inrescue
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 whenEnabled: false
ofLint
department. (@koic) - #11677: Fix the severity for
Lint/Syntax
. (@koic) - #11691: Fix an error for
Gemspec/DependencyVersion
when method called on gem name argument foradd_dependency
. (@koic)
RuboCop 1.48
New features
Bug fixes
- #11654: Fix a false positive for
Lint/MissingSuper
when nosuper
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 theincluded
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 Sorbetsig {}
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 forStyle/CaseLikeIf
cop. (@fatkodima)
RuboCop 1.47
New features
- #11475: Add autocorrect for hash in
Lint/LiteralInInterpolation
. (@KessaPassa) - #11584: Add
Metrics/CollectionLiteralLength
cop. (@sambostock)
Bug fixes
- #11615: Fix a false negative for
Lint/MissingSuper
when nosuper
call withClass.new
block. (@koic) - #11615: Fix a false negative for
Lint/MissingSuper
when usingClass.new
without parent class argument. (@koic) - #11040: Fix a false positive for
Style/IfUnlessModifier
whendefined?
'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 usingFile.new(path).size.zero?
. (@koic) - #11620: Fix an error for
Lint/ConstantResolution
when using__ENCODING__
. (@koic) - #11625: Fix an error for
Lint/EmptyConditionalBody
when missingif
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
anduntil
expressions inLint/UselessAssignment
. (@bfad) - #11202: Fixed usage of
--only
flag with--auto-gen-config
. (@istvanfazakas)
Changes
RuboCop 1.46
New features
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
whenp
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
whenrescue
does not exception variable andensure
has empty body. (@koic) - #11608: Fix an error for
Lint/RefinementImportMethods
when usinginclude
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
inStyle/DocumentationMethod
cop. (@fatkodima) - #11604: Make
Naming/VariableNumber
to allowx86_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
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
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'sData.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 usingKernel.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'sData.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 inStyle/DocumentationMethod
. (@koic) - #11541: Enable autocorrection for
Layout/LineContinuationLeadingSpace
. (@eugeneius) - #11542: Mark
Layout/AssignmentIndentation
as safe andLint/AssignmentInCondition
as unsafe for autocorrection. (@eugeneius) - #11517: Make
Lint/Debugger
aware ofp
,PP.pp
, andpp
methods. (@koic) - #11539: Remove
bundler
from defaultAllowedGems
ofGemspec/DevelopmentDependencies
. (@koic)
RuboCop 1.44.1
Bug fixes
- #11492: Fix an error for
Lint/Void
when configuringCheckForMethodsWithNoSideEffects: true
. (@koic) - #11400: Fix an incorrect autocorrect for
Naming/BlockForwarding
andLint/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
New features
- #11410: Add new
Style/InvertibleUnlessCondition
cop. (@fatkodima) - #11338: Add new
Style/ComparableClamp
cop. (@koic) - #11350: Make
Lint/DeprecatedClassMethods
aware of deprecatedattr
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 inensure
clause. (@koic) - #11460: Fix an error for
Style/OperatorMethodCall
when usingfoo.> 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 usingpretty_inspect
. (@koic) - #11439: Fix an incorrect autocorrect for
Style/MinMaxComparison
when usinga < b a : b
withelsif/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)