Skip to content
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

RSpec/SharedContext: needs CustomIncludeMethods setting #975

Closed
zverok opened this issue Jul 21, 2020 · 4 comments
Closed

RSpec/SharedContext: needs CustomIncludeMethods setting #975

zverok opened this issue Jul 21, 2020 · 4 comments

Comments

@zverok
Copy link
Contributor

zverok commented Jul 21, 2020

This setting exists for RSpec/EmptyExampleGroup, and is needed for SharedContext too: otherwise, the cop creates false positives with custom methods akin to its(:foo) { ... }.
We use those, but I believe there are several gems providing additional methods.

@pirj
Copy link
Member

pirj commented Jul 21, 2020

Agree, the detection of its etc needs to be supported, probably not limited to EmptyExampleGroup and SharedContext, but some existing, future and custom cops.

Adding aliases and configuring acceptable DSL is currently in the works in #956, it should pretty much cover this case.

Keeping this ticket open to remember about this case (we have quite a number of tickets that this DSL configuration will resolve).

Related: #333

@pirj
Copy link
Member

pirj commented Jul 21, 2020

PS we plan to drop CustomIncludeMethods in #969, and release it with 2.0 when the DSL configuration from #956 will be able to substitute what CustomIncludeMethods does now.

@pirj
Copy link
Member

pirj commented Nov 6, 2020

#956 has been released as part 2.0.

A reference implementation on how to allow third-party gems to configure their RSpec DSL configuration for RuboCop RSpec is tracked in #1077

Appreciate if you could handle it in saharspec provided the preliminary plan, @zverok.

@pirj pirj closed this as completed Nov 6, 2020
@pirj
Copy link
Member

pirj commented Nov 9, 2020

@zverok Example PRs palkan/action_policy#138, test-prof/test-prof#199

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants