Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump rubocop from 1.57.1 to 1.59.0 #593

Merged
merged 5 commits into from Dec 27, 2023

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Dec 11, 2023

Bumps rubocop from 1.57.1 to 1.59.0.

Release notes

Sourced from rubocop's releases.

RuboCop 1.59

New features

Bug fixes

  • #12434: Fix a false positive for Lint/LiteralAssignmentInCondition when using interpolated string or xstring literals. (@​koic)
  • #12435: Fix a false positive for Lint/SelfAssignment when using attribute assignment with method call with arguments. (@​koic)
  • #12444: Fix false positive for Style/HashEachMethods when receiver literal is not a hash literal. (@​koic)
  • #12524: Fix a false positive for Style/MethodCallWithArgsParentheses when EnforcedStyle: omit_parentheses and parens in when clause is used to pass an argument. (@​koic)
  • #12505: Fix a false positive for Style/RedundantParentheses when using parenthesized lambda or proc with do...end block. (@​koic)
  • #12442: Fix an incorrect autocorrect for Style/CombinableLoops when looping over the same data as previous loop in do...end and {...} blocks. (@​koic)
  • #12432: Fix a false positive for Lint/LiteralAssignmentInCondition when using parallel assignment with splat operator in block of guard condition. (@​koic)
  • #12441: Fix false positives for Style/HashEachMethods when using destructed block arguments. (@​koic)
  • #12436: Fix false positives for Style/RedundantParentheses when a part of range is a parenthesized condition. (@​koic)
  • #12429: Fix incorrect autocorrect for Style/MapToHash when using dot method calls for to_h. (@​koic)
  • #12488: Make Lint/HashCompareByIdentity aware of safe navigation operator. (@​koic)
  • #12489: Make Lint/NextWithoutAccumulator aware of safe navigation operator. (@​koic)
  • #12490: Make Lint/NumberConversion aware of safe navigation operator. (@​koic)
  • #12491: Make Lint/RedundantWithIndex aware of safe navigation operator. (@​koic)
  • #12492: Make Lint/RedundantWithObject aware of safe navigation operator. (@​koic)
  • #12493: Make Lint/UnmodifiedReduceAccumulator aware of safe navigation operator. (@​koic)
  • #12473: Make Style/ClassCheck aware of safe navigation operator. (@​koic)
  • #12445: Make Style/CollectionCompact aware of safe navigation operator. (@​koic)
  • #12474: Make Style/ConcatArrayLiterals aware of safe navigation operator. (@​koic)
  • #12476: Make Style/DateTime aware of safe navigation operator. (@​koic)
  • #12479: Make Style/EachWithObject aware of safe navigation operator. (@​koic)
  • #12446: Make Style/HashExcept aware of safe navigation operator. (@​koic)
  • #12447: Make Style/MapCompactWithConditionalBlock aware of safe navigation operator. (@​koic)
  • #12484: Make Style/Next aware of safe navigation operator. (@​koic)
  • #12486: Make Style/RedundantArgument aware of safe navigation operator. (@​koic)
  • #12454: Make Style/RedundantFetchBlock aware of safe navigation operator. (@​koic)
  • #12495: Make Layout/RedundantLineBreak aware of safe navigation operator. (@​koic)
  • #12455: Make Style/RedundantSortBy aware of safe navigation operator. (@​koic)
  • #12456: Make Style/RedundantSortBy aware of safe navigation operator. (@​koic)
  • #12480: Make Style/ExactRegexpMatch aware of safe navigation operator. (@​koic)
  • #12457: Make Style/Sample aware of safe navigation operator. (@​koic)
  • #12458: Make Style/SelectByRegexp cops aware of safe navigation operator. (@​koic)
  • #12494: Make Layout/SingleLineBlockChain aware of safe navigation operator. (@​koic)
  • #12461: Make Style/StringChars aware of safe navigation operator. (@​koic)
  • #12468: Make Style/Strip aware of safe navigation operator. (@​koic)
  • #12469: Make Style/UnpackFirst aware of safe navigation operator. (@​koic)

Changes

  • #12522: Make Style/MethodCallWithoutArgsParentheses allow the parenthesized it method in a block. (@​koic)
  • #12523: Make Style/RedundantSelf allow the self.it method in a block. (@​koic)

