We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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 for Style/RedundantCondition is producing invalid code.
For the following code
def progress_text(batch_status, data_ready_status) if data_ready_status { 'in_progress' => 'In Progress', 'complete' => 'Complete', 'cancelled' => 'Cancelled' }[data_ready_status] else { 'in_progress' => 'In Progress', 'complete' => 'Batch complete', 'failed' => 'Failed' }[batch_status] end end
It is being autocorrected to
def progress_text(batch_status, data_ready_status) { 'in_progress' => 'In Progress', 'complete' => 'Complete', 'cancelled' => 'Cancelled' }[data_ready_status] || batch_status end
❯ bundle exec rubocop -V 1.29.0 (using Parser 3.1.2.0, rubocop-ast 1.17.0, running on ruby 3.1.0 arm64-darwin20) - rubocop-performance 1.13.3 - rubocop-rails 2.14.2 - rubocop-rake 0.6.0 - rubocop-rspec 2.10.0
The text was updated successfully, but these errors were encountered:
Thank you so much!
Looks like this issue has already been solved with #10606 Please wait for the next RuboCop version and it will work😄
Sorry, something went wrong.
No branches or pull requests
Autocorrect for Style/RedundantCondition is producing invalid code.
For the following code
It is being autocorrected to
RuboCop version
The text was updated successfully, but these errors were encountered: