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

Autocorrect support for Lint/ErbNewArguments #7219

Closed
dduugg opened this issue Jul 18, 2019 · 2 comments · Fixed by #7221
Closed

Autocorrect support for Lint/ErbNewArguments #7219

dduugg opened this issue Jul 18, 2019 · 2 comments · Fixed by #7221
Assignees

Comments

@dduugg
Copy link
Contributor

dduugg commented Jul 18, 2019

The Lint/ErbNewArguments cop introduced in #5845 produces messages like "Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments." and "Passing trim_mode with the 3rd argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, trim_mode: '-') instead."

It would be nice if there was an autocorrect to remove the 2nd arg and convert the subsequent ones to kwargs.

@koic koic self-assigned this Jul 19, 2019
koic added a commit to koic/rubocop that referenced this issue Jul 19, 2019
Fixes rubocop#7219.

This PR supports auto-correct for `Lint/ErbNewArguments`.

legacy `trim_mode` arg and legacy `eoutvar` arg take precedence over kwargs.
https://github.com/ruby/ruby/blob/v2_7_0_preview1/lib/erb.rb#L821-L828
@koic
Copy link
Member

koic commented Jul 19, 2019

Thanks for the feedback. I opened a PR #7221.

bbatsov pushed a commit that referenced this issue Jul 19, 2019
Fixes #7219.

This PR supports auto-correct for `Lint/ErbNewArguments`.

legacy `trim_mode` arg and legacy `eoutvar` arg take precedence over kwargs.
https://github.com/ruby/ruby/blob/v2_7_0_preview1/lib/erb.rb#L821-L828
@dduugg
Copy link
Contributor Author

dduugg commented Jul 19, 2019

Wow, that was fast! Thanks!

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.

2 participants