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

Error running "rubocop --require rubocop-rspec" #6634

Closed
mellansquare opened this issue Jan 8, 2019 · 4 comments
Closed

Error running "rubocop --require rubocop-rspec" #6634

mellansquare opened this issue Jan 8, 2019 · 4 comments
Labels

Comments

@mellansquare
Copy link

mellansquare commented Jan 8, 2019

I'm trying to update rubocop after getting the following deprecation warning when running my spec:

"DEPRECATION WARNING: Static attributes will be removed in FactoryBot 5.0. Please use dynamic
attributes instead by wrapping the attribute value in a block:

admin { true }

To automatically update from static attributes to dynamic ones,
install rubocop-rspec and run:

rubocop
--require rubocop-rspec
--only FactoryBot/AttributeDefinedStatically
--auto-correct"

I've installed the rubocop gem successfully but when I run 'rubocop --require rubocop-rspec" as above I get a failure.

Mention the following information in the issue report:
0.61.1 (using Parser 2.5.3.0, running on ruby 2.3.4 x86_64-linux)`

It's actually much longer but I'm not sure how to get the whole backtrace to come up in the terminal so I can copy/paste it across.

Thanks!

@Darhazer
Copy link
Member

Darhazer commented Jan 8, 2019

It's been reported that rubocop-rspec do not work if you don't have .rubocop.yml file (even an empty one). So as a quick fix, you can create one

@mellansquare
Copy link
Author

Thanks! I'm a total beginner. Does it matter where I put the .rubocop.yml file?

@tejasbubane
Copy link
Contributor

@mellansquare Ref: https://rubocop.readthedocs.io/en/latest/configuration/

RuboCop will start looking for the configuration file in the directory where the inspected file is and continue its way up to the root directory.

Best place would be the project root directory if you want the config to be applicable to the entire project.

@Drenmi
Copy link
Collaborator

Drenmi commented Feb 5, 2019

@mellansquare I hope the directions provided solved your issue. If not, feel free to re-open. 🙇

@Drenmi Drenmi closed this as completed Feb 5, 2019
@Drenmi Drenmi added the question label Feb 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants