Replies: 9 comments 1 reply
-
Recently I was thinking the same - it's time to extract FactoryBot and Capybara checks under their own space. We can then make rubocop offer the specific cops based on the installed gems, and we can have the 3.0 release without them |
Beta Was this translation helpful? Give feedback.
-
I was able to change the base for the following cops from
with a small change required in just two of them ( - #Runners.all
+ {:to :not_to :to_not} which is now I think was a mistake to make a part of a config. Unlike other DSL elements, there is no obvious way to alias them. PS fixed in #1459 |
Beta Was this translation helpful? Give feedback.
-
I was thinking we may actually make the transition smoother. This, I believe, can be done in a minor version:
In a major version update, we can remove dependencies on those gems and remove their configs from |
Beta Was this translation helpful? Give feedback.
-
@pirj Great job on the RuboCop Capybara extraction🎉 I'm sure we'll move forward with other extractions in the future, but I'm also interested in this topic and would like to help. If there's anything I can do to help, please let me know! (although I may be limited in what I can do since I'm not a member of the RuboCop core team and I'm not a collaborator to RuboCop RSpec 😅) |
Beta Was this translation helpful? Give feedback.
-
Thank you!
I’ve started in the same position, I don’t have permissions to create repos under rubocop namespace, so I went with a repo under my name.
Also, the extraction pr doesn’t require any special permissions.
We can split factory bot and rspec rails. Pick the one that you like most.
|
Beta Was this translation helpful? Give feedback.
-
Thank you 😀! Now I will attempt to extract factory_bot. |
Beta Was this translation helpful? Give feedback.
-
Would anyone be up for extracting the Rails cops, I guess into a https://github.com/rubocop/rubocop-rspec-rails/ repo? (#1734) |
Beta Was this translation helpful? Give feedback.
-
@bquorning If it's okay with me, I'll do it. I will start working on it next week. |
Beta Was this translation helpful? Give feedback.
-
It’s all done! Thank you @bquorning , @pirj , @Darhazer and everyone 🚀 |
Beta Was this translation helpful? Give feedback.
-
We now have several major departments:
rspec-rails
)factory_bot
)capybara
)Our project is (from different sources) "Code style checking for RSpec files" and "RSpec-specific analysis for your projects".
The latter two, besides RSpec work with:
Wondering if users of those testing frameworks could benefit from using our cops without adding RSpec cops.
Well, they can do it with e.g.:
The only one I'd keep out of the FactoryBot-related department is
RSpec/FactoryBot/SyntaxMethods
, as it suggests including a module and skip use FactoryBot DSL methods from specs without an explicitFactoryBot
receiver.For Capybara, it's half by half RSpec and pure Capybara at a glance.
For Rails department, all cops are RSpec-specific.
It's not that it's urgent, and neither the number of semi-related cops is overwhelming (7-8 at best).
Just an idea to split into several repos and gems.
Release wise, keep one major (3.0?)
rubocop-rspec
version to depend onrubocop-capybara
andrubocop-factory_bot
, but in 4.0, remove those dependencies and make a note to install and configure them separately, and only ship RSpec-related inrubocop-rspec
.Beta Was this translation helpful? Give feedback.
All reactions