-
-
Notifications
You must be signed in to change notification settings - Fork 278
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
Drop RSpec/EmptyExampleGroup customization #1007
Conversation
62dba1c
to
3eb0340
Compare
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.
This might work
Found a way around. Please take a look. |
7e6f968
to
718b398
Compare
I'll rebase this one. |
Nevermind, #956 comes first. |
It's time. I'll rebase this one. PS Once #956 is merged 🤦 |
718b398
to
0cf00f4
Compare
0cf00f4
to
8ae6bc1
Compare
Rebased on top of the current #956 |
8ae6bc1
to
d5ee738
Compare
JRuby crashed on |
d5ee738
to
98f4b78
Compare
I can reliably reproduce the issue with
|
56e8db8
to
9cd9efe
Compare
685e0e2
to
e0c648a
Compare
e0c648a
to
962939e
Compare
The customization is now made via .rubocop.yml configuration, i.e.: RSpec: Language: Includes: Example: - it_has_special_behavior
962939e
to
2e3ed04
Compare
There seems to be something broken in the edge RuboCop, I'm looking into it. |
I this is the change we’re looking for: rubocop/rubocop@51ff1d7#diff-0b9b1074946b724df02392b4d1fac4ccbc9ecff5c71166921d20c41a72ec1c14 If you want to merge, we can fix compatibility with edge in a later PR. |
The failure on |
We're providing a flexible way of customizing RSpec syntax thanks to #956
This is not based on #956, but rather includes it (can't specify a base branch from another fork).
Those are the changes 42f7708
This is the change needed to avoid mutating the default config between the examples 718b398
This way it's possible to drop customization of this cop instead customize via .rubocop.yml configuration, i.e.:
There's a problem with specs, though, specifically with this:
for_all_cops
is memoized inConfig
:It's not so obvious to notice, since in this cop the example that is modifying the language is in its own context, and it runs last.
Even if you add an example after it, due to how RSpec orders examples, it will still be executed last.
However, if you add a
context
with an example, you'll see that the language changes leaked.We need to figure out a way to reset the config between examples, and do it in a performant way.Thoughts?dup
inbefore
and assign back inafter
?Fixes #969
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
indefault/config.yml
to the next major version.