-
-
Notifications
You must be signed in to change notification settings - Fork 270
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
Add ExplicitOnly
configuration option to RSpec/FactoryBot/ConsistentParenthesesStyle
, RSpec/FactoryBot/CreateList
and RSpec/FactoryBot/FactoryNameStyle
#1487
Conversation
@@ -929,7 +929,9 @@ RSpec/FactoryBot/ConsistentParenthesesStyle: | |||
SupportedStyles: | |||
- require_parentheses | |||
- omit_parentheses | |||
ExplicitOnly: false |
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 was thinking whether this could be applied to RSpec/FactoryBot
(the whole department) and affect the matcher on the receiver (whether to include nil receiver or not). @pirj WDYT?
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.
Indeed it is, looks good. So we cut out ExplicitOnly
into a common class to make it easier to handle, and added the configuration values to the other cop. WDYT?
lib/rubocop/cop/rspec/factory_bot/consistent_parentheses_style.rb
Outdated
Show resolved
Hide resolved
530d4b7
to
4db3f31
Compare
We have |
Suppose you want to use FactoryBot only with explicit receiver - as you are using methods like |
My understanding is that |
4db3f31
to
f1caccb
Compare
ExplicitOnly
configuration option to RSpec/FactoryBot/ConsistentParenthesesStyle
ExplicitOnly
configuration option to RSpec/FactoryBot/ConsistentParenthesesStyle
, RSpec/FactoryBot/CreateList
and RSpec/FactoryBot/FactoryNameStyle
.
ExplicitOnly
configuration option to RSpec/FactoryBot/ConsistentParenthesesStyle
, RSpec/FactoryBot/CreateList
and RSpec/FactoryBot/FactoryNameStyle
.ExplicitOnly
configuration option to RSpec/FactoryBot/ConsistentParenthesesStyle
, RSpec/FactoryBot/CreateList
and RSpec/FactoryBot/FactoryNameStyle
f1caccb
to
c10b14b
Compare
c10b14b
to
eea2e53
Compare
eea2e53
to
19c2b54
Compare
19c2b54
to
6563c10
Compare
It was conflicted, so I rebased it to the latest master branch. |
2517dc5
to
c103f00
Compare
c103f00
to
82d5cc0
Compare
82d5cc0
to
2e52c83
Compare
2e52c83
to
e25faa0
Compare
e25faa0
to
8c4e675
Compare
I rebased and resolved the conflict. |
8c4e675
to
4676c23
Compare
I'd hold this off until |
I've opened a PR in the rubocop-factory_bot repository and this one is closed |
Follow up: #1482 (comment)
Resolve: rubocop/rubocop-factory_bot#5
Before submitting the PR make sure the following are checked:
master
(if not - rebase it).CHANGELOG.md
if the new code introduces user-observable changes.bundle exec rake
) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).If you have modified an existing cop's configuration options:
VersionChanged
inconfig/default.yml
to the next major version.