-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
EmptyLiteral autocorrector respects StringLiterals/EnforcedStyle config #2594
Conversation
Looks correct, but do we need it? You forgot to update CHANGELOG, by the way. |
Hmm, is it because |
Auto-correction goes in a loop until there is nothing left to correct. |
From a performance perspective, it's much better to avoid creating new offenses. |
While we're at it. Do I need to check if |
Shouldn't happen. |
True, but performance isn't everything. There's also simplicity, clarity, and generality. |
Definitely, performance is not everything. But personally, I don't feel that this patch sacrifices anything in clarity. And we have a serious, serious problem with autocorrection performance right now. We have an open issue for this right now -- #2047. |
I'm ok with the proposed change, provided it gets a proper changelog entry. My only concern are the growing number of inter-cop deps. Maybe some preferences (like string literals, etc) should eventually be moved to a more generic location. At any rate - this is not very important right now. |
…edStyle` Before this commit it would replace `String.new` with `''` even if double-quoted string are preferred. Fixes rubocop#2593
CI green, no conflicts |
EmptyLiteral autocorrector respects StringLiterals/EnforcedStyle config
Before this PR it would replace
String.new
with''
even if double-quoted string were preferred.Fixes #2593