Sourced from rubocop's releases.
RuboCop 1.42
New features
- #11339: Add new
Style/MapToSetcop. (@koic)- #11341: Add new
Style/MinMaxComparisoncop. (@koic)- #9222: Add new
Style/YodaExpressioncop. (@fatkodima)- #11261: Allow inherit_from to accept a glob. (
@alexevanczuk)Bug fixes
- #11204: Fix a false negative for
Lint/RedundantCopDisableDirectivewhen using--exceptcommand line option. (@koic)- #11369: Fix an error for
Lint/UselessRuby2Keywordswhen usingProc#ruby2_keywords. (@koic)- #11351: Fix an incorrect autocorrect for
Lint/RegexpAsConditionwhen using regexp literal with bang. (@koic)- #11329: Accept simple freezed constants in
Layout/ClassStructureand correctly handle class methods. (@fatkodima)- #11344: Fix an error for
Style/GuardClausewhen using heredoc as an argument of raise inthenbranch and it does not haveelsebranch. (@koic)- #11335: Fix an error for
Style/RequireOrderwhen only onereuqire. (@koic)- #11348: Fix an error for
Style/SelectByRegexpwhen block body is empty. (@koic)- #11320: Fix a false positive for
Lint/RequireParentheseswhen assigning ternary operator. (@koic)- #11361: Make
Style/MethodDefParenthesesaware of Ruby 3.2's anonymous rest and keyword rest arguments. (@koic)- #11346: Fix a false positive for
Style/RedundantStringEscapewhen using escaped space in heredoc. (@koic)- #10858: Fix
Style/IdenticalConditionalBranchesto ignore identical leading lines when branch has single child and is used in return context. (@fatkodima)- #11237: Fix
Layout/CommentIndentationcomment aligned with access modifier indentation when EnforcedStyle is outdent. (@soroktree)- #11330: Fix an error for
Style/RequireOrderwhen usingrequireinsiderescuebody. (@fatkodima)- #8751: Accept
superwithin ranges forLayout/SpaceAroundKeywordcop. (@fatkodima)- #10194: Accept bracketed arrays within 2d arrays containing subarrays with complex content for
Style/WordArraycop. (@fatkodima)Changes
- #8366: Ignore private constants in
Layout/ClassStructurecop. (@fatkodima)- #11325: Support autocorrection for percent literals in
Style/ConcatArrayLiterals. (@fatkodima)- #11327: Make
Style/ZeroLengthPredicateaware ofarray.length.zero?. (@koic)- #10976: Support pattern matching for
Lint/OutOfRangeRegexpRefcop. (@fatkodima)
Sourced from rubocop's changelog.
1.42.0 (2023-01-01)
New features
- #11339: Add new
Style/MapToSetcop. ([@koic][])- #11341: Add new
Style/MinMaxComparisoncop. ([@koic][])- #9222: Add new
Style/YodaExpressioncop. ([@fatkodima][])- #11261: Allow inherit_from to accept a glob. ([
@alexevanczuk][])Bug fixes
- #11204: Fix a false negative for
Lint/RedundantCopDisableDirectivewhen using--exceptcommand line option. ([@koic][])- #11369: Fix an error for
Lint/UselessRuby2Keywordswhen usingProc#ruby2_keywords. ([@koic][])- #11351: Fix an incorrect autocorrect for
Lint/RegexpAsConditionwhen using regexp literal with bang. ([@koic][])- #11329: Accept simple freezed constants in
Layout/ClassStructureand correctly handle class methods. ([@fatkodima][])- #11344: Fix an error for
Style/GuardClausewhen using heredoc as an argument of raise inthenbranch and it does not haveelsebranch. ([@koic][])- #11335: Fix an error for
Style/RequireOrderwhen only onereuqire. ([@koic][])- #11348: Fix an error for
Style/SelectByRegexpwhen block body is empty. ([@koic][])- #11320: Fix a false positive for
Lint/RequireParentheseswhen assigning ternary operator. ([@koic][])- #11361: Make
Style/MethodDefParenthesesaware of Ruby 3.2's anonymous rest and keyword rest arguments. ([@koic][])- #11346: Fix a false positive for
Style/RedundantStringEscapewhen using escaped space in heredoc. ([@koic][])- #10858: Fix
Style/IdenticalConditionalBranchesto ignore identical leading lines when branch has single child and is used in return context. ([@fatkodima][])- #11237: Fix
Layout/CommentIndentationcomment aligned with access modifier indentation when EnforcedStyle is outdent. ([@soroktree][])- #11330: Fix an error for
Style/RequireOrderwhen usingrequireinsiderescuebody. ([@fatkodima][])- #8751: Accept
superwithin ranges forLayout/SpaceAroundKeywordcop. ([@fatkodima][])- #10194: Accept bracketed arrays within 2d arrays containing subarrays with complex content for
Style/WordArraycop. ([@fatkodima][])Changes
- #8366: Ignore private constants in
Layout/ClassStructurecop. ([@fatkodima][])- #11325: Support autocorrection for percent literals in
Style/ConcatArrayLiterals. ([@fatkodima][])- #11327: Make
Style/ZeroLengthPredicateaware ofarray.length.zero?. ([@koic][])- #10976: Support pattern matching for
Lint/OutOfRangeRegexpRefcop. ([@fatkodima][])
0f7416a
Cut 1.42b58c2cd
Update Changelogd8e5332
Merge pull request #11372
from koic/ci_against_ruby_3_2_on_windowsac9e723
CI against Ruby 3.2 on Windows33bf9a0
Fix an error for Lint/UselessRuby2Keywords3cce8c8
Fix Style/WordArray for subarraysd5c303a
Bump license years to 202332e13c5
Improve offense message for Style/YodaExpression copd4aeaf1
[Doc] Update the doc for Style/MinMaxComparison7b4adef
Add examples for 2d arrays to Style/WordArray cop