-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Include **/factories.rb
in the inspection target
#104
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,8 @@ | |
FactoryBot: | ||
Enabled: true | ||
Include: | ||
- "**/spec/factories.rb" | ||
- "**/factories.rb" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But would we also analyze eg app/presenters/factories.rb? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, but I think this is a risk we should accept when we decide to put There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand that factory_bot defaults to **/factories.rb as the definition file path. However, I doubt that it should be the default for rubocop-factory_bot. Because I am concerned about the increased risk of false positives, as also #104 (comment). Also, even if some users wanted to fix this, I felt it was not necessary to include it in the default because it could be avoided by simply adding the target path to |
||
- "**/spec/factories/**/*.rb" | ||
- "**/test/factories.rb" | ||
- "**/test/factories/**/*.rb" | ||
- "**/features/support/factories/**/*.rb" | ||
DocumentationBaseURL: https://docs.rubocop.org/rubocop-factory_bot | ||
|
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’m uncertain if it’s deliberate or not, but they would also load from factories/**/*.rb
Yet another doc https://github.com/thoughtbot/factory_bot/blob/cf3f21fcbbccbc40849c74a84eeb0bb0bd6c7606/docs/src/defining/file-paths.md?plain=1#L7 yhat doesn’t mention this consistently.