... (truncated)

Changelog

Sourced from rubocop's changelog.

1.59.0 (2023-12-11)

New features

Bug fixes

  • #12434: Fix a false positive for Lint/LiteralAssignmentInCondition when using interpolated string or xstring literals. ([@​koic][])
  • #12435: Fix a false positive for Lint/SelfAssignment when using attribute assignment with method call with arguments. ([@​koic][])
  • #12444: Fix false positive for Style/HashEachMethods when receiver literal is not a hash literal. ([@​koic][])
  • #12524: Fix a false positive for Style/MethodCallWithArgsParentheses when EnforcedStyle: omit_parentheses and parens in when clause is used to pass an argument. ([@​koic][])
  • #12505: Fix a false positive for Style/RedundantParentheses when using parenthesized lambda or proc with do...end block. ([@​koic][])
  • #12442: Fix an incorrect autocorrect for Style/CombinableLoops when looping over the same data as previous loop in do...end and {...} blocks. ([@​koic][])
  • #12432: Fix a false positive for Lint/LiteralAssignmentInCondition when using parallel assignment with splat operator in block of guard condition. ([@​koic][])
  • #12441: Fix false positives for Style/HashEachMethods when using destructed block arguments. ([@​koic][])
  • #12436: Fix false positives for Style/RedundantParentheses when a part of range is a parenthesized condition. ([@​koic][])
  • #12429: Fix incorrect autocorrect for Style/MapToHash when using dot method calls for to_h. ([@​koic][])
  • #12488: Make Lint/HashCompareByIdentity aware of safe navigation operator. ([@​koic][])
  • #12489: Make Lint/NextWithoutAccumulator aware of safe navigation operator. ([@​koic][])
  • #12490: Make Lint/NumberConversion aware of safe navigation operator. ([@​koic][])
  • #12491: Make Lint/RedundantWithIndex aware of safe navigation operator. ([@​koic][])
  • #12492: Make Lint/RedundantWithObject aware of safe navigation operator. ([@​koic][])
  • #12493: Make Lint/UnmodifiedReduceAccumulator aware of safe navigation operator. ([@​koic][])
  • #12473: Make Style/ClassCheck aware of safe navigation operator. ([@​koic][])
  • #12445: Make Style/CollectionCompact aware of safe navigation operator. ([@​koic][])
  • #12474: Make Style/ConcatArrayLiterals aware of safe navigation operator. ([@​koic][])
  • #12476: Make Style/DateTime aware of safe navigation operator. ([@​koic][])
  • #12479: Make Style/EachWithObject aware of safe navigation operator. ([@​koic][])
  • #12446: Make Style/HashExcept aware of safe navigation operator. ([@​koic][])
  • #12447: Make Style/MapCompactWithConditionalBlock aware of safe navigation operator. ([@​koic][])
  • #12484: Make Style/Next aware of safe navigation operator. ([@​koic][])
  • #12486: Make Style/RedundantArgument aware of safe navigation operator. ([@​koic][])
  • #12454: Make Style/RedundantFetchBlock aware of safe navigation operator. ([@​koic][])
  • #12495: Make Layout/RedundantLineBreak aware of safe navigation operator. ([@​koic][])
  • #12455: Make Style/RedundantSortBy aware of safe navigation operator. ([@​koic][])
  • #12456: Make Style/RedundantSortBy aware of safe navigation operator. ([@​koic][])
  • #12480: Make Style/ExactRegexpMatch aware of safe navigation operator. ([@​koic][])
  • #12457: Make Style/Sample aware of safe navigation operator. ([@​koic][])
  • #12458: Make Style/SelectByRegexp cops aware of safe navigation operator. ([@​koic][])
  • #12494: Make Layout/SingleLineBlockChain aware of safe navigation operator. ([@​koic][])
  • #12461: Make Style/StringChars aware of safe navigation operator. ([@​koic][])
  • #12468: Make Style/Strip aware of safe navigation operator. ([@​koic][])
  • #12469: Make Style/UnpackFirst aware of safe navigation operator. ([@​koic][])

