rubocop-rspec
rubocop-rspec copied to clipboard
Cop for consistent usage of parens in FactoryBot calls
Implement a new cop that enables the enforcement of parentheses in factory bot calls.
This cop attempts to solve the "issue" outlined in #416 edit: fixes #416
Before submitting the PR make sure the following are checked:
- [x] Feature branch is up-to-date with
master(if not - rebase it). - [x] Squashed related commits together.
- [x] Added tests.
- [x] Updated documentation.
- [x] Added an entry to the
CHANGELOG.mdif the new code introduces user-observable changes. - [x] The build (
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 created a new cop:
- [x] Added the new cop to
config/default.yml. - [x] The cop is configured as
Enabled: pendinginconfig/default.yml. - [x] The cop documents examples of good and bad code.
- [x] The tests assert both that bad code is reported and that good code is not reported.
- [x] Set
VersionAddedindefault/config.ymlto the next minor version.
If you have modified an existing cop's configuration options:
- [ ] Set
VersionChangedinconfig/default.ymlto the next major version.
This cop attempts to solve the "issue" outlined in #416
RuboCop is red, I hope you'll find it relatively easy to fix it.
@Darhazer Sorry for a long time between activities ^^ I pretty much forgot that this pr exists :D. I added your concern about the 'nested' call as a spec: https://github.com/rubocop/rubocop-rspec/pull/1096/files#diff-e694e1d15e68306d0a724e35afadbc5a430fd6602ccd827e985f2aefae2935c7R228.
I also added some specs for multiline calls: https://github.com/rubocop/rubocop-rspec/pull/1096/files#diff-e694e1d15e68306d0a724e35afadbc5a430fd6602ccd827e985f2aefae2935c7R160-R175.
🙏🏻 Thank you for the work on rspec and rubocop.
@pirj I rebased onto upstream, regenerated the docs and implement your suggestions ^^ Thank you for the review :D
Thank you! Looks great 🙌
ah 🤦🏻 @pirj Sorry. Should have checked again if the CI passed :/. Thank you very much for fixing it!
Thank you for the contribution, your time and effort, @Liberatys! My apologies for delaying the merge.