Releases: rubocop/rubocop
Releases · rubocop/rubocop
RuboCop 1.52.1
Bug fixes
- #11944: Fix an incorrect autocorrect for
Style/SoleNestedConditional
withStyle/MethodCallWithArgsParentheses
. (@koic) - #11930: Fix exception on
Lint/InheritException
when class definition has non-constant siblings. (@rafaelfranca) - #11919: Fix an error for
Lint/UselessAssignment
when a variable is assigned and unreferenced infor
. (@koic) - #11928: Fix an incorrect autocorrect for
Lint/AmbiguousBlockAssociation
. (@koic) - #11915: Fix a false positive for
Lint/RedundantSafeNavigation
when&.
is used forto_s
,to_i
,to_d
, and other coercion methods. (@lucthev)
Changes
RuboCop 1.52
New features
- #11873: Add
ComparisonsThreshold
config option toStyle/MultipleComparison
. (@fatkodima) - #11886: Add new
Style/RedundantArrayConstructor
cop. (@koic) - #11873: Add new
Style/RedundantRegexpConstructor
cop. (@koic) - #11841: Add new
Style/RedundantFilterChain
cop. (@fatkodima) - #11908: Support
AllowedReceivers
forStyle/CollectionMethods
. (@koic)
Bug fixes
- #11890: Fix a false negative for
Lint/RedundantSafeNavigation
when&.
is used forto_d
. (@koic) - #11880: Fix a false positive for
Style/ExactRegexpMatch
when using literal with quantifier in regexp. (@koic) - #11902: Fix a false positive for
Style/RequireOrder
when single-quoted string and double-quoted string are mixed. (@koic) - #11879: Fix a false positive for
Style/SelectByRegexp
when Ruby 2.2 or lower analysis. (@koic) - #11891: Fix
Style/AccessorGrouping
to accept macros separated from accessors by space. (@fatkodima) - #11905: Fix an error for
Lint/UselessAssignment
when a variable is assigned with rest assignment and unreferenced. (@koic) - #11899: Fix an incorrect autocorrect for
Style/SingleLineMethods
when using Ruby 3.0 andStyle/EndlessMethod
is disabled. (@koic) - #11884: Make
rubocop -V
display rubocop-factory_bot version when using it. (@koic) - #11893: Fix a false positive for
Lint/InheritException
when inheritingException
with omitted namespace. (@koic) - #11898: Fix offences in calls inside blocks with braces for
Style/MethodCallWithArgsParentheses
withomit_parentheses
enforced style. (@gsamokovarov) - #11857: Server mode: only read $stdin when -s or --stdin argument provided. (@naveg)
RuboCop 1.51 (The RubyKaigi 2023 Edition)
New features
- #11819: Add autocorrection for
Lint/AmbiguousBlockAssociation
. (@r7kamura) - #11597: Add autocorrection for
Lint/UselessAssignment
. (@r7kamura) - #11848: Add autocorrection for
Lint/Void
. (@r7kamura) - #11851: Add autocorrection for
Naming/MemoizedInstanceVariableName
. (@r7kamura) - #11856: Add autocorrection for
Style/CombinableLoops
. (@r7kamura) - #11824: Add autocorrection for
Lint/TopLevelReturnWithArgument
. (@r7kamura) - #11869: Add new
Style/ExactRegexpMatch
cop. (@koic) - #11814: Make
Style/CollectionCompact
aware ofdelete_if
. (@koic) - #11866: Make
Style/Semicolon
aware of redundant semicolons in string interpolation braces. (@koic)
Bug fixes
- #11812: Fix a false negative for
Style/Attr
when usingattr
and method definitions. (@koic) - #11861: Fix a false positive for
Layout/SpaceAfterSemicolon
when no space between a semicolon and a closing brace of string interpolation. (@koic) - #11830: Fix a false positive for
Lint/IncompatibleIoSelectWithFiberScheduler
. (@koic) - #11846: Fix a false positive for
Lint/RedundantStringCoercion
when usingto_s(argument)
inputs
argument. (@koic) - #11865: Fix an error for
Naming/ConstantName
when assigning a constant from an empty branch ofelse
. (@koic) - #11844: Fix a false positive for
Style/RedundantLineContinuation
when using line concatenation for assigning a return value and without argument parentheses. (@koic) - #11808: Fix a false positive for
Style/RegexpLiteral
when using a regexp starts with equal as a method argument. (@koic) - #11822: Fix an error for
Layout/SpaceInsideBlockBraces
when a method call with a multiline block is used as an argument. (@koic) - #11849: Fix an error for
Style/ConditionalAssignment
whenEnforcedStyle: assign_inside_condition
and using emptycase
condition. (@koic) - #11967: Fix error for
Style/IfInsideElse
when a deep nested multilineif...then...elsif...else...end
. (@koic) - #11842: Fix an error for
Style/IfUnlessModifier
when using multipleif
modifier in the long one line. (@koic) - #11835: Fix an error for
Style/RequireOrder
when multiplerequire
are not sorted. (@koic) - #11809: Fix an incorrect autocorrect for
Naming/RescuedExceptionsVariableName
when exception variable is referenced afterrescue
statement. (@koic) - #11852: Fix an incorrect autocorrect for
Style/EvalWithLocation
when usingeval
without line number and with parenthesized method call. (@koic) - #11862: Fix an incorrect autocorrect for
Style/GuardClause
when usingraise
inelse
branch in a one-liner withthen
. (@koic) - #11868: Fix a false positive for
Style/HashExcept
when method's receiver/argument is not the same as block key argument. (@fatkodima) - #11858: Fix false positives when using source comments in blocks. (@reitermarkus)
- #11510: Fix
Lint/UselessAssignment
false positive when using numbered block parameters. (@sambostock) - #11872: Fix
Gemspec/DevelopmentDependencies
not trigger when add_development_dependency has more then one arguments. (@Bhacaz) - #11820: Fix
Lint/EmptyConditionalBody
false-positives for commented emptyelsif
body. (@r7kamura)
Changes
- #11859: Add rubocop-factory_bot to suggested extensions. (@ydah)
- #11791: (Breaking) Drop runtime support for Ruby 2.6 and JRuby 9.3 (CRuby 2.6 compatible). (@koic)
- #11826: Exclude
**/*.jb
fromLint/TopLevelReturnWithArgument
. (@r7kamura) - #11871: Mark
Style/DataInheritance
as unsafe autocorrect,Style/OpenStructUse
as unsafe, andSecurity/CompoundHash
as unsafe. (@koic)
RuboCop 1.50.2
Bug fixes
RuboCop 1.50.1
Bug fixes
- #11787: Fix a false positive for
Lint/DuplicateMatchPattern
when repeatedin
patterns but differentif
guard is used. (@koic) - #11789: Fix false negatives for
Style/ParallelAssignment
when Ruby 2.7+. (@koic) - #11783: Fix a false positive for
Style/RedundantLineContinuation
using line concatenation for assigning a return value and without argument parentheses. (@koic)
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)