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
[Fix #10427] Style/For: Mark auto-correction as unsafe #10429
Conversation
Oops, my commit message started Also, do I have to do anything here to get the CircleCI tests to run? |
I don't understand why the CircleCi runs have not started. |
@@ -0,0 +1 @@ | |||
* [#10427](https://github.com/rubocop/rubocop/issues/10427): Mark `Style/For` as unsafe auto-correction. ([@issyl0][]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, as a first time contributor, you need to add your name at the bottom of CHANGELOG.md. See the last bullet point on https://github.com/rubocop/rubocop/blob/master/CONTRIBUTING.md.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to manually update the CHANGELOG.md file as first time contributor name will be inserted automatically :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's great! So much automation going on that I haven't kept up with.
- The Ruby Style Guide (https://rubystyle.guide/#no-for-loops) states that "for doesn’t introduce a new scope (unlike each) and variables defined in its block will be visible outside it". This means that auto-correcting can break existing, working code because of the change in variable scope.
Thanks! |
The only thing I didn't do in the PR checklist is add tests, because a recent, different PR to mark a cop as unsafe (10408) didn't have any. Hope that's OK!
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and runs RuboCop on its own code.{change_type}_{change_description}.md
if the new code introduces user-observable changes. See changelog entry format for details.