Releases: rubocop/rubocop
Releases · rubocop/rubocop
RuboCop 1.35.1
Bug fixes
- #10926: Make
Style/SafeNavigation
aware of a redundant nil check. (@koic) - #10944: Fix an incorrect autocorrect for
Lint/LiteralInInterpolation
when using"#{nil}"
. (@koic) - #10921: Fix an error when ERB pre-processing of the configuration file. (@koic)
- #10936: Fix an error for
Lint/NonAtomicFileOperation
when usingFileTest.exist?
as a condition forelsif
. (@koic) - #10920: Fix an incorrect autocorrect for
Style/SoleNestedConditional
when using nested conditional and branch contains a comment. (@koic) - #10939: Fix an error for
Style/Next
when line break before condition. (@koic)
RuboCop 1.35
New features
- #9364: Add
Style/MagicCommentFormat
cop. (@dvandersluis, @mattbearman) - #10776: New option (
consistent
) forEnforcedShorthandSyntax
inStyle/HashSyntax
to avoid mixing shorthand and non-shorthand hash keys in ruby 3.1. (@h-lame)
Bug fixes
- #10899: Fix an error for
Lint/ShadowingOuterLocalVariable
when the same variable name as a block variable is used in return value assignment ofif
. (@koic) - #10916: Fix an error when .rubocop.yml is empty. (@koic)
- #10915: Fix numblock support to
Layout/BlockAlignment
,Layout/BlockEndNewline
,Layout/EmptyLinesAroundAccessModifier
,Layout/EmptyLinesAroundBlockBody
,Layout/IndentationWidth
,Layout/LineLength
,Layout/MultilineBlockLayout
,Layout/SpaceBeforeBlockBraces
,Lint/NextWithoutAccumulator
,Lint/NonDeterministicRequireOrder
,Lint/RedundantWithIndex
,Lint/RedundantWithObject
,Lint/UnreachableLoop
,Lint/UselessAccessModifier
,Lint/Void
,Metrics/AbcSize
,Metrics/CyclomaticComplexity
,Style/CollectionMethods
,Style/CombinableLoops
,Style/EachWithObject
,Style/For
,Style/HashEachMethods
,Style/InverseMethods
,Style/MethodCalledOnDoEndBlock
,Style/MultilineBlockChain
,Style/Next
,Style/ObjectThen
,Style/Proc
,Style/RedundantBegin
,Style/RedundantSelf
,Style/RedundantSortBy
andStyle/TopLevelMethodDefinition
. (@gsamokovarov) - #10895: Fix incorrect autocomplete in
Style/RedundantParentheses
when a heredoc is used in an array. (@dvandersluis) - #10909: Fix loading behavior on running without
bundle exec
. (@r7kamura) - #10913: Make
Style/ArgumentsForwarding
aware of anonymous block argument. (@koic) - #10911: Fix Style/ClassMethodsDefinitions for non-self receivers. (@sambostock)
Changes
- #10915: Depend on rubocop-ast 1.20.1 for numblocks support in #macro?. (@gsamokovarov)
RuboCop 1.34.1
RuboCop 1.34
New features
- #10170: Add new
InternalAffairs/SingleLineComparison
cop. (@dvandersluis)
Bug fixes
- #10552: Require RuboCop AST 1.20.0+ to fix a false positive for
Lint/OutOfRangeRegexpRef
when using fixed-encoding regopt. (@koic) - #10512: Fix a false positive for
Lint/ShadowingOuterLocalVariable
conditional statement and block variable. (@ydah) - #10864:
min
andmax
results in false positives forStyle/SymbolProc
similarly toselect
andreject
. (@mollerhoj) - #10846: Fix a false negative for
Style/DoubleNegation
when there is a hash or an array at return location of method. (@nobuyo) - #10875: Fix an obsolete option configuration values are duplicated when generating
.rubocop_todo.yml
. (@ydah) - #10877: Fix crash with
Layout/BlockEndNewline
heredoc detection. (@dvandersluis) - #10859: Fix
Lint/Debugger
to be able to handle method chains correctly. (@dvandersluis) - #10883: Fix
Style/RedundantParentheses
to be able to detect offenses and properly correct when the end parentheses and comma are on their own line. (@dvandersluis) - #10881: Fix
Style/SoleNestedConditional
to properly wrapblock
andcsend
nodes when necessary. (@dvandersluis) - #10867: Mark autocorrection for
Lint/EmptyConditionalBody
as unsafe. (@dvandersluis) - #10871: Restore
RuboCop::ConfigLoader.project_root
as deprecated. (@koic)
Changes
- #10857: Add
AllowedPatterns
toStyle/NumericLiterals
. (@dvandersluis) - #10648: Allow
Style/TernaryParentheses
to take priority overStyle/RedundantParentheses
when parentheses are enforced. (@dvandersluis) - #10731: Show tip for suggested extensions that are installed but not loaded in .rubocop.yml. (@nobuyo)
- #10845: Support Bundler-like namespaced feature on require config. (@r7kamura)
- #10773: Require Parser 3.1.2.1 or higher. (@dvandersluis)
RuboCop 1.33
Bug fixes
- #10830: Fix an incorrect autocorrect for
Layout/FirstArgumentIndentation
when specifyingEnforcedStyle: with_fixed_indentation
ofLayout/ArgumentAlignment
andEnforcedStyle: consistent
ofLayout/FirstArgumentIndentation
and enablingLayout/FirstMethodArgumentLineBreak
. (@koic) - #10825: Fix an incorrect autocorrect for
Style/ClassAndModuleChildren
when using nested one-liner class. (@koic) - #10843: Fix a false positive for
Style/HashExcept
when usingreject
and callinginclude?
method with symbol array and second block value. (@koic) - #10853: Fix an autocorrect for
Style/RedundantSort
with logical operator. (@ydah) - #10842: Make server mode aware of
CacheRootDirectory
config option value,RUBOCOP_CACHE_ROOT
, andXDG_CACHE_HOME
environment variables. (@koic) - #10833: Fix an incorrect autocorrect for
Style/RedundantCondition
when branches contains arithmetic operation. (@koic) - #10864: Fix a false positive for
Style/SymbolProc
when usingHash#reject
. (@koic) - #10771: Make server mode aware of
--cache-root
command line option. (@koic) - #10831: Fix an error when using
changed_parameters
in obsoletion.yml by external library. (@koic) - #10850: Fix
Style/ClassEqualityComparison
autocorrection within module. (@r7kamura) - #10832: Fix an incorrect autocorrect for
Layout/BlockEndNewline
when multiline block}
is not on its own line and using heredoc argument. (@koic)
Changes
RuboCop 1.32
New features
- #10820: Add new
Style/EmptyHeredoc
cop. (@koic) - #10691: Add new
Layout/MultilineMethodParameterLineBreaks
cop. (@Korri) - #10790: Support
AllowComments
option forStyle/EmptyElse
. (@ydah) - #10792: Add new
Lint/RequireRangeParentheses
cop. (@koic) - #10692: Break long method definitions when auto-correcting. (@Korri)
Bug fixes
- #10824: Make
Lint/DeprecatedClassMethods
aware ofENV.clone
andENV.dup
. (@koic) - #10788: Relax
Style/FetchEnvVar
to allowENV[]
in LHS of||
. (@j-miyake) - #10813: Fix recursive deletion to suppression in
Lint/NonAtomicFileOperation
. (@ydah) - #10791: Fix an incorrect autocorrect for
Style/Semicolon
when using endless range before semicolon. (@koic) - #10781: Fix a suggestions for safer conversions for
Lint/NonAtomicFileOperation
. (@ydah) - #10263: Fix the value of
Enabled
leaking between configurations. (@jonas054)
Changes
- #10613: Allow autocorrecting with -P/--parallel and make it the default. (@jonas054)
- Add EnforcedStyle (leading/trailing) configuration to
Layout::LineContinuationLeadingSpace
. (@bquorning) - #10784: Preserve multiline semantics on
Style/SymbolArray
andStyle/WordArray
. (@r7kamura) - #10814: Avoid buffering stdout when running in server mode. (@ccutrer)
- #10817: Add autocorrect support for
Style/SafeNavigationChain
. (@r7kamura) - #10810: Support safe navigation operator on
Style/SymbolProc
. (@r7kamura) - #10803: Require RuboCop AST 1.9.1 or higher. (@koic)
RuboCop 1.31.2
Bug fixes
- #10774: Fix false negatives in
Style/DocumentationMethod
when a public method is defined after a private one. (@Darhazer) - #10764: Fix performance issue for Layout/FirstHashElementIndentation and Layout/FirstArrayElementIndentation. (@j-miyake)
- #10780: Fix an error when using
rubocop:auto_correct
deprecated custom rake task. (@koic) - #10786: Fix a false positive for
Lint/NonAtomicFileOperation
when using complex conditional. (@koic) - #10785: Fix a false negative for
Style/RedundantParentheses
when parens around a receiver of a method call with an argument. (@koic) - #10026: Fix merging of array parameters in either parent of default config. (@jonas054)
RuboCop 1.31.1
Bug fixes
- #10763: Fix a false positive for
Layout/LineContinuationSpacing
when using continuation keyword\
after__END__
. (@koic) - #10755: Fix a false positive for
Lint/LiteralAsCondition
when using a literal incase-in
condition where the match variable is used inin
are accepted as a pattern matching. (@koic) - #10760: Fix a false positive for
Lint/NonAtomicFileOperation
when usingFileTest.exist?
withif
condition that haselse
branch. (@koic) - #10745: Require JSON 2.3 or higher to fix an incompatible JSON API error. (@koic)
- #10754: Fix an incorrect autocorrect for
Style/HashExcept
when using a non-literal collection receiver forinclude?
. (@koic) - #10751: Fix autocorrect for Layout/FirstHashElementIndentation. (@j-miyake)
- #10750: Recover 7x slow running
rubocop
. (@koic)
RuboCop 1.31
New features
- #10699: Add new global
ActiveSupportExtensionsEnabled
option. (@nobuyo) - #10245: Add specification_version and rubygems_version to
Gemspec/DeprecatedAttributeAssignment
. (@kaitielth) - #10696: Add new
Lint/NonAtomicFileOperation
cop. (@ydah) - #6420: Add new
Layout/LineContinuationLeadingSpace
cop. (@bquorning) - #6420: Add new
Layout/LineContinuationSpacing
cop. (@bquorning) - #10706: Integrate rubocop-daemon to add server options. (@koic)
- #10722: Add new
Lint/ConstantOverwrittenInRescue
cop. (@ydah)
Bug fixes
- #10700: Update
Style/EmptyMethod
to not correct if the correction would exceed the configuration forLayout/LineLength
. (@dvandersluis) - #10698: Enhance
Style/HashExcept
to support array inclusion checks. (@nobuyo) - #10734: Handle
ClobberingError
inStyle/NestedTernaryOperator
when there are multiple nested ternaries. (@dvandersluis) - #10689: Fix autocorrect for
Layout/FirstHashElementIndentation
andLayout/FirstArrayElementIndentation
. (@j-miyake) - Fix
rubocop -V
not displaying the version information for rubocop-graphql, rubocop-md and rubocop-thread_safety. (@Darhazer) - #10711: Fix an error for
Style/MultilineTernaryOperator
when the false branch is on a separate line. (@koic) - #10719: Fix a false positive for
Lint/ParenthesesAsGroupedExpression
when using safe navigation operator. (@koic) - #10736: Fix Layout/SpaceInsideBlockBraces for blocks with numbered arguments. (@gsamokovarov)
- #10749: Fix Style/BlockDelimiters for blocks with numbered arguments. (@gsamokovarov)
- #10737: Fix crash in
Style/ConditionalAssignment
withEnforcedStyle: assign_inside_condition
when op-assigning a variable inside aresbody
. (@dvandersluis) - #7900: Fix
Style/FormatStringToken
false positive with formatted input andtemplate
style enforced, and add autocorrection. (@FnControlOption)
Changes
- #10730: Change output timing of GitHubActionsFormatter. (@r7kamura)
- #10709: Deprecate
rubocop:auto_correct
custom rake task and newly splitrubocop:autocorrect
andrubocop:autocorrect-all
custom rake tasks. (@koic) - #9760: Change RangeHelp#range_with_surrounding_space to allow passing the range as a positional argument. (@pirj)
- #10693: Add ignore case for
Style/EmptyLinesAroundAttributeAccessor
when there is a comment line on the next line. (@ydah) - #10245: (Breaking) integrate
Gemspec/DateAssignment
intoGemspec/DeprecatedAttributeAssignment
. (@kaitielth) - #10697: Restore
Lint/UselessElseWithoutRescue
cop. (@koic) - #10740: Make
Style/GuardClause
a bit more lenient when the replacement would make the code more verbose. (@dvandersluis)
RuboCop 1.30.1
Bug fixes
- #10685: Fix a false positive for
Style/StringConcatenation
whenMode: conservative
and first operand is not string literal. (@koic) - #10670: Fix a false positive for
Style/FetchEnvVar
in the body with assignment method. (@ydah) - #10671: Fix an incorrect autocorrect for
EnforcedStyle: with_first_argument
ofLayout/ArgumentAlignment
andEnforcedColonStyle: separator
ofLayout/HashAlignment
. (@koic) - #10676: Fix
--ignore-unrecognized-cops
option always showing empty warning even if there was no problem. (@nobuyo) - #10674: Fix a false positive for
Naming/AccessorMethodName
with type of the first argument is other thanarg
. (@ydah) - #10679: Fix a false positive for
Style/SafeNavigation
whenTargetRubyVersion: 2.2
or lower. (@koic)