Skip to content

Bump rubocop from 1.75.8 to 1.76.0 in the rubocop group #736

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

Merged
merged 9 commits into from
Jun 9, 2025

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jun 4, 2025

Bumps the rubocop group with 1 update: rubocop.

Updates rubocop from 1.75.8 to 1.76.0

Release notes

Sourced from rubocop's releases.

RuboCop v1.76.0

New features

Bug fixes

  • #14228: Fix a false positive for Style/RedundantParentheses when using a one-line rescue expression as a method argument. (@​koic)
  • #14224: Fix false negatives for Style/RedundantParentheses when using one-line pattern matching. (@​koic)
  • #14205: False negatives in Style/SafeNavigation when a ternary expression is used in a method argument. (@​steiley)
  • #14226: Fix Lint/LiteralAsCondition autocorrect when branches of a condition have comments. (@​zopolis4)

Changes

Changelog

Sourced from rubocop's changelog.

1.76.0 (2025-06-04)

New features

Bug fixes

  • #14228: Fix a false positive for Style/RedundantParentheses when using a one-line rescue expression as a method argument. ([@​koic][])
  • #14224: Fix false negatives for Style/RedundantParentheses when using one-line pattern matching. ([@​koic][])
  • #14205: False negatives in Style/SafeNavigation when a ternary expression is used in a method argument. ([@​steiley][])
  • #14226: Fix Lint/LiteralAsCondition autocorrect when branches of a condition have comments. ([@​zopolis4][])

Changes

Commits
  • 190a64d Cut 1.76
  • f62809d Update Changelog
  • 329b580 Use RuboCop::AST::Node#any_match_pattern_type? method
  • 9368339 [Fix #14228] Fix false positive for Style/RedundantParentheses
  • 16efaa9 Merge pull request #14226 from Zopolis4/standee
  • af29d5c Fix Lint/LiteralAsCondition autocorrect when branches of a condition have c...
  • 173db55 Add new cop Lint/UselessOr
  • c977def Merge pull request #14225 from viralpraxis/fix-style-empty-string-inside-inte...
  • fac13c5 Fix Style/EmptyStringInsideInterpolation cop error on non-string literal
  • 25a7eef Fix false negatives for Style/RedundantParentheses
  • 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 <dependency name> major version will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
  • @dependabot ignore <dependency name> minor version will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
  • @dependabot ignore <dependency name> will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
  • @dependabot unignore <dependency name> will remove all of the ignore conditions of the specified dependency
  • @dependabot unignore <dependency name> <ignore condition> will remove the ignore condition of the specified dependency and ignore conditions

@dependabot dependabot bot added dependencies Pull requests that update a dependency file ruby Pull requests that update Ruby code labels Jun 4, 2025
@dependabot dependabot bot requested a review from a team as a code owner June 4, 2025 15:36
@dependabot dependabot bot added dependencies Pull requests that update a dependency file ruby Pull requests that update Ruby code labels Jun 4, 2025
dependabot bot and others added 6 commits June 5, 2025 12:04
Bumps the rubocop group with 1 update: [rubocop](https://github.com/rubocop/rubocop).

Updates `rubocop` from 1.75.8 to 1.76.0
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](rubocop/rubocop@v1.75.8...v1.76.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
This cop has been renamed, so we conditionally set the config depending
on RuboCop version.
As of `[email protected]`, our config matches the default, so we should not
configure it.
@sambostock sambostock force-pushed the dependabot/bundler/rubocop-a598e0f185 branch from 6f79835 to 1a90daa Compare June 5, 2025 16:08
@github-actions github-actions bot added the config change Changes the Rubocop config by enabling, disabling, or reconfiguring one or many cops label Jun 5, 2025
Comment on lines +381 to +384
<% if rubocop_version < "1.76" %>
Lint/ShadowingOuterLocalVariable:
Enabled: false
<% 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 is now the default, so we only want to keep configuring it for old RuboCop versions.

Comment on lines +455 to +458
<% if rubocop_version >= "1.76" %>
Lint/UselessDefaultValueArgument:
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.

https://docs.rubocop.org/rubocop/cops_lint.html#lintuselessdefaultvalueargument

This seems like a good idea, although I do notice that there's an example of including Rails.cache in the AllowedReceivers config. We should see what the results are of running this against Core. If there are many false positives (beyond Rails.cache), it may not be worth enabling.

Comment on lines +472 to +475
<% if rubocop_version >= "1.76" %>
Lint/UselessOr:
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.

rubocop.yml Outdated
Comment on lines 573 to 576
<% if rubocop_version >= "1.76" %>
Naming/PredicateMethod:
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.

https://docs.rubocop.org/rubocop/cops_naming.html#namingpredicatemethod

This seems nice, but I'm curious about false positives, especially in contexts where we have to use non-? suffixed "predicate" methods (e.g. is_foo as a GraphQL field method).

Copy link
Contributor

Choose a reason for hiding this comment

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

Disabled, as per #736 (comment)

Comment on lines +578 to +582
<% if rubocop_version >= "1.76" %>
Naming/PredicatePrefix:
<% else %>
Naming/PredicateName:
<% 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 just handles the cop being renamed. We may want to backport this so consumers don't get the warning.

Comment on lines +792 to +795
<% if rubocop_version >= "1.76" %>
Style/EmptyStringInsideInterpolation:
Enabled: false
<% end %>
Copy link
Contributor

Choose a reason for hiding this comment

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

https://docs.rubocop.org/rubocop/cops_style.html#styleemptystringinsideinterpolation

This controls the preference between

"...#{var ? "foo" : ""}...#{var ? "" : "bar"}..."

# or

"...#{"foo" if var}...#{"bar" unless var}..."

defaulting to preferring the latter.

I personally agree with it, but my gut feeling following the "Great Reset" is that we shouldn't enable this and leave it up to the author.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, that is right.

Comment on lines +1141 to +1144
<% if rubocop_version >= "1.76" %>
Style/RedundantArrayFlatten:
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.

https://docs.rubocop.org/rubocop/cops_style.html#styleredundantarrayflatten

While this is a Style cop, it is also an optimization, as it avoids the work of the redundant flattening operation, so I think we should enable it.

@@ -1,3 +1,5 @@
up:
- ruby
- bundler

test: bundle exec rake
Copy link
Contributor

Choose a reason for hiding this comment

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

🤷 I just want dev test due to habit.

@sambostock sambostock merged commit 3c3466a into main Jun 9, 2025
20 of 21 checks passed
@sambostock sambostock deleted the dependabot/bundler/rubocop-a598e0f185 branch June 9, 2025 19:44
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.

2 participants