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

match_ordered_array cop should not auto-correct unless ezcater_matchers is installed #114

Open
mikowitz opened this issue Oct 12, 2022 · 2 comments

Comments

@mikowitz
Copy link
Contributor

This caused me some trouble in a recent project, where rubocop -a "correcting" instances of eq and match_array in my specs caused large portions of them to start failing because match_ordered_array was not available.

I think this should either be excluded from autocorrect (conditionally, if there's a way to check whether the gem is installed), or else ezcater_matchers should be made a runtime dependency of ezcater_rubocop so we can ensure it is installed.

The second option is tricky because ezcater_rubocop is currently a development dependency of ezcater_matchers.

One workaround is to explicitly include ezcater_matchers in our rails and gem template bundles, but that feels a bit like bandaid over a deeper dependency issue that should be resolved.

@jaeger401
Copy link

Thanks for raising this. I tend to agree with your analysis that finding a solution for (preferably conditionally) disabling the autocorrect would be the best path forward.

@rusterholz
Copy link

+1 to disabling the autocorrect. In general I think that we should not have any cops that encourage behavior which requires an optional additional gem.

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

No branches or pull requests

3 participants