Changes

  • #12522: Make Style/MethodCallWithoutArgsParentheses allow the parenthesized it method in a block. ([@​koic][])
  • #12523: Make Style/RedundantSelf allow the self.it method in a block. ([@​koic][])

... (truncated)

Commits
  • e5a164a Cut 1.59
  • 2912b6e Update Changelog
  • 3bcc171 [Fix #12524] Fix a false positive for Style/MethodCallWithArgsParentheses
  • 0daa4aa Make Style/MethodCallWithoutArgsParentheses allow parenthesized it
  • b240a09 Make Style/RedundantSelf allow self.it
  • a0e1042 [Fix #12526] Fix incorrect rendering typos
  • b1bcb31 [Fix #12444] Fix false positive for Style/HashEachMethods
  • 3b0360b Add new Lint/ItWithoutArgumentsInBlock cop
  • 4e9cfcc Merge pull request #12521 from koic/make_style_select_by_regexp_aware_of_safe...
  • 037c860 Merge pull request #12438 from koic/fix_a_false_positive_for_lint_literal_ass...
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot bot requested a review from a team as a code owner December 11, 2023 19:53
@dependabot dependabot bot added dependencies Pull requests that update a dependency file ruby Pull requests that update Ruby code labels Dec 11, 2023
dependabot bot and others added 3 commits December 11, 2023 15:16
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.57.1 to 1.59.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](rubocop/rubocop@v1.57.1...v1.59.0)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Rather than repeat `Gem::Version.new(...)` every time we want to check a
version, we can extract a variable.
@sambostock sambostock force-pushed the dependabot/bundler/rubocop-1.59.0 branch from 1756fd9 to e4452a4 Compare December 11, 2023 20:16
@github-actions github-actions bot added the config change Changes the Rubocop config by enabling, disabling, or reconfiguring one or many cops label Dec 11, 2023
Comment on lines +193 to +196
<% if rubocop_version >= v1_59 %>
Lint/ItWithoutArgumentsInBlock:
Enabled: true
<% end %>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This takes the same approach as #582, and conditionally enables the cop based on the RuboCop version, allowing us to keep the minimum version the same.

Since I realized we'd end up repeating Gem::Version.new(...) all over the place, I extracted v1.xx variables.

Comment on lines +2381 to +2386
Style/ArrayFirstLast:
Description: Use `arr.first` and `arr.last` instead of `arr[0]` and `arr[-1]`.
Reference: "#first-and-last"
Enabled: false
VersionAdded: '1.58'
Safe: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept this disabled, as I don't see it being worth it given how many false positives it would have.

@sambostock sambostock force-pushed the dependabot/bundler/rubocop-1.59.0 branch from e4452a4 to 33ba911 Compare December 11, 2023 20:28
Comment on lines +1425 to +1429
Lint/ItWithoutArgumentsInBlock:
Description: Checks uses of `it` calls without arguments in block.
Reference: https://bugs.ruby-lang.org/issues/18980
Enabled: true
VersionAdded: '1.59'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This emulates an upcoming warning, so best to enable it and start addressing it early.

Comment on lines +1438 to +1441
Lint/LiteralAssignmentInCondition:
Description: Checks for literal assignments in the conditions.
Enabled: true
VersionAdded: '1.58'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks for things like

if x = true

or

if x = 123

which probably meant to use == instead. Technically, there's overlap with the rule we have that enforces surrounding ( ) for assignments in conditions, but it's still possible someone could make the mistake.

Comment on lines +4093 to +4097
Style/SuperWithArgsParentheses:
Description: Use parentheses for `super` with arguments.
StyleGuide: "#super-with-args"
Enabled: true
VersionAdded: '1.58'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seemed like a good idea, given super and super() do different things, although it may already be covered by us having parentheses enabled for method calls be default.

@sambostock sambostock merged commit 9ab3461 into main Dec 27, 2023
20 checks passed
@sambostock sambostock deleted the dependabot/bundler/rubocop-1.59.0 branch December 27, 2023 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config change Changes the Rubocop config by enabling, disabling, or reconfiguring one or many cops dependencies Pull requests that update a dependency file ruby Pull requests that update Ruby code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants