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
Looking at EmptyConditionalBody spec, some autocorrect scenarios (in expect_correction blocks) actually result in logic-breaking changes. For example:
expect_correction
rubocop/spec/rubocop/cop/lint/empty_conditional_body_spec.rb
Lines 115 to 133 in 3f24b82
To make it clearer here's the same case but with more real-world-y variable names:
# before if show_version puts VERSION elsif dry_run elsif delete_files `rm -rf *` end # after if show_version puts VERSION elsif delete_files `rm -rf *` end
After an autocorrect run, dry_run flag is no longer used which is a breaking change.
dry_run
1.60.2 (using Parser 3.3.0.5, rubocop-ast 1.30.0, running on ruby 3.2.1) [arm64-darwin22] /the latest on the main branch
1.60.2 (using Parser 3.3.0.5, rubocop-ast 1.30.0, running on ruby 3.2.1) [arm64-darwin22]
The text was updated successfully, but these errors were encountered:
The autocorrect is already marked as unsafe, but it could be improved to replace internal elsif branch bodies with nil, as opposed to removing them.
elsif
nil
if show_version puts VERSION elsif dry_run # internal branch, replace with `nil` nil elsif delete_files `rm -rf *` end
Sorry, something went wrong.
No branches or pull requests
Looking at EmptyConditionalBody spec, some autocorrect scenarios (in
expect_correction
blocks) actually result in logic-breaking changes. For example:rubocop/spec/rubocop/cop/lint/empty_conditional_body_spec.rb
Lines 115 to 133 in 3f24b82
To make it clearer here's the same case but with more real-world-y variable names:
After an autocorrect run,
dry_run
flag is no longer used which is a breaking change.RuboCop version
1.60.2 (using Parser 3.3.0.5, rubocop-ast 1.30.0, running on ruby 3.2.1) [arm64-darwin22]
/the latest on the main branch
The text was updated successfully, but these errors were encountered: