Exclude all cops from inspecting factorybot files, except if explicit…#2099
Merged
pirj merged 6 commits intorubocop:masterfrom Aug 4, 2025
Conversation
feb6ade to
1d49a0a
Compare
pirj
approved these changes
Jul 31, 2025
config/default.yml
Outdated
| Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RemoveConst | ||
| inherit_mode: | ||
| merge: | ||
| - Include |
Member
There was a problem hiding this comment.
It seems unlikely to have remove_const in factories. Is this needed?
Contributor
Author
There was a problem hiding this comment.
I wasn't 100% sure of the use for this cop, let's remove it. I have never done a remove_const in Rspec
pirj
reviewed
Jul 31, 2025
pirj
reviewed
Jul 31, 2025
pirj
reviewed
Jul 31, 2025
bquorning
reviewed
Jul 31, 2025
bquorning
reviewed
Aug 4, 2025
bquorning
approved these changes
Aug 4, 2025
Collaborator
bquorning
left a comment
There was a problem hiding this comment.
Let’s squash down to 1 commit, and merge 👏🏼
ydah
approved these changes
Aug 4, 2025
bquorning
approved these changes
Aug 4, 2025
16718f5 to
0b86050
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2093
@pirj as discussed
Reading the code, thanks to your help, I noticed that it might be preferable to exclude
factorybotfiles from inspection. From my understanding, all the cops, except 2 (Metrics/BlockLengthandRSpec/RemoveConst), are relevant for inspecting these files.I have included the 2 that are relevant apply to
factorybotwith 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.