-
-
Notifications
You must be signed in to change notification settings - Fork 283
Exclude all cops from inspecting factorybot files, except if explicit… #2099
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
Exclude all cops from inspecting factorybot files, except if explicit… #2099
Conversation
feb6ade
to
1d49a0a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
config/default.yml
Outdated
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RemoveConst | ||
inherit_mode: | ||
merge: | ||
- Include |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems unlikely to have remove_const in factories. Is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't 100% sure of the use for this cop, let's remove it. I have never done a remove_const in Rspec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic, thank you! 🙌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let’s squash down to 1 commit, and merge 👏🏼
16718f5
to
0b86050
Compare
Fixes #2093
@pirj as discussed
Reading the code, thanks to your help, I noticed that it might be preferable to exclude
factorybot
files from inspection. From my understanding, all the cops, except 2 (Metrics/BlockLength
andRSpec/RemoveConst
), are relevant for inspecting these files.I have included the 2 that are relevant apply to
factorybot
with the includeinherit_method
.Unsure about how to add tests for these? I read the test and decided it was not necessary to add some but let me know what you expect if so?
Let me know what you think.