-
Notifications
You must be signed in to change notification settings - Fork 213
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
Broken reverse_each
autocorrect
#230
Closed
ignat-z opened this issue
Dec 18, 2020
· 2 comments
· Fixed by rubocop/rubocop-performance#201 or #234
Closed
Broken reverse_each
autocorrect
#230
ignat-z opened this issue
Dec 18, 2020
· 2 comments
· Fixed by rubocop/rubocop-performance#201 or #234
Labels
rubocop bug 🚨
An apparent bug in RuboCop
Comments
koic
added a commit
to koic/rubocop-performance
that referenced
this issue
Dec 18, 2020
Fixes standardrb/standard#230. This PR fixes the following incorrect auto-correct for `Performance/ReverseEach` when using multi-line `reverse.each` with leading dot. ```ruby % cat example.rb [1, 2, 3] .reverse .each do |idx| puts idx end ``` ## Before ```console % bundle exec rubocop -a --only Performance/ReverseEach % cat example.rb [1, 2, 3] .reverse _each do |idx| puts idx end ``` ## After ```console % bundle exec rubocop -a --only Performance/ReverseEach % cat example.rb [1, 2, 3] .reverse_each do |idx| puts idx end ```
8 tasks
This is a bug of RuboCop Performance. It will be fixed by rubocop/rubocop-performance#201. Thank you for your feedback. |
This issue has been resolved by RuboCop Performance 1.9.2. Thank you 🌅 |
patrickm53
pushed a commit
to patrickm53/performance-develop-rubyonrails
that referenced
this issue
Sep 23, 2022
Fixes standardrb/standard#230. This PR fixes the following incorrect auto-correct for `Performance/ReverseEach` when using multi-line `reverse.each` with leading dot. ```ruby % cat example.rb [1, 2, 3] .reverse .each do |idx| puts idx end ``` ## Before ```console % bundle exec rubocop -a --only Performance/ReverseEach % cat example.rb [1, 2, 3] .reverse _each do |idx| puts idx end ``` ## After ```console % bundle exec rubocop -a --only Performance/ReverseEach % cat example.rb [1, 2, 3] .reverse_each do |idx| puts idx end ```
richardstewart0213
added a commit
to richardstewart0213/performance-build-Performance-optimization-analysis-
that referenced
this issue
Nov 4, 2022
Fixes standardrb/standard#230. This PR fixes the following incorrect auto-correct for `Performance/ReverseEach` when using multi-line `reverse.each` with leading dot. ```ruby % cat example.rb [1, 2, 3] .reverse .each do |idx| puts idx end ``` ## Before ```console % bundle exec rubocop -a --only Performance/ReverseEach % cat example.rb [1, 2, 3] .reverse _each do |idx| puts idx end ``` ## After ```console % bundle exec rubocop -a --only Performance/ReverseEach % cat example.rb [1, 2, 3] .reverse_each do |idx| puts idx end ```
Cute0110
added a commit
to Cute0110/Rubocop-Performance
that referenced
this issue
Sep 28, 2023
Fixes standardrb/standard#230. This PR fixes the following incorrect auto-correct for `Performance/ReverseEach` when using multi-line `reverse.each` with leading dot. ```ruby % cat example.rb [1, 2, 3] .reverse .each do |idx| puts idx end ``` ## Before ```console % bundle exec rubocop -a --only Performance/ReverseEach % cat example.rb [1, 2, 3] .reverse _each do |idx| puts idx end ``` ## After ```console % bundle exec rubocop -a --only Performance/ReverseEach % cat example.rb [1, 2, 3] .reverse_each do |idx| puts idx end ```
SerhiiMisiura
added a commit
to SerhiiMisiura/Rubocop-Performance
that referenced
this issue
Oct 5, 2023
Fixes standardrb/standard#230. This PR fixes the following incorrect auto-correct for `Performance/ReverseEach` when using multi-line `reverse.each` with leading dot. ```ruby % cat example.rb [1, 2, 3] .reverse .each do |idx| puts idx end ``` ## Before ```console % bundle exec rubocop -a --only Performance/ReverseEach % cat example.rb [1, 2, 3] .reverse _each do |idx| puts idx end ``` ## After ```console % bundle exec rubocop -a --only Performance/ReverseEach % cat example.rb [1, 2, 3] .reverse_each do |idx| puts idx end ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems like
standard
produces incorrect code for multilinereverse.each
.Cop:
Performance/ReverseEach: Use 'reverse_each' instead of 'reverse.each'.
Minimal source to reproduce:
The text was updated successfully, but these errors were encountered: