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

undefined method `inject_defaults!' for RuboCop::ConfigLoader:Class with rubocop < 1.50 #89

Closed
agrieser-healthie opened this issue Dec 29, 2023 · 5 comments · Fixed by #96

Comments

@agrieser-healthie
Copy link

Per gemspec, requires rubocop ~> 1.33, but with versions below 1.50 it produces an exception:

undefined method `inject_defaults!' for RuboCop::ConfigLoader:Class

Upgrading rubocop to 1.50 or higher fixes this issue

ruby 3.2.2
Rails 6.1.7.6
factory_bot (6.4.2)
factory_bot_rails (6.4.2)

@pirj
Copy link
Member

pirj commented Dec 29, 2023

I thought it was released earlier than in 1.50, but certainly not in 1.33.
Our parent depends on 1.40, should we follow?

Do you use this gem without rubocop-rspec, @agrieser-healthie ?

@agrieser-healthie
Copy link
Author

I have the following installed:

rubocop (1.50.0)
rubocop-rails (2.17.2)
rubocop-graphql (1.1.1)
rubocop-rspec (2.14.2)
rubocop-performance (1.15.0)
rubocop-factory_bot (2.24.0)

Will be getting them updated shortly, just through I would raise the issue since I stumbled into it. Pretty sure I tried 1.40 and got the same error, I was trying to do as small an upgrade as possible to add this gem.

@pirj
Copy link
Member

pirj commented Dec 30, 2023

This gem is a dependency of rubocop-rspec since 2.22, and all cops were part of it prior to that. But in 3.0 we plan to separate them. Thanks for being an early adopter.

As for rubocop-rspec and inject_defaults I recall I couldn’t make it work.

Would you please send a PR to bump the dependency to 1.41 or whatever version of rubocop contains this, @agrieser-healthie ?

@pirj
Copy link
Member

pirj commented Jan 4, 2024

@agrieser-healthie can you please check if using rubocop-factory_bot from a bump-rubocop-version branch fixes your issue?

@pirj pirj closed this as completed in #96 Jan 4, 2024
@pirj
Copy link
Member

pirj commented Jan 4, 2024

Or master since we’ve merged the fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants