chore(deps): update dependency rubocop to v0.93.1
This MR contains the following updates:
Package | Update | Change |
---|---|---|
rubocop (source, changelog) | minor |
0.59.2 -> 0.93.1
|
Release Notes
rubocop/rubocop (rubocop)
v0.93.1
Bug fixes
-
#8782: Fix incorrect autocorrection for
Style/TernaryParentheses
withdefined?
. ([@dvandersluis][]) -
#8867: Rework
Lint/RedundantSafeNavigation
to be more safe. ([@fatkodima][]) -
#8864: Fix false positive for
Style/RedundantBegin
with a postfixwhile
oruntil
. ([@dvandersluis][]) -
#8869: Fix a false positive for
Style/RedundantBegin
when usingbegin
for or assignment and method call. ([@koic][]) -
#8862: Fix an error for
Lint/AmbiguousRegexpLiteral
when using regexp without method calls in nested structure. ([@koic][]) -
#8872: Fix an error for
Metrics/ClassLength
when multiple assignments to constants. ([@koic][]) -
#8871: Fix a false positive for
Style/RedundantBegin
when usingbegin
for method argument or part of conditions. ([@koic][]) -
#8875: Fix an incorrect auto-correct for
Style/ClassEqualityComparison
when comparing class name. ([@koic][]) -
#8880: Fix an error for
Style/ClassLength
when overlapping constant assignments. ([@koic][])
v0.93.0
New features
-
#8796: Add new
Lint/HashCompareByIdentity
cop. ([@fatkodima][]) -
#8833: Add new
Style/ClassEqualityComparison
cop. ([@fatkodima][]) -
#8668: Add new
Lint/RedundantSafeNavigation
cop. ([@fatkodima][]) - #8842: Add notification about cache being used to debug mode. ([@hatkyinc2][])
-
#8822: Make
Style/RedundantBegin
aware ofbegin
withoutrescue
orensure
. ([@koic][]) -
#7940: Add new
Lint/NoReturnInBeginEndBlocks
cop. ([@jcfausto][])
Bug fixes
-
#8810: Fix multiple offense detection for
Style/RaiseArgs
. ([@pbernays][]) -
#8151: Fix a false positive for
Lint/BooleanSymbol
when used within%i[...]
. ([@fatkodima][]) -
#8809: Fix multiple offense detection for
Style/For
. ([@pbernays][]) -
#8801: Fix
Layout/SpaceAroundEqualsInParameterDefault
only registered once in a line. ([@rdunlop][]) -
#8514: Correct multiple
Style/MethodDefParentheses
per file. ([@rdunlop][]) -
#8825: Fix crash in
Style/ExplicitBlockArgument
when code is called outside of a method. ([@ghiculescu][]) - #8718: Fix undefined methods of pseudo location. ([@ybiquitous][])
-
#8354: Detect regexp named captures in
Style/CaseLikeIf
cop. ([@dsavochkin][]) -
#8821: Fix an incorrect autocorrect for
Style/NestedTernaryOperator
when using a nested ternary operator expression with no parentheses on the outside. ([@koic][]) -
#8834: Fix a false positive for
Style/ParenthesesAsGroupedExpression
when method argument parentheses are omitted and hash argument key is enclosed in parentheses. ([@koic][]) -
#8830: Fix bad autocorrect of
Style/StringConcatenation
when string includes double quotes. ([@tleish][]) -
#8807: Fix a false positive for
Style/RedundantCondition
when using assignment by hash key access. ([@koic][]) -
#8848: Fix a false positive for
Style/CombinableLoops
when using the same method with different arguments. ([@dvandersluis][]) -
#8843: Fix an incorrect autocorrect for
Lint/AmbiguousRegexpLiteral
when sending method to regexp literal receiver. ([@koic][]) - #8842: Save actual status to cache, except corrected. ([@hatkyinc2][])
-
#8835: Fix an incorrect autocorrect for
Style/RedundantInterpolation
when using string interpolation for non-operator methods. ([@koic][]) -
#7495: Example for
Lint/AmbiguousBlockAssociation
cop. ([@AllanSiqueira][]) -
#8855: Fix an error for
Layout/EmptyLinesAroundAccessModifier
andStyle/AccessModifierDeclarations
when using only access modifier. ([@koic][])
Changes
-
#8803: (Breaking)
RegexpNode#parsed_tree
now processes regexps including interpolation (by blanking the interpolation before parsing, rather than skipping). ([@owst][]) -
#8625: Improve
Style/RedundantRegexpCharacterClass
andStyle/RedundantRegexpEscape
by usingregexp_parser
gem. ([@owst][]) -
#8646: Faster find of all files in
TargetFinder
class which improves initial startup speed. ([@tleish][]) -
#8102: Consider class length instead of block length for
Struct.new
. ([@tejasbubane][]) -
#7408: Make
Gemspec/RequiredRubyVersion
cop aware ofGem::Requirement
. ([@tejasbubane][])
v0.92.0
New features
-
#8778: Add command line option
--regenerate-todo
. ([@dvandersluis][]) -
#8790: Add
AllowedMethods
option toStyle/OptionalBooleanParameter
cop. ([@fatkodima][]) -
#8738: Add autocorrection to
Style/DateTime
. ([@dvandersluis][])
Bug fixes
-
#8774: Fix a false positive for
Layout/ArrayAlignment
with parallel assignment. ([@dvandersluis][])
Changes
- #8785: Update TargetRubyVersion 2.8 to 3.0 (experimental). ([@koic][])
-
#8650: Faster find of hidden files in
TargetFinder
class which improves rubocop initial startup speed. ([@tleish][]) -
#8783: Disable
Style/ArrayCoercion
cop by default. ([@koic][])
v0.91.1
Bug fixes
-
#8720: Fix an error for
Lint/IdentityComparison
when callingobject_id
method without receiver in LHS or RHS. ([@koic][]) -
#8767: Fix a false positive for
Style/RedundantReturn
when a rescue has an else clause. ([@fatkodima][]) -
#8710: Fix a false positive for
Layout/RescueEnsureAlignment
whenLayout/BeginEndAlignment
cop is not enabled status. ([@koic][]) -
#8726: Fix a false positive for
Naming/VariableNumber
when naming multibyte character variable name. ([@koic][]) -
#8730: Fix an error for
Lint/UselessTimes
when there is a blank line in the method definition. ([@koic][]) -
#8740: Fix a false positive for
Style/HashAsLastArrayItem
when the hash is in an implicit array. ([@dvandersluis][]) -
#8739: Fix an error for
Lint/UselessTimes
when using empty block argument. ([@koic][]) -
#8742: Fix some assignment counts for
Metrics/AbcSize
. ([@marcandre][]) -
#8750: Fix an incorrect auto-correct for
Style/MultilineWhenThen
when line break for multiple candidate values ofwhen
statement. ([@koic][]) -
#8754: Fix an error for
Style/RandomWithOffset
when using a range with non-integer bounds. ([@eugeneius][]) -
#8756: Fix an infinite loop error for
Layout/EmptyLinesAroundAccessModifier
withLayout/EmptyLinesAroundBlockBody
when using access modifier with block argument. ([@koic][]) -
#8372: Fix
Lint/RedundantCopEnableDirective
autocorrection to not leave orphaned empty# rubocop:enable
comments. ([@dvandersluis][]) -
#8372: Fix
Lint/RedundantCopDisableDirective
autocorrection. ([@dvandersluis][]) -
#8764: Fix
Layout/CaseIndentation
not showing the cop name in output messages. ([@dvandersluis][]) -
#8771: Fix an error for
Style/OneLineConditional
when usingif-then-elsif-then-end
. ([@koic][]) -
#8576: Fix
Style/IfUnlessModifier
to ignore cop disable comment directives when considering conversion to the modifier form. ([@dsavochkin][])
Changes
-
#8489: Exclude method
respond_to_missing?
fromOptionalBooleanParameter
cop. ([@em-gazelle][]) -
#7914:
Style/SafeNavigation
marked as having unsafe auto-correction. ([@marcandre][]) -
#8749: Disable
Style/IpAddresses
by default inGemfile
and gemspec files. ([@dvandersluis][])
v0.91.0
New features
- New option
--cache-root
and support for theRUBOCOP_CACHE_ROOT
environment variable. Both can be used to override theAllCops: CacheRootDirectory
config, especially in a CI setting. ([@sascha-wolf][]) -
#8582: Add new
Layout/BeginEndAlignment
cop. ([@koic][]) -
#8699: Add new
Lint/IdentityComparison
cop. ([@koic][]) - Add new
Lint/UselessTimes
cop. ([@dvandersluis][]) -
#8707: Add new
Lint/ConstantDefinitionInBlock
cop. ([@eugeneius][])
Bug fixes
-
#8627: Fix a false positive for
Lint/DuplicateRequire
when same feature argument but different require method. ([@koic][]) -
#8674: Fix an error for
Layout/EmptyLineAfterMultilineCondition
when conditional is at the top level. ([@fatkodima][]) -
#8658: Fix a false positive for
Style/RedundantSelfAssignment
when calling coercion methods. ([@fatkodima][]) -
#8669: Fix an offense creation for
Lint/EmptyFile
. ([@fatkodima][]) -
#8607: Fix a false positive for
Lint/UnreachableLoop
when conditional branch includes continue statement preceding break statement. ([@fatkodima][]) -
#8572: Fix a false positive for
Style/RedundantParentheses
when parentheses are used like method argument parentheses. ([@koic][]) -
#8630: Fix some false positives for
Style/HashTransformKeys
andStyle/HashTransformValues
when the receiver is an array. ([@eugeneius][]) -
#8653: Fix a false positive for
Layout/DefEndAlignment
when using refinements andprivate def
. ([@koic][]) -
#8655: Fix a false positive for
Style/ClassAndModuleChildren
when using cbase class name. ([@koic][]) -
#8654: Fix a false positive for
Style/SafeNavigation
when checkingfoo&.empty?
in a conditional. ([@koic][]) -
#8660: Fix a false positive for
Style/ClassAndModuleChildren
when using cbase module name. ([@koic][]) -
#8664: Fix a false positive for
Naming/BinaryOperatorParameterName
when naming multibyte character method name. ([@koic][]) -
#8604: Fix a false positive for
Bundler/DuplicatedGem
when gem is duplicated in condition. ([@tejasbubane][]) -
#8671: Fix an error for
Style/ExplicitBlockArgument
when using safe navigation method call. ([@koic][]) -
#8681: Fix an error for
Style/HashAsLastArrayItem
withno_braces
for empty hash. ([@fsateler][]) -
#8682: Fix a positive for
Style/HashTransformKeys
andStyle/HashTransformValues
when theeach_with_object
hash is used in the transformed key or value. ([@eugeneius][]) -
#8688: Mark
Style/GlobalStdStream
as unsafe autocorrection. ([@marcandre][]) -
#8642: Fix a false negative for
Style/SpaceInsideHashLiteralBraces
when a correct empty hash precedes the incorrect hash. ([@dvandersluis][]) - #8683: Make naming cops work with non-ascii characters. ([@tejasbubane][])
-
#8626: Fix false negatives for
Lint/UselessMethodDefinition
. ([@marcandre][]) - #8698: Fix cache to avoid encoding exception. ([@marcandre][])
-
#8704: Fix an error for
Lint/AmbiguousOperator
when using safe navigation operator with a unary operator. ([@koic][]) -
#8661: Fix an incorrect auto-correct for
Style/MultilineTernaryOperator
when returning a multiline ternary operator expression. ([@koic][]) -
#8526: Fix a false positive for
Style/CaseEquality
cop when the receiver is not a camel cased constant. ([@koic][]) -
#8673: Fix the JSON parse error when specifying
--format=json
and--stdin
options. ([@koic][])
Changes
-
#8470: Do not autocorrect
Style/StringConcatenation
when parts of the expression are too complex. ([@dvandersluis][]) -
#8561: Fix
Lint/UselessMethodDefinition
to not register an offense when method definition includes optional arguments. ([@fatkodima][]) -
#8617: Fix
Style/HashAsLastArrayItem
to not register an offense when all items in an array are hashes. ([@dvandersluis][]) -
#8500: Add
in?
to AllowedMethods forLint/SafeNavigationChain
cop. ([@tejasbubane][]) -
#8629: Fix the cache being reusable in CI by using crc32 to calculate file hashes rather than
mtime
, which changes each CI build. ([@dvandersluis][]) -
#8663: Fix multiple autocorrection bugs with
Style/ClassMethodsDefinitions
. ([@dvandersluis][]) - #8621: Add helpful Infinite Loop error message. ([@iSarCasm][])
v0.90.0
New features
-
#8451: Add new
Style/RedundantSelfAssignment
cop. ([@fatkodima][]) -
#8384: Add new
Layout/EmptyLineAfterMultilineCondition
cop. ([@fatkodima][]) -
#8390: Add new
Style/SoleNestedConditional
cop. ([@fatkodima][]) -
#8563: Add new
Style/KeywordParametersOrder
cop. ([@fatkodima][]) -
#8486: Add new
Style/CombinableLoops
cop. ([@fatkodima][]) -
#8381: Add new
Style/ClassMethodsDefinitions
cop. ([@fatkodima][]) -
#8474: Add new
Lint/DuplicateRequire
cop. ([@fatkodima][]) -
#8472: Add new
Lint/UselessMethodDefinition
cop. ([@fatkodima][]) -
#8531: Add new
Lint/EmptyFile
cop. ([@fatkodima][]) - Add new
Lint/TrailingCommaInAttributeDeclaration
cop. ([@drenmi][]) -
#8578: Add
:restore_registry
context andstub_cop_class
helper class. ([@marcandre][]) -
#8579: Add
Cop.documentation_url
. ([@marcandre][]) -
#8510: Add
RegexpNode#each_capture
andparsed_tree
. ([@marcandre][]) -
#8365: Cops defining
on_send
can be optimized by defining the constantRESTRICT_ON_SEND
with a list of acceptable method names. ([@marcandre][])
Bug fixes
-
#8508: Fix a false positive for
Style/CaseLikeIf
when conditional contains comparison with a class. MarkStyle/CaseLikeIf
as not safe. ([@fatkodima][]) -
#8618: Fix an infinite loop error for
Layout/EmptyLineBetweenDefs
. ([@fatkodima][]) -
#8534: Fix
Lint/BinaryOperatorWithIdenticalOperands
for binary operators used as unary operators. ([@marcandre][]) -
#8537: Allow a trailing comment as a description comment for
Bundler/GemComment
. ([@pocke][]) -
#8507: Fix
Style/RescueModifier
to handle parentheses around rescue modifiers. ([@dsavochkin][]) -
#8527: Prevent an incorrect auto-correction for
Style/CaseEquality
cop when comparing with===
against a regular expression receiver. ([@koic][]) -
#8524: Fix
Layout/EmptyLinesAroundClassBody
andLayout/EmptyLinesAroundModuleBody
to correctly handle an access modifier as a first child. ([@dsavochkin][]) -
#8518: Fix
Lint/ConstantResolution
cop reporting offense formodule
andclass
definitions. ([@tejasbubane][]) -
#8158: Fix
Style/MultilineWhenThen
cop to correctly handle cases with multiline body. ([@dsavochkin][]) -
#7705: Fix
Style/OneLineConditional
cop to handle if/then/elsif/then/else/end cases. AddAlwaysCorrectToMultiline
config option to this cop to always convert offenses to the multi-line form (false by default). ([@Lykos][], [@dsavochkin][]) - #8590: Fix an error when auto-correcting encoding mismatch file. ([@koic][])
-
#8321: Enable auto-correction for
Layout/{Def}EndAlignment
,Lint/EmptyEnsure
,Style/ClassAndModuleChildren
. ([@marcandre][]) -
#8583: Fix
Style/RedundantRegexpEscape
false positive for line continuations. ([@owst][]) -
#8593: Fix
Style/RedundantRegexpCharacterClass
false positive for interpolated multi-line expressions. ([@owst][]) -
#8624: Fix an error with the
Style/CaseLikeIf
cop where it does not properly handle overridden equality methods with no arguments. ([@Skipants][])
Changes
-
#8413: Pending cops warning now contains snippet that can be directly copied into
.rubocop.yml
as well as a notice aboutNewCops: enable
config option. ([@colszowka][]) - #8362: Add numbers of correctable offenses to summary. ([@nguyenquangminh0711][])
-
#8513: Clarify the ruby warning mentioned in the
Lint/ShadowingOuterLocalVariable
documentation. ([@chocolateboy][]) -
#8517: Make
Style/HashTransformKeys
andStyle/HashTransformValues
aware ofto_h
with block. ([@eugeneius][]) -
#8529: Mark
Style/FrozenStringLiteralComment
asSafe
, but with unsafe auto-correction. ([@marcandre][]) -
#8602: Fix usage of
to_enum(:scan, regexp)
to work on TruffleRuby. ([@jaimerave][])
v0.89.1
Bug fixes
-
#8463: Fix false positives for
Lint/OutOfRangeRegexpRef
when a regexp is defined and matched in separate steps. ([@eugeneius][]) -
#8464: Handle regexps matched with
when
,grep
,gsub
,gsub!
,sub
,sub!
,[]
,slice
,slice!
,scan
,index
,rindex
,partition
,rpartition
,start_with?
, andend_with?
inLint/OutOfRangeRegexpRef
. ([@eugeneius][]) -
#8466: Fix a false positive for
Lint/UriRegexp
when usingregexp
method without receiver. ([@koic][]) -
#8478: Relax
Lint/BinaryOperatorWithIdenticalOperands
for mathematical operations. ([@marcandre][]) -
#8480: Tweak callback list of
Lint/MissingSuper
. ([@marcandre][]) -
#8481: Fix autocorrect for elements with newlines in
Style/SymbolArray
andStyle/WordArray
. ([@biinari][]) -
#8475: Fix a false positive for
Style/HashAsLastArrayItem
when there are duplicate hashes in the array. ([@wcmonty][]) -
#8497: Fix
Style/IfUnlessModifier
to add parentheses when converting if-end condition inside a parenthesized method argument list. ([@dsavochkin][])
Changes
v0.89.0
New features
-
#8322: Support autocorrect for
Style/CaseEquality
cop. ([@fatkodima][]) -
#7876: Enhance
Gemspec/RequiredRubyVersion
cop with check thatrequired_ruby_version
is specified. ([@fatkodima][]) -
#8291: Add new
Lint/SelfAssignment
cop. ([@fatkodima][]) -
#8389: Add new
Lint/DuplicateRescueException
cop. ([@fatkodima][]) -
#8433: Add new
Lint/BinaryOperatorWithIdenticalOperands
cop. ([@fatkodima][]) -
#8430: Add new
Lint/UnreachableLoop
cop. ([@fatkodima][]) -
#8412: Add new
Style/OptionalBooleanParameter
cop. ([@fatkodima][]) -
#8432: Add new
Lint/FloatComparison
cop. ([@fatkodima][]) -
#8376: Add new
Lint/MissingSuper
cop. ([@fatkodima][]) -
#8415: Add new
Style/ExplicitBlockArgument
cop. ([@fatkodima][]) -
#8383: Support autocorrect for
Lint/Loop
cop. ([@fatkodima][]) -
#8339: Add
Config#for_badge
as an efficient way to get a cop's config merged with its department's. ([@marcandre][]) -
#5067: Add new
Style/StringConcatenation
cop. ([@fatkodima][]) -
#7425: Add new
Lint/TopLevelReturnWithArgument
cop. ([@iamravitejag][]) -
#8417: Add new
Style/GlobalStdStream
cop. ([@fatkodima][]) -
#7949: Add new
Style/SingleArgumentDig
cop. ([@volfgox][]) -
#8341: Add new
Lint/EmptyConditionalBody
cop. ([@fatkodima][]) -
#7755: Add new
Lint/OutOfRangeRegexpRef
cop. ([@sonalinavlakhe][])
Bug fixes
-
#8346: Allow parentheses in single-line inheritance with
Style/MethodCallWithArgsParentheses
EnforcedStyle: omit_parentheses
to fix invalid Ruby auto-correction. ([@gsamokovarov][]) -
#8324: Fix crash for
Layout/SpaceAroundMethodCallOperator
when usingProc#call
shorthand syntax. ([@fatkodima][]) -
#8332: Fix auto-correct in
Style/ConditionalAssignment
to preserve constant namespace. ([@biinari][]) -
#8344: Fix crash for
Style/CaseLikeIf
when checking againstequal?
andmatch?
without a receiver. ([@fatkodima][]) -
#8323: Fix a false positive for
Style/HashAsLastArrayItem
when hash is not a last array item. ([@fatkodima][]) -
#8299: Fix an incorrect auto-correct for
Style/RedundantCondition
when usingraise
,rescue
, orand
without argument parentheses inelse
. ([@koic][]) -
#8335: Fix incorrect character class detection for nested or POSIX bracket character classes in
Style/RedundantRegexpEscape
. ([@owst][]) -
#8347: Fix an incorrect auto-correct for
EnforcedStyle: hash_rockets
ofStyle/HashSyntax
withLayout/HashAlignment
. ([@koic][]) -
#8375: Fix an infinite loop error for
Style/EmptyMethod
. ([@koic][]) -
#8385: Remove auto-correction for
Lint/EnsureReturn
. ([@marcandre][]) -
#8391: Mark
Style/ArrayCoercion
as not safe. ([@marcandre][]) -
#8406: Improve
Style/AccessorGrouping
's auto-correction to remove redundant blank lines. ([@koic][]) -
#8330: Fix a false positive for
Style/MissingRespondToMissing
when defined method with inline access modifier. ([@koic][]) -
#8422: Fix an error for
Lint/SelfAssignment
when using or-assignment for constant. ([@koic][]) -
#8423: Fix an error for
Style/SingleArgumentDig
when without a receiver. ([@koic][]) -
#8424: Fix an error for
Lint/IneffectiveAccessModifier
when there isbegin...end
before a method definition. ([@koic][]) -
#8006: Fix line length calculation for
Style/IfUnlessModifier
to correctly take into account code before the if condition when considering conversation to a single-line form. ([@dsavochkin][]) -
#8283: Fix line length calculation for
Style/IfUnlessModifier
to correctly take into account a comment on the first line when considering conversation to a single-line form. ([@dsavochkin][]) -
#7957: Fix line length calculation for
Style/IfUnlessModifier
to correctly take into account code on the last line after the end keyword when considering conversion to a single-line form. ([@dsavochkin][]) -
#8226: Fix
Style/IfUnlessModifier
to add parentheses when converting if-end condition inside an array or a hash to a single-line form. ([@dsavochkin][]) -
#8443: Fix an incorrect auto-correct for
Style/StructInheritance
when there is a comment before class declaration. ([@koic][]) -
#8444: Fix an error for
Layout/FirstMethodArgumentLineBreak
when using kwargs insuper
. ([@koic][]) -
#8448: Fix
Style/NestedParenthesizedCalls
to include line continuations in whitespace for auto-correct. ([@biinari][])
Changes
-
#8376:
Style/MethodMissingSuper
cop is removed in favor of newLint/MissingSuper
cop. ([@fatkodima][]) -
#8433:
Lint/UselessComparison
cop is removed in favor of newLint/BinaryOperatorWithIdenticalOperands
cop. ([@fatkodima][]) -
#8350: Set default max line length to 120 for
Style/MultilineMethodSignature
. ([@koic][]) - #8338: potentially breaking. Config#for_department now returns only the config specified for that department; the 'Enabled' attribute is no longer calculated. ([@marcandre][])
-
#8037: (Breaking) Cop
Metrics/AbcSize
now counts ||=, &&=, multiple assignments, for, yield, iterating blocks.&.
now count as conditions too (unless repeated on the same variable). Default bumped from 15 to 17. Consider usingrubocop -a --disable-uncorrectable
to ease transition. ([@marcandre][]) -
#8276: Cop
Metrics/CyclomaticComplexity
not longer counts&.
when repeated on the same variable. ([@marcandre][]) -
#8204: (Breaking) Cop
Metrics/PerceivedComplexity
now countselse
incase
statements,&.
,||=
,&&=
and blocks known to iterate. Default bumped from 7 to 8. Consider usingrubocop -a --disable-uncorrectable
to ease transition. ([@marcandre][]) -
#8416: Cop
Lint/InterpolationCheck
marked as unsafe. ([@marcandre][]) -
#8442: Remove
RuboCop::Cop::ParserDiagnostic
mixin module. ([@koic][])
v0.88.0
New features
-
#8279: Recognise require method passed as argument in
Lint/NonDeterministicRequireOrder
cop. ([@biinari][]) -
#7333: Add new
Style/RedundantFileExtensionInRequire
cop. ([@fatkodima][]) -
#8316: Support autocorrect for
Lint/DisjunctiveAssignmentInConstructor
cop. ([@fatkodima][]) -
#8242: Internal profiling available with
bin/rubocop-profile
and rake tasks. ([@marcandre][]) -
#8295: Add new
Style/ArrayCoercion
cop. ([@fatkodima][]) -
#8293: Add new
Lint/DuplicateElsifCondition
cop. ([@fatkodima][]) -
#7736: Add new
Style/CaseLikeIf
cop. ([@fatkodima][]) -
#4286: Add new
Style/HashAsLastArrayItem
cop. ([@fatkodima][]) -
#8247: Add new
Style/HashLikeCase
cop. ([@fatkodima][]) -
#8286: Internal method
expect_offense
allows abbreviated offense messages. ([@marcandre][])
Bug fixes
-
#8232: Fix a false positive for
Layout/EmptyLinesAroundAccessModifier
whenend
immediately after access modifier. ([@koic][]) -
#7777: Fix crash for
Layout/MultilineArrayBraceLayout
when comment is present after last element. ([@shekhar-patil][]) -
#7776: Fix crash for
Layout/MultilineMethodCallBraceLayout
when comment is present before closing braces. ([@shekhar-patil][]) -
#8282: Fix
Style/IfUnlessModifier
bad precedence detection. ([@tejasbubane][]) -
#8289: Fix
Style/AccessorGrouping
to not register offense for accessor with comment. ([@tejasbubane][]) -
#8310: Handle major version requirements in
Gemspec/RequiredRubyVersion
. ([@eugeneius][]) -
#8315: Fix crash for
Style/PercentLiteralDelimiters
when the source contains invalid characters. ([@eugeneius][]) -
#8239: Don't load
.rubocop.yml
files at all outside of the current project, unless they are personal configuration files and the project has no configuration. ([@deivid-rodriguez][])
Changes
-
#8021: Rewrite
Layout/SpaceAroundMethodCallOperator
cop to make it faster. ([@fatkodima][]) -
#8294: Add
of
toAllowedNames
ofMethodParameterName
cop. ([@AlexWayfer][])
v0.87.1
Bug fixes
-
#8189: Fix an error for
Layout/MultilineBlockLayout
where spaces for a new line where not considered. ([@knejad][]) -
#8252: Fix a command line option name from
--safe-autocorrect
to--safe-auto-correct
, which is compatible with RuboCop 0.86 and lower. ([@koic][]) -
#8259: Fix false positives for
Style/BisectedAttrAccessor
when accessors have different access modifiers. ([@fatkodima][]) -
#8253: Fix false positives for
Style/AccessorGrouping
when accessors have different access modifiers. ([@fatkodima][]) -
#8257: Fix an error for
Style/BisectedAttrAccessor
when usingattr_reader
andattr_writer
with splat arguments. ([@fatkodima][]) -
#8239: Don't load
.rubocop.yml
from personal folders to check for exclusions if given a custom configuration file. ([@deivid-rodriguez][]) -
#8256: Fix an error for
--auto-gen-config
when running a cop who do not support auto-correction. ([@koic][]) -
#8262: Fix
Lint/DeprecatedOpenSSLConstant
auto-correction ofOpenSSL::Cipher
to use lower case, as some Linux-based systems do not accept upper cased cipher names. ([@bdewater][])
v0.87.0
New features
-
#7868:
Cop::Base
is the new recommended base class for cops. ([@marcandre][]) -
#3983: Add new
Style/AccessorGrouping
cop. ([@fatkodima][]) -
#8244: Add new
Style/BisectedAttrAccessor
cop. ([@fatkodima][]) -
#7458: Add new
AsciiConstants
option forNaming/AsciiIdentifiers
. ([@fatkodima][]) -
#7373: Add new
Style/RedundantAssignment
cop. ([@fatkodima][]) - #8213: Permit to specify TargetRubyVersion 2.8 (experimental). ([@koic][])
-
#8159: Add new
CountAsOne
option for code length relatedMetric
cops. ([@fatkodima][]) -
#8164: Support auto-correction for
Lint/InterpolationCheck
. ([@koic][]) -
#8223: Support auto-correction for
Style/IfUnlessModifierOfIfUnless
. ([@koic][]) -
#8172: Support auto-correction for
Lint/SafeNavigationWithEmpty
. ([@koic][])
Bug fixes
-
#8039: Fix false positives for
Lint/ParenthesesAsGroupedExpression
in when using operators or chain functions. ([@CamilleDrapier][]) -
#8196: Fix a false positive for
Style/RedundantFetchBlock
when using withRails.cache
. ([@fatkodima][]) -
#8195: Fix an error for
Style/RedundantFetchBlock
when using#fetch
with empty block. ([@koic][]) -
#8193: Fix a false positive for
Style/RedundantRegexpCharacterClass
when using[\b]
. ([@owst][]) -
#8205: Fix a false positive for
Style/RedundantRegexpCharacterClass
when using a leading escaped]
. ([@owst][]) -
#8208: Fix
Style/RedundantParentheses
with hash literal as first argument toyield
. ([@karlwithak][]) -
#8176: Don't load
.rubocop.yml
from personal folders to check for exclusions if there's a project configuration. ([@deivid-rodriguez][])
Changes
-
#7868: (Breaking) Extensive refactoring of internal classes
Team
,Commissioner
,Corrector
.Cop::Cop#corrections
not completely compatible. See Upgrade Notes. ([@marcandre][]) -
#8156: (Breaking)
rubocop -a / --auto-correct
no longer run unsafe corrections;rubocop -A / --auto-correct-all
run both safe and unsafe corrections. Options--safe-autocorrect
is deprecated. ([@marcandre][]) -
#8207: (Breaking) Order for gems names now disregards underscores and dashes unless
ConsiderPunctuation
setting is set totrue
. ([@marcandre][]) -
#8211:
Style/ClassVars
cop now detectsclass_variable_set
. ([@biinari][]) -
#8245: Detect top-level constants like
::Const
in various cops. ([@biinari][])
v0.86.0
New features
-
#8147: Add new
Style/RedundantFetchBlock
cop. ([@fatkodima][]) -
#8111: Add auto-correct for
Style/StructInheritance
. ([@tejasbubane][]) -
#8113: Let
expect_offense
templates add variable-length whitespace with_{foo}
. ([@eugeneius][]) -
#8148: Support auto-correction for
Style/MultilineTernaryOperator
. ([@koic][]) -
#8151: Support auto-correction for
Style/NestedTernaryOperator
. ([@koic][]) -
#8142: Add
Lint/ConstantResolution
cop. ([@robotdana][]) -
#8170: Support auto-correction for
Lint/RegexpAsCondition
. ([@koic][]) -
#8169: Support auto-correction for
Lint/RaiseException
. ([@koic][])
Bug fixes
-
#8132: Fix the problem with
Naming/MethodName: EnforcedStyle: camelCase
and_
ori
variables. ([@avrusanov][]) -
#8115: Fix false negative for
Lint::FormatParameterMismatch
when argument contains formatting. ([@andrykonchin][]) -
#8131: Fix false positive for
Style/RedundantRegexpEscape
with escaped delimiters. ([@owst][]) -
#8124: Fix a false positive for
Lint/FormatParameterMismatch
when using named parameters with escaped%
. ([@koic][]) - #7979: Fix "uninitialized constant DidYouMean::SpellChecker" exception. ([@bquorning][])
-
#8098: Fix a false positive for
Style/RedundantRegexpCharacterClass
when using interpolations. ([@owst][]) -
#8150: Fix a false positive for
Layout/EmptyLinesAroundAttributeAccessor
when using attribute accessors inif
...else
branches. ([@koic][]) -
#8179: Fix an infinite correction loop error for
Layout/MultilineBlockLayout
when missing newline before opening parenthesis(
for block body. ([@koic][]) -
#8185: Fix a false positive for
Style/YodaCondition
when interpolation is used on the left hand side. ([@koic][])
Changes
-
#8149: (Breaking) Cop
Metrics/CyclomaticComplexity
now counts&.
,||=
,&&=
and blocks known to iterate. Default bumped from 6 to 7. Consider usingrubocop -a --disable-uncorrectable
to ease transition. ([@marcandre][]) - #8146: Use UTC in RuboCop todo file generation. ([@mauro-oto][])
-
#8178: Mark unsafe for
Lint/RaiseException
. ([@koic][])
v0.85.1
Bug fixes
-
#8083: Fix an error for
Lint/MixedRegexpCaptureTypes
cop when using a regular expression that cannot be processed by regexp_parser gem. ([@koic][]) -
#8081: Fix a false positive for
Lint/SuppressedException
when empty rescue block indo
block. ([@koic][]) -
#8096: Fix a false positive for
Lint/SuppressedException
when empty rescue block in defs. ([@koic][]) -
#8108: Fix infinite loop in
Layout/HeredocIndentation
auto-correct. ([@jonas054][]) -
#8042: Fix raising error in
Lint::FormatParameterMismatch
when it handles invalid format strings and add new offense. ([@andrykonchin][])
v0.85.0
New features
-
#6289: Add new
CheckDefinitionPathHierarchy
option forNaming/FileName
. ([@jschneid][]) -
#8055: Add new
Style/RedundantRegexpCharacterClass
cop. ([@owst][]) -
#8069: New option for
expect_offense
to help format offense templates. ([@marcandre][]) -
#7908: Add new
Style/RedundantRegexpEscape
cop. ([@owst][]) -
#7978: Add new option
OnlyFor
to theBundler/GemComment
cop. ([@ric2b][]) -
#8063: Add new
AllowedNames
option forNaming/ClassAndModuleCamelCase
. ([@tejasbubane][]) -
#8050: New option
--display-only-failed
that can be used with--format junit
. Speeds up test report processing for large codebases and helps address the sorts of concerns raised at mikian/rubocop-junit-formatter #18. ([@burnettk][]) -
#7746: Add new
Lint/MixedRegexpCaptureTypes
cop. ([@pocke][])
Bug fixes
-
#8008: Fix an error for
Lint/SuppressedException
when empty rescue block indef
. ([@koic][]) -
#8012: Fix an incorrect auto-correct for
Lint/DeprecatedOpenSSLConstant
when deprecated OpenSSL constant is used in a block. ([@koic][]) -
#8017: Fix a false positive for
Lint/SuppressedException
when empty rescue with comment indef
. ([@koic][]) -
#7990: Fix resolving
inherit_gem
in remote configs. ([@CvX][]) -
#8035: Fix a false positive for
Lint/DeprecatedOpenSSLConstant
when using double quoted string argument. ([@koic][]) -
#7971: Fix an issue where
--disable-uncorrectable
would not update uncorrected code withrubocop:todo
. ([@rrosenblum][]) -
#8035: Fix a false positive for
Lint/DeprecatedOpenSSLConstant
when argument is a variable, method, or constant. ([@koic][])
Changes
-
#8056: (Breaking) Remove support for unindent/active_support/powerpack from
Layout/HeredocIndentation
, so it only recommends using squiggly heredoc. ([@bquorning][])
v0.84.0
New features
-
#7735:
NodePattern
andAST
classes have been moved to therubocop-ast
gem. ([@marcandre][]) -
#7950: Add new
Lint/DeprecatedOpenSSLConstant
cop. ([@bdewater][]) -
#7976: Add
AllowAliasSyntax
andAllowedMethods
options forLayout/EmptyLinesAroundAttributeAccessor
. ([@koic][]) -
#7984: New
rake
task "check_commit" will runrspec
andrubocop
on files touched by the last commit. Currently available when developing from the main repository only. ([@marcandre][])
Bug fixes
-
#7953: Fix an error for
Lint/AmbiguousOperator
when a method with no arguments is used in advance. ([@koic][]) -
#7962: Fix a false positive for
Lint/ParenthesesAsGroupedExpression
when heredoc has a space between the same string as the method name and(
. ([@koic][]) -
#7967:
Style/SlicingWithRange
cop now supports any expression as its first index. ([@zverok][]) -
#7972: Fix an incorrect autocorrect for
Style/HashSyntax
when using a return value usesreturn
. ([@koic][]) -
#7886: Fix a bug in
AllowComments
logic inLint/SuppressedException
. ([@jonas054][]) -
#7991: Fix an error for
Layout/EmptyLinesAroundAttributeAccessor
when attribute method is method chained. ([@koic][]) -
#7993: Fix a false positive for
Migration/DepartmentName
when a disable comment contains an unexpected character for department name. ([@koic][]) - #7983: Make the config loader Bundler-aware. ([@CvX][])
Changes
-
#7952: (Breaking) Change the max line length of
Layout/LineLength
to 120 by default. ([@koic][]) -
#7959: Change enforced style to conditionals for
Style/AndOr
. ([@koic][]) -
#7985: Add
EnforcedStyle
forStyle/DoubleNegation
cop and allow double negation in contexts that use boolean as a return value. ([@koic][])
v0.83.0
New features
-
#7951: Include
rakefile
file by default. ([@jethrodaniel][]) -
#7921: Add new
Style/SlicingWithRange
cop. ([@zverok][]) -
#7895: Include
.simplecov
file by default. ([@robotdana][]) -
#7916: Support auto-correction for
Lint/AmbiguousRegexpLiteral
. ([@koic][]) -
#7917: Support auto-correction for
Lint/UselessAccessModifier
. ([@koic][]) - #595: Add ERB pre-processing for configuration files. ([@jonas054][])
-
#7918: Support auto-correction for
Lint/AmbiguousOperator
. ([@koic][]) -
#7937: Support auto-correction for
Style/IfWithSemicolon
. ([@koic][]) -
#3696: Add
AllowComments
option toLint/EmptyWhen
cop. ([@koic][]) -
#7910: Support auto-correction for
Lint/ParenthesesAsGroupedExpression
. ([@koic][]) -
#7925: Support auto-correction for
Layout/ConditionPosition
. ([@koic][]) -
#7934: Support auto-correction for
Lint/EnsureReturn
. ([@koic][]) -
#7922: Add new
Layout/EmptyLineAroundAttributeAccessor
cop. ([@koic][])
Bug fixes
-
#7929: Fix
Style/FrozenStringLiteralComment
to accept frozen_string_literal anywhere in leading comment lines. ([@jeffcarbs][]) -
#7882: Fix
Style/CaseEquality
whenAllowOnConstant
istrue
and the method receiver is implicit. ([@rafaelfranca][]) -
#7790: Fix
--parallel
and--ignore-parent-exclusion
combination. ([@jonas054][]) -
#7881: Fix
--parallel
and--force-default-config
combination. ([@jonas054][]) -
#7635: Fix a false positive for
Style/MultilineWhenThen
whenthen
required for a body ofwhen
is used. ([@koic][]) -
#7905: Fix an error when running
rubocop --only
orrubocop --except
options without cop name argument. ([@koic][]) -
#7903: Fix an incorrect auto-correct for
Style/HashTransformKeys
andStyle/HashTransformValues
cops when line break beforeto_h
method. ([@diogoosorio][], [@koic][]) -
#7899: Fix an infinite loop error for
Layout/SpaceAroundOperators
withLayout/ExtraSpacing
when usingForceEqualSignAlignment: true
. ([@koic][]) -
#7885: Fix
Style/IfUnlessModifier
logic when tabs are used for indentation. ([@jonas054][]) -
#7909: Fix a false positive for
Lint/ParenthesesAsGroupedExpression
when using an intended grouped parentheses. ([@koic][]) -
#7913: Fix a false positive for
Lint/LiteralAsCondition
when usingtrue
literal inwhile
and similar cases. ([@koic][]) -
#7928: Fix a false message for
Style/GuardClause
when usingand
oror
operators for guard clause inthen
orelse
branches. ([@koic][]) -
#7928: Fix a false positive for
Style/GuardClause
when assigning the result of a guard condition withelse
. ([@koic][])
Changes
-
#7860: Change
AllowInHeredoc
option ofLayout/TrailingWhitespace
totrue
by default. ([@koic][]) -
#7094: Clarify alignment in
Layout/MultilineOperationIndentation
. ([@jonas054][]) -
#4245: (Breaking) Inspect all files given on command line unless
--only-recognized-file-types
is given. ([@jonas054][]) - #7390: (Breaking) Enabling a cop overrides disabling its department. ([@jonas054][])
-
#7936: Mark
Lint/BooleanSymbol
as unsafe. ([@laurmurclar][]) -
#7948: Mark unsafe for
Style/OptionalArguments
. ([@koic][]) -
#7931: Remove dependency on the
jaro_winkler
gem, instead depending ondid_you_mean
. This may be a breaking change for RuboCop libraries callingNameSimilarity#find_similar_name
. ([@bquorning][])
v0.82.0
New features
- #7867: Add support for tabs in indentation. ([@DracoAter][])
- #7863: Corrector now accepts nodes in addition to ranges. ([@marcandre][])
-
#7862: Corrector now has a
wrap
method. ([@marcandre][]) - #7850: Make it possible to enable/disable pending cops. ([@koic][])
-
#7861: Make it to allow
Style/CaseEquality
when the receiver is a constant. ([@rafaelfranca][]) -
#7851: Add a new
Style/ExponentialNotation
cop. ([@tdeo][]) -
#7384: Add new
Style/DisableCopsWithinSourceCodeDirective
cop. ([@egze][]) -
#7826: Add new
Layout/SpaceAroundMethodCallOperator
cop. ([@saurabhmaurya15][])
Bug fixes
-
#7871: Fix an auto-correction bug in
Lint/BooleanSymbol
. ([@knu][]) -
#7842: Fix a false positive for
Lint/RaiseException
when raising Exception with explicit namespace. ([@koic][]) -
#7834: Fix
Lint/UriRegexp
to register offense with array arguments. ([@tejasbubane][]) -
#7841: Fix an error for
Style/TrailingCommaInBlockArgs
when lambda literal (->
) has multiple arguments. ([@koic][]) -
#7842: Fix a false positive for
Lint/RaiseException
when Exception without cbase specified under the namespaceGem
by addingAllowedImplicitNamespaces
option. ([@koic][]) -
Style/IfUnlessModifier
does not infinite-loop when auto-correcting long lines which use if/unless modifiers and have multiple statements separated by semicolons. ([@alexdowad][]) -
rubocop/rubocop-rails#127: Use
ConfigLoader.default_configuration
for the default config. ([@hanachin][])
Changes
-
#7867: (Breaking) Renamed
Layout/Tab
cop toLayout/IndentationStyle
. ([@DracoAter][]) - #7869: (Compatibility) Drop support for Ruby 2.3. ([@koic][])
v0.81.0
New features
-
#7299: Add new
Lint/RaiseException
cop. ([@denys281][]) -
#7793: Prefer
include?
overmember?
inStyle/CollectionMethods
. ([@dmolesUC][]) -
#7654: Support
with_fixed_indentation
option forLayout/ArrayAlignment
cop. ([@nikitasakov][]) -
#7783: Support Ruby 2.7's numbered parameter for
Style/RedundantSort
. ([@koic][]) -
#7795: Make
Layout/EmptyLineAfterGuardClause
aware of case whereand
oror
is used before keyword that break control (e.g.and return
). ([@koic][]) -
#7786: Support Ruby 2.7's pattern match for
Layout/ElseAlignment
cop. ([@koic][]) -
#7784: Support Ruby 2.7's numbered parameter for
Lint/SafeNavigationChain
. ([@koic][]) -
#7331: Add
forbidden
option toStyle/ModuleFunction
cop. ([@weh][]) -
#7699: Add new
Lint/StructNewOverride
cop. ([@ybiquitous][]) -
#7637: Add new
Style/TrailingCommaInBlockArgs
cop. ([@pawptart][]) -
#7809: Add auto-correction for
Style/EndBlock
cop. ([@tejasbubane][]) -
#7739: Add
IgnoreNotImplementedMethods
configuration toLint/UnusedMethodArgument
. ([@tejasbubane][]) -
#7740: Add
AllowModifiersOnSymbols
configuration toStyle/AccessModifierDeclarations
. ([@tejasbubane][]) -
#7812: Add auto-correction for
Lint/BooleanSymbol
cop. ([@tejasbubane][]) -
#7823: Add
IgnoredMethods
configuration inMetrics/AbcSize
,Metrics/CyclomaticComplexity
, andMetrics/PerceivedComplexity
cops. ([@drenmi][]) -
#7816: Support Ruby 2.7's numbered parameter for
Style/Lambda
. ([@koic][]) -
#7829: Fix an error for
Style/OneLineConditional
when one of the branches containsnext
keyword. ([@koic][])
Bug fixes
-
#7236: Mark
Style/InverseMethods
auto-correct as incompatible withStyle/SymbolProc
. ([@drenmi][]) -
#7144: Fix
Style/Documentation
constant visibility declaration in namespace. ([@AdrienSldy][]) -
#7779: Fix a false positive for
Style/MultilineMethodCallIndentation
when using Ruby 2.7's numbered parameter. ([@koic][]) - #7733: Fix rubocop-junit-formatter incompatibility XML for JUnit formatter. ([@koic][])
-
#7767: Skip array literals in
Style/HashTransformValues
andStyle/HashTransformKeys
. ([@tejasbubane][]) -
#7791: Fix an error on auto-correction for
Layout/BlockEndNewline
when}
of multiline block without processing is not on its own line. ([@koic][]) -
#7778: Fix a false positive for
Layout/EndAlignment
when a non-whitespace is used before theend
keyword. ([@koic][]) -
#7806: Fix an error for
Lint/ErbNewArguments
cop when inspectingActionView::Template::Handlers::ERB.new
. ([@koic][]) -
#7814: Fix a false positive for
Migrate/DepartmentName
cop when inspecting an unexpected disabled comment format. ([@koic][]) -
#7728: Fix an error for
Style/OneLineConditional
when one of the branches contains a self keyword. ([@koic][]) -
#7825: Fix crash for
Layout/MultilineMethodCallIndentation
with key access to hash. ([@tejasbubane][]) -
#7831: Fix a false positive for
Style/HashEachMethods
when receiver is implicit. ([@koic][])
Changes
- #7797: Allow unicode-display_width dependency version 1.7.0. ([@yuritomanek][])
-
#7805: Change
AllowComments
option ofLint/SuppressedException
to true by default. ([@koic][]) -
#7320:
Naming/MethodName
now flagsattr_reader/attr_writer/attr_accessor/attr
. ([@denys281][]) -
#7813: (Breaking) Remove
Lint/EndInMethod
cop. ([@tejasbubane][])
v0.80.1
Bug fixes
-
#7719: Fix
Style/NestedParenthesizedCalls
cop for newline. ([@tejasbubane][]) -
#7709: Fix correction of
Style/RedundantCondition
when the else branch contains a range. ([@rrosenblum][]) -
#7682: Fix
Style/InverseMethods
autofix leaving parenthesis. ([@tejasbubane][]) - #7745: Suppress a pending cop warnings when pending cop's department is disabled. ([@koic][])
-
#7759: Fix an error for
Layout/LineLength
cop when using lambda syntax that argument is not enclosed in parentheses. ([@koic][])
Changes
v0.80.0
New features
-
#7693: NodePattern: Add
`
for descendant search. ([@marcandre][]) -
#7577: Add
AllowGemfileRubyComment
configuration onLayout/LeadingCommentSpace
. ([@cetinajero][]) -
#7663: Add new
Style/HashTransformKeys
andStyle/HashTransformValues
cops. ([@djudd][], [@eugeneius][]) -
#7619: Support auto-correct of legacy cop names for
Migration/DepartmentName
. ([@koic][]) -
#7659:
Layout/LineLength
auto-correct now breaks up long lines with blocks. ([@maxh][]) -
#7677: Add new
Style/HashEachMethods
cop forHash#each_key
andHash#each_value
. ([@jemmaissroff][]) - Add
BracesRequiredMethods
parameter toStyle/BlockDelimiters
to require braces for specific methods such as Sorbet'ssig
. ([@maxh][]) -
#7686: Add new
JUnitFormatter
formatter based onrubocop-junit-formatter
gem. ([@koic][]) -
#7715: Add
Steepfile
to defaultInclude
list. ([@ybiquitous][])
Bug fixes
- #7644: Fix patterns with named wildcards in unions. ([@marcandre][])
-
#7639: Fix logical operator edge case in
omit_parentheses
style ofStyle/MethodCallWithArgsParentheses
. ([@gsamokovarov][]) - #7661: Fix to return correct info from multi-line regexp. ([@Tietew][])
- #7655: Fix an error when processing a regexp with a line break at the start of capture parenthesis. ([@koic][])
-
#7647: Fix an
undefined method on_numblock
error when using Ruby 2.7's numbered parameters. ([@hanachin][]) -
#7675: Fix a false negative for
Layout/SpaceBeforeFirstArg
when a vertical argument positions are aligned. ([@koic][]) -
#7688: Fix a bug in
Style/MethodCallWithArgsParentheses
that made--auto-gen-config
crash. ([@buehmann][]) -
#7203: Fix an infinite loop error for
Style/TernaryParentheses
withStyle/RedundantParentheses
when usingEnforcedStyle: require_parentheses_when_complex
. ([@koic][]) -
#7708: Make it possible to use EOL
rubocop:disable
comments on comment lines. ([@jonas054][]) -
#7712: Fix an incorrect auto-correct for
Style/OrAssignment
when usingelsif
branch. ([@koic][])
Changes
-
#7636: Remove
console
fromLint/Debugger
to prevent false positives. ([@gsamokovarov][]) -
#7641: (Breaking) Remove
Style/BracesAroundHashParameters
cop. ([@pocke][]) - Add the method name to highlight area of
Layout/EmptyLineBetweenDefs
to help provide more context. ([@rrosenblum][]) -
#7652: Allow
pp
to allowed names ofNaming/MethodParameterName
cop in default config. ([@masarakki][]) -
#7309: Mark
Lint/UselessSetterCall
an "not safe" and improve documentation. ([@jonas054][]) -
#7723: Enable
Migration/DepartmentName
cop by default. ([@koic][])
v0.79.0
New features
-
#7296: Recognize
console
andbinding.console
(rails/web-console) calls inLint/Debuggers
. ([@gsamokovarov][]) -
#7567: Introduce new
pending
status for new cops. ([@Darhazer][], [@pirj][]) -
#7426: Add
always_true
style to Style/FrozenStringLiteralComment. ([@parkerfinch][], [@gfyoung][])
Bug fixes
-
#7193: Prevent
Style/PercentLiteralDelimiters
from changing%i
literals that contain escaped delimiters. ([@buehmann][]) -
#7590: Fix an error for
Layout/SpaceBeforeBlockBraces
when using withEnforcedStyle: line_count_based
ofStyle/BlockDelimiters
cop. ([@koic][]) -
#7569: Make
Style/YodaCondition
accept__FILE__ == $0
. ([@koic][]) -
#7576: Fix an error for
Gemspec/OrderedDependencies
when using a local variable in an argument of dependent gem. ([@koic][]) -
#7595: Make
Style/NumericPredicate
aware of ignored methods when specifying ignored methods. ([@koic][]) -
#7607: Fix
Style/FrozenStringLiteralComment
infinite loop when magic comments are newline-separated. ([@pirj][]) - #7602: Ensure proper handling of Ruby 2.7 syntax. ([@drenmi][])
-
#7620: Fix a false positive for
Migration/DepartmentName
when a disable comment contains a plain comment. ([@koic][]) -
#7616: Fix an incorrect auto-correct for
Style/MultilineWhenThen
for when statement with then is an array or a hash. ([@koic][]) -
#7628: Fix an incorrect auto-correct for
Layout/MultilineBlockLayout
removing trailing comma with single argument. ([@pawptart][]) -
#7627: Fix a false negative for
Migration/DepartmentName
when there is space around:
(e.g.# rubocop : disable
). ([@koic][])
Changes
-
#7287:
Style/FrozenStringLiteralComment
is now considered unsafe. ([@buehmann][])
v0.78.0
New features
-
#7528: Add new
Lint/NonDeterministicRequireOrder
cop. ([@mangara][]) -
#7559: Add
EnforcedStyleForExponentOperator
parameter toLayout/SpaceAroundOperators
cop. ([@khiav223577][])
Bug fixes
-
#7530: Typo in
Style/TrivialAccessors
'sAllowedMethods
. ([@movermeyer][]) -
#7532: Fix an error for
Style/TrailingCommaInArguments
when using an anonymous function with multiple line arguments withEnforcedStyleForMultiline: consistent_comma
. ([@koic][]) -
#7534: Fix an incorrect auto-correct for
Style/BlockDelimiters
cop andLayout/SpaceBeforeBlockBraces
cop withEnforcedStyle: no_space
when using multiline braces. ([@koic][]) -
#7231: Fix the exit code to be
2
rather when0
when the config file contains an unknown cop. ([@jethroo][]) -
#7513: Fix abrupt error on auto-correcting with
--disable-uncorrectable
. ([@tejasbubane][]) -
#7537: Fix a false positive for
Layout/SpaceAroundOperators
when using a Rational literal with/
(e.g.2/3r
). ([@koic][]) -
#7029: Make
Style/Attr
not flag offense for customattr
method. ([@tejasbubane][]) -
#7574: Fix a corner case that made
Style/GuardClause
crash. ([@buehmann][])
Changes
- #7514: Expose correctable status on offense and in formatters. ([@tyler-ball][])
-
#7542: (Breaking) Move
LineLength
cop fromMetrics
department toLayout
department. ([@koic][])
v0.77.0
Bug fixes
-
#7493: Fix
Style/RedundantReturn
to inspect conditional constructs that are preceded by other statements. ([@buehmann][]) -
#7509: Fix
Layout/SpaceInsideArrayLiteralBrackets
to correct empty lines. ([@ayacai115][]) -
#7517:
Style/SpaceAroundKeyword
allows::
aftersuper
. ([@ozydingo][]) -
#7515: Fix a false negative for
Style/RedundantParentheses
when calling a method with safe navigation operator. ([@koic][]) - #7477: Fix line length auto-correct for semicolons in string literals. ([@maxh][])
-
#7522: Fix a false-positive edge case (
n % 2 == 2
) forStyle/EvenOdd
. ([@buehmann][]) -
#7506: Make
Style/IfUnlessModifier
respect all settings inMetrics/LineLength
. ([@jonas054][])
Changes
- #7077: (Breaking) Further standardisation of cop names. ([@scottmatthewman][])
-
#7469: (Breaking) Replace usages of the terms
Whitelist
andBlacklist
with better alternatives. ([@koic][]) -
#7502: Remove
SafeMode
module. ([@koic][])
v0.76.0
Bug fixes
-
#7439: Make
Style/FormatStringToken
ignore percent escapes (%%
). ([@buehmann][]) -
#7438: Fix assignment edge-cases in
Layout/MultilineAssignmentLayout
. ([@gsamokovarov][]) -
#7449: Make
Style/IfUnlessModifier
respectrubocop:disable
comments forMetrics/LineLength
. ([@jonas054][]) -
#7442: Fix an incorrect auto-correct for
Style/SafeNavigation
when an object check followed by a method call with a comment at EOL. ([@koic][]) -
#7434: Fix an incorrect auto-correct for
Style/MultilineWhenThen
when the body ofwhen
branch starts withthen
. ([@koic][]) -
#7464: Let
Performance/StartWith
andPerformance/EndWith
correct regexes that contain forward slashes. ([@eugeneius][])
Changes
-
#7465: Add
os
to allowed names ofNaming/UncommunicativeMethodParamName
cop in default config. ([@nijikon][]) -
#7446: Add
merge
to list of non-mutating methods. ([@cstyles][]) -
#7077: (Breaking) Rename
Unneeded*
cops toRedundant*
(e.g.,Style/UnneededPercentQ
becomesStyle/RedundantPercentQ
). ([@scottmatthewman][]) - #7396: Display assignments, branches, and conditions values with the offense. ([@avmnu-sng][])
v0.75.1
Bug fixes
- #7391: Support pacman formatter on Windows. ([@laurenball][])
-
#7407: Make
Style/FormatStringToken
work inside hashes. ([@buehmann][]) - #7389: Fix an issue where passing a formatter might result in an error depending on what character it started with. ([@jfhinchcliffe][])
-
#7397: Fix extra comments being added to the correction of
Style/SafeNavigation
. ([@rrosenblum][]) -
#7378: Fix heredoc edge cases in
Layout/EmptyLineAfterGuardClause
. ([@gsamokovarov][]) -
#7404: Fix a false negative for
Layout/IndentAssignment
when multiple assignment with line breaks on each line. ([@koic][])
Changes
-
#7410:
Style/FormatStringToken
now finds unannotated format sequences inprintf
arguments. ([@buehmann][]) -
#6964: Set default
IgnoreCopDirectives
totrue
forMetrics/LineLength
. ([@jdkaplan][])
v0.75.0
New features
-
#7274: Add new
Lint/SendWithMixinArgument
cop. ([@koic][]) -
#7272: Show warning message if passed string to
Enabled
,Safe
,SafeAuto-Correct
, andAuto-Correct
keys in .rubocop.yml. ([@unasuke][]) -
#7295: Make it possible to set
StyleGuideBaseURL
per department. ([@koic][]) -
#7301: Add check for calls to
remote_byebug
toLint/Debugger
cop. ([@riley-klingler][]) -
#7321: Allow YAML aliases in
.rubocop.yml
. ([@raymondfallon][]) -
#7317: Add new formatter
pacman
. ([@crojasaragonez][]) -
#6075: Support
IgnoredPatterns
option forNaming/MethodName
cop. ([@koic][]) -
#7335: Add todo as an alias to disable.
--disable-uncorrectable
will now disable cops usingrubocop:todo
instead ofrubocop:disable
. ([@desheikh][])
Bug fixes
- #7391: Support pacman formatter on Windows. ([@laurenball][])
-
#7256: Fix an error of
Style/RedundantParentheses
on method calls where the first argument begins with a hash literal. ([@halfwhole][]) -
#7263: Make
Layout/SpaceInsideArrayLiteralBrackets
properly handle tab-indented arrays. ([@buehmann][]) -
#7252: Prevent infinite loops by making
Layout/SpaceInsideStringInterpolation
skip over interpolations that start or end with a line break. ([@buehmann][]) -
#7262:
Lint/FormatParameterMismatch
did not recognize named format sequences like%.2<name>f
where the name appears after some modifiers. ([@buehmann][]) -
#7253: Fix an error for
Lint/NumberConversion
when#to_i
called without a receiver. ([@koic][]) -
#7271, #6498: Fix an interference between
Style/TrailingCommaIn*Literal
andLayout/Multiline*BraceLayout
for arrays and hashes. ([@buehmann][]) -
#7241: Make
Style/FrozenStringLiteralComment
match only true & false. ([@tejasbubane][]) -
#7290: Handle inner conditional inside
else
inStyle/ConditionalAssignment
. ([@jonas054][]) -
#5788: Allow block arguments on separate lines if line would be too long in
Layout/MultilineBlockLayout
. ([@jonas054][]) -
#7305: Register
Style/BlockDelimiters
offense when block result is assigned to an attribute. ([@mvz][]) -
#4802: Don't leave any
Lint/UnneededCopEnableDirective
offenses undetected/uncorrected. ([@jonas054][]) -
#7326: Fix a false positive for
Style/AccessModifierDeclarations
when access modifier name is used for hash literal value. ([@koic][]) -
#3591: Handle modifier
if
/unless
correctly inLint/UselessAssignment
. ([@jonas054][]) -
#7161: Fix
Style/SafeNavigation
cop for preserve comments inside if expression. ([@tejasbubane][]) -
#5212: Avoid false positive for braces that are needed to preserve semantics in
Style/BracesAroundHashParameters
. ([@jonas054][]) -
#7353: Fix a false positive for
Style/RedundantSelf
when receiver and multiple assigned lvalue have the same name. ([@koic][]) -
#7353: Fix a false positive for
Style/RedundantSelf
when a self receiver is used as a method argument. ([@koic][]) -
#7358: Fix an incorrect auto-correct for
Style/NestedModifier
when parentheses are required in method arguments. ([@koic][]) -
#7361: Fix a false positive for
Style/TernaryParentheses
when only the closing parenthesis is used in the last line of condition. ([@koic][]) -
#7369: Fix an infinite loop error for
Layout/IndentAssignment
withLayout/IndentFirstArgument
when using multiple assignment. ([@koic][]) - #7177, #7370: When correcting alignment, do not insert spaces into string literals. ([@buehmann][])
-
#7367: Fix an error for
Style/OrAssignment
cop whenthen
branch body is empty. ([@koic][]) -
#7363: Fix an incorrect auto-correct for
Layout/SpaceInsideBlockBraces
andStyle/BlockDelimiters
when using multiline empty braces. ([@koic][]) -
#7212: Fix a false positive for
Layout/EmptyLinesAroundAccessModifier
andUselessAccessModifier
when using method with the same name as access modifier around a method definition. ([@koic][])
Changes
-
#7312: Mark
Style/StringHashKeys
as unsafe. ([@prathamesh-sonpatki][]) -
#7275: Make
Style/VariableName
aware argument names when invoking a method. ([@koic][]) -
#3534: Make
Style/IfUnlessModifier
report and auto-correct modifier lines that are too long. ([@jonas054][]) -
#7261:
Style/FrozenStringLiteralComment
no longer inserts an empty line after the comment. This is left toLayout/EmptyLineAfterMagicComment
. ([@buehmann][]) -
#7091:
Style/FormatStringToken
now detects format sequences with flags and modifiers. ([@buehmann][]) -
#7319: Rename
IgnoredMethodPatterns
option toIgnoredPatterns
option forStyle/MethodCallWithArgsParentheses
. ([@koic][]) -
#7345: Mark unsafe for
Style/YodaCondition
. ([@koic][])
v0.74.0
New features
Bug fixes
-
#7217: Make
Style/TrailingMethodEndStatement
work on more than the firstdef
. ([@buehmann][]) - #7190: Support lower case drive letters on Windows. ([@jonas054][])
- Fix the auto-correction of
Lint/UnneededSplatExpansion
when the splat expansion ofArray.new
with a block is assigned to a variable. ([@rrosenblum][]) -
#5628: Fix an error of
Layout/SpaceInsideStringInterpolation
on interpolations with multiple statements. ([@buehmann][]) -
#7128: Make
Metrics/LineLength
aware of shebang. ([@koic][]) -
#6861: Fix a false positive for
Layout/IndentationWidth
when usingEnforcedStyle: outdent
ofLayout/AccessModifierIndentation
. ([@koic][]) -
#7235: Fix an error where
Style/ConditionalAssignment
would swallow a nestedif
condition. ([@buehmann][]) -
#7242: Make
Style/ConstantVisibility
work on non-trivial class and module bodies. ([@buehmann][])
Changes
-
#5265: Improved
Layout/ExtraSpacing
cop to handle nested consecutive assignments. ([@jfelchner][]) -
#7215: Make it clear what's wrong in the message from
Style/GuardClause
. ([@jonas054][]) - #7245: Make cops detect string interpolations in more contexts: inside of backticks, regular expressions, and symbols. ([@buehmann][])
- Deprecate the
SafeMode
option. Users will need to upgraderubocop-performance
to 1.5.0+ before theSafeMode
module is removed. ([@rrosenblum][])
v0.73.0
New features
- Add
AllowDoxygenCommentStyle
configuration onLayout/LeadingCommentSpace
. ([@anthony-robin][]) -
#7114: Add
MultilineWhenThen
cop. ([@okuramasafumi][]) -
#4127: Add
--disable-uncorrectable
flag to generaterubocop:disable
comments. ([@vergenzt][], [@jonas054][])
Bug fixes
-
#7170: Fix a false positive for
Layout/RescueEnsureAlignment
when def line is preceded withprivate_class_method
. ([@tatsuyafw][]) -
#7186: Fix a false positive for
Style/MixinUsage
when using inside multiline block andif
condition is afterinclude
. ([@koic][]) -
#7099: Fix an error of
Layout/RescueEnsureAlignment
on assigned blocks. ([@tatsuyafw][]) -
#5088: Fix an error of
Layout/MultilineMethodCallIndentation
on method chains inside an argument. ([@buehmann][]) -
#4719: Make
Layout/Tab
detect tabs between string literals. ([@buehmann][]) -
#7203: Fix an infinite loop error for
Layout/SpaceInsideBlockBraces
whenEnforcedStyle: no_space
withSpaceBeforeBlockParameters: false
are set in multiline block. ([@koic][]) -
#6653: Fix a bug where
Layout/IndentHeredoc
would remove empty lines when auto-correcting heredocs. ([@buehmann][])
Changes
- #7181: Sort analyzed file alphabetically. ([@pocke][])
- #7188: Include inspected file location in auto-correction error. ([@pocke][])
v0.72.0
New features
-
#7137: Add new
Gemspec/RubyVersionGlobalsUsage
cop. ([@malyshkosergey][]) -
#7150: Add
AllowIfModifier
option toStyle/IfInsideElse
cop. ([@koic][]) -
#7153: Add new cop
Style/FloatDivision
that checks coercion. ([@tejasbubane][])
Bug fixes
-
#7121: Fix
Style/TernaryParentheses
cop to allow safe navigation operator without parentheses. ([@timon][]) -
#7063: Fix auto-correct in
Style/TernaryParentheses
cop. ([@parkerfinch][]) -
#7106: Fix an error for
Lint/NumberConversion
when#to_i
called on a variable on a hash. ([@koic][]) -
#7107: Fix parentheses offence for numeric arguments with an operator in
Style/MethodCallWithArgsParentheses
. ([@gsamokovarov][]) - #7119: Fix cache with non UTF-8 offense message. ([@pocke][])
-
#7118: Fix
Style/WordArray
withencoding: binary
magic comment and non-ASCII string. ([@pocke][]) -
#7159: Fix an error for
Lint/DuplicatedKey
when using endless range. ([@koic][]) -
#7151: Fix
Style/WordArray
to also consider words containing hyphens. ([@fwitzke][]) -
#6893: Handle implicit rescue correctly in
Naming/RescuedExceptionsVariableName
. ([@pocke][], [@anthony-robin][]) -
#7165: Fix an auto-correct error for
Style/ConditionalAssignment
when withoutelse
branch'. ([@koic][]) -
#7171: Fix an error for
Style/SafeNavigation
when usingunless nil?
as a safeguarded'. ([@koic][]) -
#7130: Skip auto-correct in
Style/FormatString
if second argument toString#%
is a variable. ([@tejasbubane][]) -
#7171: Fix an error for
Style/SafeNavigation
when usingunless nil?
as a safeguarded'. ([@koic][])
Changes
- #5976: Remove Rails cops. ([@koic][])
-
#5976: Remove
rubocop -R/--rails
option. ([@koic][]) -
#7113: Rename
EnforcedStyle: rails
toEnabledStyle: indented_internal_methods
forLayout/IndentationConsistency
. ([@koic][])
v0.71.0
New features
- #7084: Permit to specify TargetRubyVersion 2.7. ([@koic][])
-
#7092: Node patterns can now use
*
,+
and?
for repetitions. ([@marcandre][])
Bug fixes
-
#7066: Fix
Layout/AlignHash
when mixed Hash styles are used. ([@rmm5t][]) -
#7073: Fix false positive in
Naming/RescuedExceptionsVariableName
cop. ([@tejasbubane][]) -
#7090: Fix
Layout/EmptyLinesAroundBlockBody
for multi-line method calls. ([@eugeneius][]) -
#6936: Fix
Layout/MultilineMethodArgumentLineBreaks
when bracket hash assignment on multiple lines. ([@maxh][]) - Mark
Layout/HeredocArgumentClosingParenthesis
incompatible withStyle/TrailingCommaInArguments
. ([@maxh][])
Changes
- #5976: Warn for Rails Cops. ([@koic][])
-
#5976: Warn for
rubocop -R/--rails
option. ([@koic][]) -
#7078: Mark
Lint/PercentStringArray
as unsafe. ([@mikegee][])
v0.70.0
New features
-
#6649:
Layout/AlignHash
supports list of options. ([@stoivo][]) - Add
IgnoreMethodPatterns
config option toStyle/MethodCallWithArgsParentheses
. ([@tejasbubane][]) -
#7059: Add
EnforcedStyle
toLayout/EmptyLinesAroundAccessModifier
. ([@koic][]) -
#7052: Add
AllowComments
option toLint/HandleExceptions
. ([@tejasbubane][])
Bug fixes
- #7013: Respect DisabledByDefault for custom cops. ([@XrXr][])
- #7043: Prevent RDoc error when installing RuboCop 0.69.0 on Ubuntu. ([@koic][])
-
#7023: Auto-Correction for
Lint/NumberConversion
. ([@Bhacaz][])
Changes
-
#6359: Mark
Style/PreferredHashMethods
as unsafe. ([@tejasbubane][])
v0.69.0
New features
- Add support for subclassing using
Class.new
toLint/InheritException
. ([@houli][]) -
#6779: Add new cop
Style/NegatedUnless
that checks for unless with negative condition. ([@tejasbubane][])
Bug fixes
-
#6900: Fix
Rails/TimeZone
auto-correctTime.current
toTime.zone.now
. ([@vfonic][]) -
#6900: Fix
Rails/TimeZone
to preferTime.zone.#{method}
over other acceptable corrections. ([@vfonic][]) -
#7007: Fix
Style/BlockDelimiters
withbraces_for_chaining
style false positive, when chaining using safe navigation. ([@Darhazer][]) -
#6880: Fix
.rubocop
file parsing. ([@hoshinotsuyoshi][]) -
#5782: Do not auto-correct
Lint/UnifiedInteger
ifTargetRubyVersion < 2.4
. ([@lavoiesl][]) -
#6387: Prevent
Lint/NumberConversion
from reporting error withTime
/DateTime
. ([@tejasbubane][]) -
#6980: Fix
Style/StringHashKeys
to allow string as keys for hash arguments to gsub methods. ([@tejasbubane][]) -
#6969: Fix a false positive with block methods in
Style/InverseMethods
. ([@dduugg][]) -
#6729: Handle array spread for
change_column_default
inRails/ReversibleMigration
cop. ([@tejasbubane][]) -
#7033: Fix an error for
Layout/EmptyLineAfterGuardClause
when guard clause is a ternary operator. ([@koic][]) - Replace
Time.zone.current
withTime.zone.today
onRails::Date
cop message. ([@vfonic][])
Changes
- #6945: Drop support for Ruby 2.2. ([@koic][])
-
#6945: Set default
EnforcedStyle
tosquiggly
option forLayout/IndentHeredoc
andauto_detection
option is removed. ([@koic][]) -
#6945: Set default
EnforcedStyle
toalways
option forStyle/FrozenStringLiteralComment
andwhen_needed
option is removed. ([@koic][]) -
#7027: Allow
unicode/display_width
dependency version 1.6.0. ([@tagliala][])
v0.68.1
Bug fixes
-
#6993: Allowing for empty if blocks, preventing
Style/SafeNavigation
from crashing. ([@RicardoTrindade][]) -
#6995: Fix an incorrect auto-correct for
Style/RedundantParentheses
when enclosed in parentheses atwhile-post
oruntil-post
. ([@koic][]) -
#6996: Fix a false positive for
Style/RedundantFreeze
when freezing the result ofString#*
. ([@bquorning][]) -
#6998: Fix auto-correct of
Naming/RescuedExceptionsVariableName
to also rename all references to the variable. ([@Darhazer][]) -
#6992: Fix unknown default configuration for
Layout/IndentFirstParameter
cop. ([@drenmi][]) -
#6972: Fix a false positive for
Style/MixinUsage
when using inside block andif
condition is afterinclude
. ([@koic][]) -
#6738: Prevent auto-correct conflict of
Style/Next
andStyle/SafeNavigation
. ([@hoshinotsuyoshi][]) -
#6847: Fix
Style/BlockDelimiters
to properly check if the node is chained whenbraces_for_chaining
is set. ([@att14][])
v0.68.0
New features
-
#6973: Add
always_braces
toStyle/BlockDelimiter
. ([@iGEL][]) -
#6841: Node patterns can now match children in any order using
<>
. ([@marcandre][]) -
#6928: Add
--init
option for generate.rubocop.yml
file in the current directory. ([@koic][]) - Add new
Layout/HeredocArgumentClosingParenthesis
cop. ([@maxh][]) - #6895: Add support for XDG config home for user-config. ([@Mange][], [@tejasbubane][])
- Add initial auto-correction support to
Metrics/LineLength
. ([@maxh][]) - Add
Layout/IndentFirstParameter
. ([@maxh][]) -
#6974: Make
Layout/FirstMethodArgumentLineBreak
aware of calling usingsuper
. ([@koic][]) - Add new
Lint/HeredocMethodCallPosition
cop. ([@maxh][])
Bug fixes
- Do not annotate message with cop name in JSON output. ([@elebow][])
-
#6914: Fix an error for
Rails/RedundantAllowNil
when with interpolations. ([@Blue-Pix][]) -
#6888: Fix an error for
Rails/ActiveRecordOverride
when noparent_class
present. ([@diachini][]) -
#6941: Add missing absence validations to
Rails/Validation
. ([@jmanian][]) - #6926: Allow nil values to unset config defaults. ([@dduugg][])
-
#6946: Allow
Rails/ReflectionClassName
to use string interpolation forclass_name
. ([@r7kamura][]) -
#6778: Fix a false positive in
Style/HashSyntax
cop when a hash key is an interpolated string and EnforcedStyle is ruby19_no_mixed_keys. ([@tatsuyafw][]) -
#6902: Fix a bug where
Naming/RescuedExceptionsVariableName
would handle an only first rescue for multiple rescue groups. ([@tatsuyafw][]) -
#6860: Prevent auto-correct conflict of
Style/InverseMethods
andStyle/Not
. ([@hoshinotsuyoshi][]) -
#6935:
Layout/AccessModifierIndentation
should ignore access modifiers that apply to specific methods. ([@deivid-rodriguez][]) -
#6956: Prevent auto-correct conflict of
Lint/Lambda
andLint/UnusedBlockArgument
. ([@koic][]) -
#6915: Fix false positive in
Style/SafeNavigation
when a modifier if is safe guarding a method call being passed tobreak
,fail
,next
,raise
,return
,throw
, andyield
. ([@rrosenblum][]) - #6822: Fix Lint/LiteralInInterpolation auto-correction for single quotes. ([@hoshinotsuyoshi][])
-
#6985: Fix an incorrect auto-correct for
Lint/LiteralInInterpolation
if contains array percent literal. ([@yakout][]) -
#7003: Fix an incorrect auto-correct for
Style/InverseMethods
when usingBasicObject#!
. ([@koic][])
Changes
- #6966: Mark Rails/TimeZone as unsafe. ([@vfonic][])
- #5977: Remove Performance cops. ([@koic][])
- Add auto-correction to
Naming/RescuedExceptionsVariableName
. ([@anthony-robin][]) -
#6903: Handle variables prefixed with
_
inNaming/RescuedExceptionsVariableName
cop. ([@anthony-robin][]) - #6917: Bump Bundler dependency to >= 1.15.0. ([@koic][])
- Add
--auto-gen-only-exclude
to the command outputted inrubocop_todo.yml
if the option is specified. ([@dvandersluis][]) -
#6887: Allow
Lint/UnderscorePrefixedVariableName
cop to be configured to allow use of block keyword args. ([@dduugg][]) - #6885: Revert adding psych >= 3.1 as runtime dependency. ([@andreaseger][])
- Rename
Layout/FirstParameterIndentation
toLayout/IndentFirstArgument
. ([@maxh][]) - Extract method call argument alignment behavior from
Layout/AlignParameters
intoLayout/AlignArguments
. ([@maxh][]) - Rename
IndentArray
andIndentHash
toIndentFirstArrayElement
andIndentFirstHashElement
. ([@maxh][])
v0.67.2
Bug fixes
-
#6882: Fix an error for
Rails/RedundantAllowNil
when not using bothallow_nil
andallow_blank
. ([@koic][])
v0.67.1
Changes
v0.67.0
New features
- #5184: Add new multiline element line break cops. ([@maxh][])
- Add new cop
Rails/ActiveRecordOverride
that checks for overriding Active Record methods instead of using callbacks. ([@elebow][]) - Add new cop
Rails/RedundantAllowNil
that checks for cases whenallow_blank
makesallow_nil
unnecessary in model validations. ([@elebow][]) - Add new
Naming/RescuedExceptionsVariableName
cop. ([@AdrienSldy][])
Bug fixes
-
#6761: Make
Naming/UncommunicativeMethodParamName
account for param names prefixed with underscores. ([@thomthom][]) -
#6855: Fix an exception in
Rails/RedundantReceiverInWithOptions
when the body is empty. ([@ericsullivan][]) -
#6856: Fix auto-correction for
Style/BlockComments
when the file is missing a trailing blank line. ([@ericsullivan][]) -
#6858: Fix an incorrect auto-correct for
Lint/ToJSON
when there are noto_json
arguments. ([@koic][]) -
#6865: Fix deactivated
StyleGuideBaseURL
forLayout/ClassStructure
. ([@aeroastro][]) -
#6868: Fix
Rails/LinkToBlank
auto-correct bug when using symbol for target. ([@r7kamura][]) -
#6869: Fix false positive for
Rails/LinkToBlank
when rel is a symbol value. ([@r7kamura][]) - Add
IncludedMacros
param to default rubocop config forStyle/MethodCallWithArgsParentheses
. ([@maxh][]) -
#6785: Do not register an offense for
Rails/Present
orRails/Blank
in anunless else
context whenStyle/UnlessElse
is enabled. ([@rrosenblum][])
Changes
- #6854: Mark Rails/LexicallyScopedActionFilter as unsafe and document risks. ([@urbanautomaton][])
- #5977: Warn for Performance Cops. ([@koic][])
-
#6637: Move
LstripRstrip
fromPerformance
toStyle
department and rename it toStrip
. ([@anuja-joshi][]) -
#6875: Mention block form of
Struct.new
inStyle/StructInheritance
. ([@XrXr][]) -
#6871: Move
Performance/RedundantSortBy
,Performance/UnneededSort
andPerformance/Sample
to the Style department. ([@bbatsov][])
v0.66.0
New features
-
#6393: Add
AllowBracesOnProceduralOneLiners
option to fine-tuneStyle/BlockDelimiter
's semantic mode. ([@davearonson][]) -
#6383: Add
AllowBeforeTrailingComments
option onLayout/ExtraSpacing
cop. ([@davearonson][]) - New cop
Lint/SafeNavigationWithEmpty
checks forfoo&.empty?
in conditionals. ([@rspeicher][]) - Add new
Style/ConstantVisibility
cop for enforcing visibility declarations of class and module constants. ([@drenmi][]) -
#6378: Add
Lint/ToJSON
cop to enforce an argument when overriding#to_json
. ([@allcentury][]) -
#6346: Add auto-correction to
Rails/TimeZone
. ([@dcluna][]) -
#6840: Node patterns now allow unlimited elements after
...
. ([@marcandre][])
Bug fixes
-
#4321: Fix false offense for
Style/RedundantSelf
when the method is also defined onKernel
. ([@mikegee][]) -
#6821: Fix false negative for
Rails/LinkToBlank
when_blank
is a symbol. ([@Intrepidd][]) -
#6699: Fix infinite loop for
Layout/IndentationWidth
andLayout/IndentationConsistency
when bad modifier indentation before good method definition. ([@koic][]) -
#6777: Fix a false positive for
Style/TrivialAccessors
when using trivial reader/writer methods at the top level. ([@koic][]) -
#6799: Fix errors for
Style/ConditionalAssignment
,Style/IdenticalConditionalBranches
,Lint/ElseLayout
, andLayout/IndentationWidth
with empty braces. ([@pocke][]) -
#6802: Fix auto-correction for
Style/SymbolArray
with array contains interpolation whenEnforcedStyle
isbrackets
. ([@pocke][]) - #6797: Fix false negative for Layout/SpaceAroundBlockParameters on block parameter with parens. ([@pocke][])
-
#6798: Fix infinite loop for
Layout/SpaceAroundBlockParameters
withEnforcedStyleInsidePipes: :space
. ([@pocke][]) -
#6803: Fix error for
Style/NumericLiterals
on a literal that contains spaces. ([@pocke][]) -
#6801: Fix auto-correction for
Style/Lambda
with no-space argument. ([@pocke][]) -
#6804: Fix auto-correction of
Style/NumericLiterals
on numeric literal with exponent. ([@pocke][]) -
#6800: Fix an incorrect auto-correct for
Rails/Validation
when method arguments are enclosed in parentheses. ([@koic][]) -
#6808: Prevent false positive in
Naming/ConstantName
when assigning a frozen range. ([@drenmi][]) - Fix the calculation of
Metrics/AbcSize
. Comparison methods andelse
branches add to the comparison count. ([@rrosenblum][]) -
#6791: Allow
Rails/ReflectionClassName
to use symbol argument forclass_name
. ([@unasuke][]) -
#5465: Fix
Layout/ClassStructure
to allow grouping macros by their visibility. ([@gprado][]) -
#6461: Restrict
Ctrl-C
handling to RuboCop's loop and simplify it to a single phase. ([@deivid-rodriguez][])
Changes
- Add
$stdout
/$stderr
andSTDOUT
/STDERR
method calls toRails/Output
. ([@elebow][]) -
#6688: Add
iterator?
to deprecated methods and preferblock_given?
instead. ([@tejasbubane][]) -
#6806: Remove
powerpack
dependency. ([@dduugg][]) -
#6810: Exclude gemspec file by default for
Metrics/BlockLength
cop. ([@koic][]) - #6813: Allow unicode/display_width dependency version 1.5.0. ([@tagliala][])
- Make
Style/RedundantFreeze
aware of methods that will produce frozen objects. ([@rrosenblum][]) - #6675: Avoid printing deprecation warnings about constants. ([@elmasantos][])
-
#6746: Avoid offense on
$stderr.puts
with no arguments. ([@luciamo][]) - Replace md5 with sha1 for FIPS compliance. ([@dirtyharrycallahan][])
v0.65.0
New features
-
#6126: Add an experimental strict mode to
Style/MutableConstant
that will freeze all constants, rather than just literals. ([@rrosenblum][]) - Add
IncludedMacros
toStyle/MethodCallWithArgsParentheses
to allow including specific macros whenIgnoreMacros
is true. ([@maxh][])
Bug fixes
-
#6765: Fix false positives in keyword arguments for
Style/MethodCallWithArgsParentheses
omit_parentheses
. ([@gsamokovarov][]) -
#6763: Fix false positives in range literals for
Style/MethodCallWithArgsParentheses
omit_parentheses
. ([@gsamokovarov][]) -
#6748: Fix
Style/RaiseArgs
auto-correction breaking in contexts that require parentheses. ([@drenmi][]) -
#6751: Prevent
Style/OneLineConditional
from breaking onretry
andbreak
keywords. ([@drenmi][]) -
#6755: Prevent
Style/TrailingCommaInArgument
from breaking when a safe method call is chained on the offending method. ([@drenmi][], [@hoshinotsuyoshi][])
Changes
- #6766: Drop support for Ruby 2.2.0 and 2.2.1. ([@pocke][])
-
#6733: Warn duplicated keys in
.rubocop.yml
. ([@pocke][]) -
#6613: Mark
Style/ModuleFunction
asSafeAuto-Correct: false
and disable auto-correct by default. ([@dduugg][])
v0.64.0
New features
-
#6704: Add new
Rails/ReflectionClassName
cop. ([@Bhacaz][]) -
#6643: Support
AllowParenthesesInCamelCaseMethod
option onStyle/MethodCallWithArgsParentheses
omit_parentheses
. ([@dazuma][])
Bug fixes
-
#6254: Fix
Layout/RescueEnsureAlignment
for non-local assignments. ([@marcotc][]) -
#6648: Fix auto-correction of
Style/EmptyLiteral
whenHash.new
is passed as the first argument tosuper
. ([@rrosenblum][]) -
#6351: Fix a false positive for
Layout/ClosingParenthesisIndentation
when first argument is multiline. ([@antonzaytsev][]) -
#6689: Support more complex argument patterns on
Rails/Validation
auto-correction. ([@r7kamura][]) -
#6668: Fix auto-correction for
Style/UnneededCondition
when conditional has theunless
form. ([@mvz][]) -
#6382: Fix
Layout/IndentationWidth
withLayout/EndAlignment
set to start_of_line. ([@dischorde][], [@siegfault][], [@mhelmetag][]) -
#6710: Fix
Naming/MemoizedInstanceVariableName
on method starts with underscore. ([@pocke][]) -
#6722: Fix an error for
Style/OneLineConditional
whenthen
branch has no body. ([@koic][]) -
#6702: Fix
TrailingComma
regression where heredoc with commas caused false positives. ([@abrom][]) -
#6737: Fix an incorrect auto-correct for
Rails/LinkToBlank
whenlink_to
method arguments are enclosed in parentheses. ([@koic][]) -
#6720: Fix detection of
:native
line ending forLayout/EndOfLine
on JRuby. ([@enkessler][])
Changes
-
#6597:
Style/LineEndConcatenation
is now known to be unsafe for auto-correct. ([@jaredbeck][]) -
#6725: Mark
Style/SymbolProc
as unsafe for auto-correct. ([@drenmi][]) -
#6708: Make
Style/CommentedKeyword
allow the:yields:
RDoc comment. ([@bquorning][]) - #6749: Make some cops aware of safe navigation operator. ([@hoshinotsuyoshi][])
v0.63.1
Bug fixes
-
#6678: Fix
Lint/DisjunctiveAssignmentInConstructor
when it finds an empty constructor. ([@rmm5t][]) - Do not attempt to auto-correct mass assignment or optional assignment in
Rails/RelativeDateConstant
. ([@rrosenblum][]) - Fix auto-correction of
Style/WordArray
andStyle/SymbolArray
when all elements are on separate lines and there is a trailing comment after the closing bracket. ([@rrosenblum][]) - Fix an exception that occurs when auto-correcting
Layout/ClosingParenthesesIndentation
when there are no arguments. ([@rrosenblum][])
v0.63.0
New features
-
#6604: Add auto-correct support to
Rails/LinkToBlank
. ([@Intrepidd][]) -
#6660: Add new
Rails/IgnoredSkipActionFilterOption
cop. ([@wata727][]) -
#6363: Allow
Style/YodaCondition
cop to be configured to enforce yoda conditions. ([@tejasbubane][]) - #6150: Add support to enforce disabled cops to be executed. ([@roooodcastro][])
-
#6596: Add new
Rails/BelongsTo
cop with auto-correct for Rails >= 5. ([@petehamilton][])
Bug fixes
- #6627: Fix handling of hashes in trailing comma. ([@abrom][])
-
#6638: Fix
Rails/LinkToBlank
detection to allowrel: 'noreferrer
. ([@fwininger][]) - #6623: Fix heredoc detection in trailing comma. ([@palkan][])
-
#6100: Fix a false positive in
Naming/ConstantName
cop when rhs is a conditional expression. ([@tatsuyafw][]) -
#6526: Fix a wrong line highlight in
Lint/ShadowedException
cop. ([@tatsuyafw][]) - #6617: Prevent traversal error on infinite ranges. ([@drenmi][])
- #6625: Revert the "auto-exclusion of files ignored by git" feature. ([@bbatsov][])
-
#4460: Fix the determination of unsafe auto-correct in
Style/TernaryParentheses
. ([@jonas054][]) -
#6651: Fix auto-correct issue in
Style/RegexpLiteral
cop when there is string interpolation. ([@roooodcastro][]) -
#6670: Fix a false positive for
Style/SafeNavigation
when a method call safeguarded with a negative check for the object. ([@koic][]) -
#6633: Fix
Lint/SafeNavigation
complaining about use ofto_d
. ([@tejasbubane][]) -
#6575: Fix
Naming/PredicateName
suggesting invalid rename. ([@tejasbubane][]) -
#6673: Fix
Style/DocumentationMethod
cop to recognize documentation comments fordef
inline withmodule_function
. ([@tejasbubane][]) -
#6648: Fix auto-correction of
Style/EmptyLiteral
whenHash.new
is passed as the first argument tosuper
. ([@rrosenblum][])
Changes
- #6607: Improve CLI usage message for --stdin option. ([@jaredbeck][])
-
#6641: Specify
Performance/RangeInclude
as unsafe becauseRange#include?
andRange#cover?
are not equivalent. ([@koic][]) -
#6636: Move
FlipFlop
cop fromStyle
toLint
department because flip-flop is deprecated since Ruby 2.6.0. ([@koic][]) - #6661: Abandon making frozen string literals default for Ruby 3.0. ([@koic][])
v0.62.0
New features
-
#6580: New cop
Rails/LinkToBlank
checks forlink_to
calls withtarget: '_blank'
and norel: 'noopener'
. ([@Intrepidd][]) -
#6586: New cop
Lint/DisjunctiveAssignmentInConstructor
checks constructors for disjunctive assignments that should be plain assignments. ([@jaredbeck][])
Bug fixes
-
#6560: Consider file count, not offense count, for
--exclude-limit
in combination with--auto-gen-only-exclude
. ([@jonas054][]) - #4229: Fix unexpected Style/HashSyntax consistency offence. ([@timon][])
-
#6500: Add offense to use
in_time_zone
instead of deprecatedto_time_in_current_zone
. ([@nadiyaka][]) - #6577: Prevent Rails/Blank cop from adding offense when define the blank method. ([@jonatas][])
- #6554: Prevent Layout/RescueEnsureAlignment cop from breaking on block assignment when assignment is on a separate line. ([@timmcanty][])
-
#6343: Optimise
--auto-gen-config
whenMetrics/LineLength
cop is disabled. ([@tom-lord][]) -
#6389: Fix false negative for
Style/TrailingCommaInHashLiteral
/Style/TrailingCommaInArrayLiteral
when there is a comment in the last line. ([@bayandin][]) -
#6566: Fix false positive for
Layout/EmptyLinesAroundAccessModifier
when at the end of specifying a superclass is missing blank line. ([@koic][]) -
#6571: Fix a false positive for
Layout/TrailingCommaInArguments
when a line break before a method call andEnforcedStyleForMultiline
is set toconsistent_comma
. ([@koic][]) -
#6573: Make
Layout/AccessModifierIndentation
work for dynamic module or class definitions. ([@deivid-rodriguez][]) -
#6562: Fix a false positive for
Style/MethodCallWithArgsParentheses
omit_parentheses
enforced style after safe navigation call. ([@gsamokovarov][]) -
#6570: Fix a false positive for
Style/MethodCallWithArgsParentheses
omit_parentheses
enforced style while splatting the result of a method invocation. ([@gsamokovarov][]) -
#6598: Fix a false positive for
Style/MethodCallWithArgsParentheses
omit_parentheses
enforced style for calls with regexp slash literals argument. ([@gsamokovarov][]) -
#6598: Fix a false positive for
Style/MethodCallWithArgsParentheses
omit_parentheses
enforced style for default argument value calls. ([@gsamokovarov][]) -
#6598: Fix a false positive for
Style/MethodCallWithArgsParentheses
omit_parentheses
enforced style for argument calls with braced blocks. ([@gsamokovarov][]) -
#6594: Fix a false positive for
Rails/OutputSafety
when the receiver is a non-interpolated string literal. ([@amatsuda][]) -
#6574: Fix
Style/AccessModifierIndentation
not handling arbitrary blocks. ([@deivid-rodriguez][]) -
#6370: Fix the enforcing style from
extend self
intomodule_function
when there are private methods. ([@Ruffeng][])
Changes
-
#595: Exclude files ignored by
git
. ([@AlexWayfer][]) - #6429: Fix auto-correct in Rails/Validation to not wrap hash options with braces in an extra set of braces. ([@bquorning][])
- #6533: Improved warning message for unrecognized cop parameters to include Supported parameters. ([@MagedMilad][])
v0.61.1
Bug fixes
- #6550: Prevent Layout/RescueEnsureAlignment cop from breaking on assigned begin-end. ([@drenmi][])
v0.61.0
New features
-
#6457: Support inner slash correction on
Style/RegexpLiteral
. ([@r7kamura][]) -
#6475: Support brace correction on
Style/Lambda
. ([@r7kamura][]) -
#6469: Enforce no parentheses style in the
Style/MethodCallWithArgsParentheses
cop. ([@gsamokovarov][]) - New cop
Performance/OpenStruct
checks forOpenStruct.new
calls. ([@xlts][])
Bug fixes
-
#6433: Fix Ruby 2.5
Layout/RescueEnsureAlignment
error on assigned blocks. ([@gmcgibbon][]) -
#6405: Fix a false positive for
Lint/UselessAssignment
when using a variable in a module name. ([@itsWill][]) -
#5934: Handle the combination of
--auto-gen-config
and--config FILE
correctly. ([@jonas054][]) -
#5970: Make running
--auto-gen-config
in a subdirectory work. ([@jonas054][]) -
#6412: Fix an
unknown keywords
error when usingPsych.safe_load
with Ruby 2.6.0-preview2. ([@koic][]) - #6436: Fix exit status code to be 130 when rubocop is interrupted. ([@deivid-rodriguez][])
-
#6443: Fix an incorrect auto-correct for
Style/BracesAroundHashParameters
when the opening brace is before the first hash element at same line. ([@koic][]) -
#6445: Treat
yield
andsuper
like regular method calls inStyle/AlignHash
. ([@mvz][]) -
#3301: Don't suggest or make semantic changes to the code in
Style/InfiniteLoop
. ([@jonas054][]) -
#3586: Handle single argument spanning multiple lines in
Style/TrailingCommaInArguments
. ([@jonas054][]) -
#6478: Fix EmacsComment#encoding to match the
coding
variable. ([@akihiro17][]) - Don't show "unrecognized parameter" warning for
inherit_mode
parameter to individual cop configurations. ([@maxh][]) -
#6449: Fix a false negative for
Layout/IndentationWidth
when settingEnforcedStyle: rails
ofLayout/IndentationConsistency
and method definition indented to access modifier in a singleton class. ([@koic][]) -
#6482: Fix a false positive for
Lint/FormatParameterMismatch
when using (digit)$ flag. ([@koic][]) -
#6489: Fix an error for
Style/UnneededCondition
whenif
condition andthen
branch are the same and it has noelse
branch. ([@koic][]) - Fix NoMethodError for
Style/FrozenStringLiteral
when a file contains only a shebang. ([@takaram][]) -
#6511: Fix an incorrect auto-correct for
Style/EmptyCaseCondition
when used as an argument of a method. ([@koic][]) -
#6509: Fix an incorrect auto-correct for
Style/RaiseArgs
when an exception object is assigned to a local variable. ([@koic][]) -
#6534: Fix a false positive for
Lint/UselessAccessModifier
when usingprivate_class_method
. ([@dduugg][]) -
#6545: Fix a regression where
Performance/RedundantMerge
raises an error on a sole double splat argument passed tomerge!
. ([@mmedal][]) -
#6360: Detect bad indentation in
if
nodes even if the first branch is empty. ([@bquorning][])
Changes
-
#6492: Auto-correct chunks of comment lines in
Layout/CommentIndentation
to avoid unnecessary iterations forrubocop -a
. ([@jonas054][]) - Fix
--auto-gen-config
when individual cops have regexp literal exclude paths. ([@maxh][])
v0.60.0
New features
-
#5980: Add
--safe
and--safe-auto-correct
options. ([@Darhazer][]) -
#4156: Add command line option
--auto-gen-only-exclude
. ([@Ana06][], [@jonas054][]) -
#6386: Add
VersionAdded
meta data to config/default.yml when runningrake new_cop
. ([@koic][]) - #6395: Permit to specify TargetRubyVersion 2.6. ([@koic][])
-
#6392: Add
Whitelist
config toRails/SkipsModelValidations
rule. ([@DiscoStarslayer][])
Bug fixes
-
#6330: Fix an error for
Rails/ReversibleMigration
when using variable assignment. ([@koic][], [@scottmatthewman][]) -
#6331: Fix a false positive for
Style/RedundantFreeze
and a false negative forStyle/MutableConstant
when assigning a regexp object to a constant. ([@koic][]) -
#6334: Fix a false negative for
Style/RedundantFreeze
when assigning a range object to a constant. ([@koic][]) - #5538: Fix false negatives in modifier cops when line length cop is disabled. ([@drenmi][])
-
#6340: Fix an error for
Rails/ReversibleMigration
when block argument is empty. ([@koic][]) - #6274: Fix "[Corrected]" message being displayed even when nothing has been corrected. ([@jekuta][])
- #6380: Allow use of a hyphen-separated frozen string literal in Emacs style magic comment. ([@y-yagi][])
- Fix and improve
LineLength
cop for tab-indented code. ([@AlexWayfer][])
Changes
-
#3727: Enforce single spaces for
key
option inLayout/AlignHash
cop. ([@albaer][]) - #6321: Fix run of RuboCop when cache directory is not writable. ([@Kevinrob][])
Configuration
-
If you want to rebase/retry this MR, check this box
This MR has been generated by Renovate Bot.
Edited by renovate-bot