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-rails from 2.27.0 to 2.28.0 in the rubocop group #6035

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Dec 30, 2024

Bumps the rubocop group with 1 update: rubocop-rails.

Updates rubocop-rails from 2.27.0 to 2.28.0

Release notes

Sourced from rubocop-rails's releases.

RuboCop Rails 2.28.0

New features

  • #1383: Introduce AllCops: MigratedSchemaVersion config. (@​koic)

Bug fixes

  • #1390: Fix an incorrect autocorrect for Rails/SelectMap when select has no receiver and method chains are used. (@​masato-bkn)
  • #1382: Fix false negatives for Rails/RedundantActiveRecordAllMethod when using all method in block. (@​masato-bkn)
  • #1397: Fix Rails/FilePath cop error on join method with implicit receiver. (@​viralpraxis)
  • #1398: Fix Rails/FilePath cop error in case of extra operations in Rails.root interpolation. (@​viralpraxis)
  • #1392: Fix Rails/FilePath cop error with rescued Rails.root. (@​viralpraxis)

Changes

  • #1388: Modify Rails/Pluck to ignore map/collect when used inside blocks to prevent potential N+1 queries. (@​masato-bkn)
Changelog

Sourced from rubocop-rails's changelog.

2.28.0 (2024-12-25)

New features

  • #1383: Introduce AllCops: MigratedSchemaVersion config. ([@​koic][])

Bug fixes

  • #1390: Fix an incorrect autocorrect for Rails/SelectMap when select has no receiver and method chains are used. ([@​masato-bkn][])
  • #1382: Fix false negatives for Rails/RedundantActiveRecordAllMethod when using all method in block. ([@​masato-bkn][])
  • #1397: Fix Rails/FilePath cop error on join method with implicit receiver. ([@​viralpraxis][])
  • #1398: Fix Rails/FilePath cop error in case of extra operations in Rails.root interpolation. ([@​viralpraxis][])
  • #1392: Fix Rails/FilePath cop error with rescued Rails.root. ([@​viralpraxis][])

Changes

  • #1388: Modify Rails/Pluck to ignore map/collect when used inside blocks to prevent potential N+1 queries. ([@​masato-bkn][])
Commits
  • fcc4cf6 Cut 2.28.0
  • bac0f3e Update Changelog
  • 2c357f0 Merge pull request #1383 from koic/intro_migrated_schema_version
  • 86b7a55 Introduce AllCops: MigratedSchemaVersion config
  • 2671fb4 Merge pull request #1398 from viralpraxis/fix-rails-file-path-cop-error-on-jo...
  • 815d119 Fix Rails/FilePath cop error on join method with implicit receiver
  • fecead8 Merge pull request #1399 from viralpraxis/fix-rails-file-path-cop-error-on-ex...
  • e4aee6b Fix Rails/FilePath cop error in case of extra operations in Rails.root in...
  • c6f869b Merge pull request #1392 from viralpraxis/fix-rails-file-path-cop-error-with-...
  • bb03d6b Fix Rails/FilePath cop error with rescued Rails.root
  • 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

Bumps the rubocop group with 1 update: [rubocop-rails](https://github.com/rubocop/rubocop-rails).


Updates `rubocop-rails` from 2.27.0 to 2.28.0
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](rubocop/rubocop-rails@v2.27.0...v2.28.0)

---
updated-dependencies:
- dependency-name: rubocop-rails
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: rubocop
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot requested a review from jorg-vr as a code owner December 30, 2024 12:35
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Dec 30, 2024
@jorg-vr jorg-vr requested a review from bmesuere as a code owner January 2, 2025 11:05
Copy link
Member

@bmesuere bmesuere left a comment

Choose a reason for hiding this comment

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

This seems to modify the behaviour of the code (the tests fail)

@jorg-vr jorg-vr marked this pull request as draft January 7, 2025 14:47
@jorg-vr
Copy link
Contributor

jorg-vr commented Jan 7, 2025

I've decided to ignore the newly complaining rubocop rule that limits chaining of safe navigation

The idea behind the rule that is less clear from the code which part of the chain can return nil.
But in places where long chains are actually used, multiple points in the chain can return nil and the code would become a lot more complex with multiple extra if checks if we want to correctly apply the rule.

IMO this isn't an improvement:

  def course_admin?
    return false unless user
    return false unless record
    return false unless record.evaluation
    return false unless record.evaluation.series

    user.course_admin?(record.evaluation.series.course)
  end

compared to:

  def course_admin?
    user&.course_admin?(record&.evaluation&.series&.course)
  end

@jorg-vr jorg-vr marked this pull request as ready for review January 7, 2025 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants