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

Cop for require_dependency usage #446

Closed
ngan opened this issue Mar 8, 2021 · 2 comments
Closed

Cop for require_dependency usage #446

ngan opened this issue Mar 8, 2021 · 2 comments
Labels
feature request Request for new functionality

Comments

@ngan
Copy link
Contributor

ngan commented Mar 8, 2021

Is your feature request related to a problem? Please describe.

For rails apps that are using Zeitwerk, all usages of require_dependency should be deprecated.

Describe the solution you'd like

We've written a cop to look for this and thought it'd be a good idea to share it here. Is this something maintainers would be interested in? It would probably be disabled by default since not even is on Zeitwerk yet.

@koic
Copy link
Member

koic commented Mar 9, 2021

I think this cop can be accepted. Ideally, it should be disabled the cop when static analysis can determine that the classic loader (not Zeitwerk) is used, but I think first behaviour can start by disabling the cop by default.

@koic koic added the feature request Request for new functionality label Mar 9, 2021
@ngan
Copy link
Contributor Author

ngan commented Mar 10, 2021

I'm closing this because my coworker is pushing our implementation up: #447

@ngan ngan closed this as completed Mar 10, 2021
koic added a commit that referenced this issue Mar 17, 2021
[Fix #446] Add new Rails/RequireDependency cop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request for new functionality
Projects
None yet
Development

No branches or pull requests

2 participants