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

Crash in version 2.21.2 (uninitialized constant RuboCop::Cop::Rails::RedundantActiveRecordAllMethod::AllowedReceivers) #1143

Closed
Zarthus opened this issue Oct 5, 2023 · 1 comment · Fixed by #1167
Labels
bug Something isn't working

Comments

@Zarthus
Copy link

Zarthus commented Oct 5, 2023

Expected behavior

No error/crash

Actual behavior

When upgrading from rubocop v2.21.1 to v2.21.2 we run into an error:

$ bundle exec rubocop

uninitialized constant RuboCop::Cop::Rails::RedundantActiveRecordAllMethod::AllowedReceivers
Did you mean?  RuboCop::Cop::AllowedIdentifiers

Describe here what actually happened.

Steps to reproduce the problem

I have created a MVP repository: https://gitlab.com/zarthus/reproduce-rubocop-issue (failing logs: https://gitlab.com/zarthus/reproduce-rubocop-issue/-/jobs/5233107356)

# Gemfile

gem "gitlab-styles", '= 10.1.0'
gem "rubocop-rails", "= 2.21.2"
# .rubocop.yml

inherit_gem:
  gitlab-styles:
    - rubocop-default.yml
# shell

bundle exec rubocop -V

RuboCop version

$ bundle exec rubocop -V

uninitialized constant RuboCop::Cop::Rails::RedundantActiveRecordAllMethod::AllowedReceivers
Did you mean?  RuboCop::Cop::AllowedIdentifiers

Forcing a downgrade, it works:

$ bundle update rubocop rubocop-graphql rubocop-performance rubocop-rails rubocop-factory_bot rubocop-performance rubocop-rspec
....
Bundle updated!

$ bundle exec rubocop -V
1.50.2 (using Parser 3.2.2.4, rubocop-ast 1.29.0, running on ruby 3.0.5) [x86_64-linux]
  - rubocop-graphql 0.19.0
  - rubocop-performance 1.19.1
  - rubocop-rails 2.21.1
  - rubocop-rspec 2.24.1

Reference material

@Zarthus Zarthus changed the title uninitialized constant RuboCop::Cop::Rails::RedundantActiveRecordAllMethod::AllowedReceivers Crash in version 2.21.2 (uninitialized constant RuboCop::Cop::Rails::RedundantActiveRecordAllMethod::AllowedReceivers) Oct 5, 2023
Zarthus added a commit to Zarthus/rubocop-rails that referenced this issue Oct 5, 2023
Update minimum required rubocop version since 2.21.2 (rubocop#1143)
@maser
Copy link

maser commented Oct 9, 2023

We also ran into this error. The AllowedReceivers mixin was added in Rubocop 1.52.0. rubocop-rails depends on Rubocop >= 1.33.0 though.

Zarthus added a commit to Zarthus/rubocop-rails that referenced this issue Oct 9, 2023
Update minimum required rubocop version since 2.21.2 (rubocop#1143)
@koic koic added the bug Something isn't working label Oct 12, 2023
koic added a commit to koic/rubocop-rails that referenced this issue Oct 26, 2023
…thod`

Fixes rubocop#1143.

This PR fixes an error for `Rails/RedundantActiveRecordAllMethod`
when using RuboCop 1.51 or lower.
koic added a commit that referenced this issue Oct 27, 2023
…ctive_record_all_method

[Fix #1143] Fix an error for `Rails/RedundantActiveRecordAllMethod`
xjunior added a commit to powerhome/power-tools that referenced this issue Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants