-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
Autocorrect: contextual
causing error
#1916
Comments
A workaround would be to update Do we need to bump the dependency like we planned to here? #1901 Wondering why #1882 didn’t work? Wondering why ‘bundle install’ output is so dry https://github.com/rubocop/rubocop-rspec/actions/runs/9148652715/job/25151426029 |
Confirming that CI testing with the oldest RuboCop version does indeed work; see #1920. The problem must be elsewhere. |
I ran the following on local: Revert to hacks for rubocop-factory_bot and rubocop-rspec_rails diff --git a/Gemfile b/Gemfile
index 5985c04..18d0b4a 100644
--- a/Gemfile
+++ b/Gemfile
@@ -15,6 +15,4 @@ group :test do
gem 'rubocop', '~> 1.50.0', require: false
gem 'rubocop-performance', '~> 1.16', require: false
gem 'rubocop-rspec', '~> 2.19', require: false
- gem 'rubocop-factory_bot', '!= 2.26.0', require: false
- gem 'rubocop-rspec_rails', '!= 2.29.0', require: false
end
Change to diff --git a/Gemfile b/Gemfile
index 5985c04..2a75e86 100644
--- a/Gemfile
+++ b/Gemfile
@@ -12,9 +12,7 @@ group :test do
gem 'simplecov', require: false
gem 'simplecov-console', require: false
gem 'rspec', '~> 3.0', require: false
- gem 'rubocop', '~> 1.50.0', require: false
+ gem 'rubocop', '~> 1.61.0', require: false
gem 'rubocop-performance', '~> 1.16', require: false
gem 'rubocop-rspec', '~> 2.19', require: false
- gem 'rubocop-factory_bot', '!= 2.26.0', require: false
- gem 'rubocop-rspec_rails', '!= 2.29.0', require: false
end
|
I have not yet figured out why this happens but at least v1.61 or higher seems to solve it. |
Having the same issue setting to 1.61 does not fix the issue. |
Can the problem solved by upgrading to rubocop-rspec v3.0.1? |
v3.0.1 appears to have fixed it all. |
I checked it, and it seems fixed 👍🏻 |
Property AutoCorrect of cop FactoryBot/CreateList is supposed to be a boolean and contextual is not by setting upper limit for * rubocop-factory_bot * rubocop-rspec_rails rubocop/rubocop-rspec#1916
Property AutoCorrect of cop FactoryBot/CreateList is supposed to be a boolean and contextual is not by setting upper limit for * rubocop-factory_bot * rubocop-rspec_rails rubocop/rubocop-rspec#1916
error from said version of rubocop: RuboCop::ValidationError: Property AutoCorrect of cop FactoryBot/CreateList is supposed to be a boolean and contextual is not. version `1.61` fixes that issue, allowing all tests to pass. found that solution in this issue: rubocop/rubocop-rspec#1916 from rubocop-rspec, where they were experiencing the same error, and updating rubocop to 1.61, solved the issue. However they don't appear to know the culprit of this.
error from said version of rubocop: RuboCop::ValidationError: Property AutoCorrect of cop FactoryBot/CreateList is supposed to be a boolean and contextual is not. version `1.61` of `rubocop` fixes that issue, allowing all tests to pass. found that solution in this issue: rubocop/rubocop-rspec#1916 from rubocop-rspec, where they were experiencing the same error and updating rubocop to 1.61, solved the issue. However they don't appear to know the culprit of this.
error from said version of rubocop: RuboCop::ValidationError: Property AutoCorrect of cop FactoryBot/CreateList is supposed to be a boolean and contextual is not. version `1.61` of `rubocop` fixes that issue, allowing all tests to pass. found that solution in this issue: rubocop/rubocop-rspec#1916 from rubocop-rspec, where they were experiencing the same error and updating rubocop to 1.61, solved the issue. However they don't appear to know the culprit of this.
error from said version of rubocop: RuboCop::ValidationError: Property AutoCorrect of cop FactoryBot/CreateList is supposed to be a boolean and contextual is not. version `1.61` of `rubocop` fixes that issue, allowing all tests to pass. found that solution in this issue: rubocop/rubocop-rspec#1916 from rubocop-rspec, where they were experiencing the same error and updating rubocop to 1.61, solved the issue. However they don't appear to know the culprit of this.
error from said version of rubocop: RuboCop::ValidationError: Property AutoCorrect of cop FactoryBot/CreateList is supposed to be a boolean and contextual is not. version `1.61` of `rubocop` fixes that issue, allowing all tests to pass. found that solution in this issue: rubocop/rubocop-rspec#1916 from rubocop-rspec, where they were experiencing the same error and updating rubocop to 1.61, solved the issue. However they don't appear to know the culprit of this.
error from said version of rubocop: RuboCop::ValidationError: Property AutoCorrect of cop FactoryBot/CreateList is supposed to be a boolean and contextual is not. version `1.61` of `rubocop` fixes that issue, allowing all tests to pass. found that solution in this issue: rubocop/rubocop-rspec#1916 from rubocop-rspec, where they were experiencing the same error and updating rubocop to 1.61, solved the issue. However they don't appear to know the culprit of this.
The latest versions of rubocop-factory_bot and rubocop-respec_rails are causing rubocop-rspec to break with something like the following:
➜ dependency_checker git:(main) bundle exec rubocop Error: Property AutoCorrect of cop FactoryBot/CreateList is supposed to be a boolean and contextual is not. ➜ dependency_checker git:(main)
Manually correcting the above gems fixes the issue, e.g.,
Given this repository as an example, puppetlabs/dependency_checker, I can see from the Gemspec.lock the rubocop-rspec seems to be pulling the above dependencies in.
Excluding the lates versions as below fixes the issue:
The text was updated successfully, but these errors were encountered: