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

Add a cop for Ruby 3 deprecated methods in Socket #9716

Closed
tas50 opened this issue Apr 20, 2021 · 4 comments · Fixed by #9732
Closed

Add a cop for Ruby 3 deprecated methods in Socket #9716

tas50 opened this issue Apr 20, 2021 · 4 comments · Fixed by #9732

Comments

@tas50
Copy link
Contributor

tas50 commented Apr 20, 2021

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

Ruby 3 deprecates Socket.gethostbyaddr and Socket.gethostbyname. See https://bugs.ruby-lang.org/issues/13097. It would be really great if RuboCop would detect these deprecated methods to cleanup codebases automatically.

Describe the solution you'd like

Detection and correction of the legacy methods.

@AndreiEres
Copy link

AndreiEres commented Apr 22, 2021

@tas50 I can't imagine how we can autocorrect that. Could you explain it? Or we can do it without autocorrection.

@tas50
Copy link
Contributor Author

tas50 commented Apr 22, 2021

It should get flagged even if it can't be autocorrected, but the error message gives a pretty clear update for most use cases.

@bbatsov
Copy link
Collaborator

bbatsov commented Apr 22, 2021

Agreed.

@AndreiEres
Copy link

So check it out please #9732

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

Successfully merging a pull request may close this issue.

4 participants