Skip to content
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

Lint/ShadowingOuterLocalVariable: clarify the ruby warning [doc] #8513

Merged
merged 2 commits into from Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,7 @@
### Changes

* [#8362](https://github.com/rubocop-hq/rubocop/issues/8362): Add numbers of correctable offenses to summary. ([@nguyenquangminh0711][])
* [#8513](https://github.com/rubocop-hq/rubocop/pull/8513): Clarify the ruby warning mentioned in the `Lint/ShadowingOuterLocalVariable` documentation. ([@chocolateboy][])

## 0.89.1 (2020-08-10)

Expand Down Expand Up @@ -4778,3 +4779,4 @@
[@sonalinavlakhe]: https://github.com/sonalinavlakhe
[@wcmonty]: https://github.com/wcmonty
[@nguyenquangminh0711]: https://github.com/nguyenquangminh0711
[@chocolateboy]: https://github.com/chocolateboy
8 changes: 4 additions & 4 deletions docs/modules/ROOT/pages/cops_lint.adoc
Expand Up @@ -3481,10 +3481,10 @@ end
| -
|===

This cop looks for use of the same name as outer local variables
for block arguments or block local variables.
This is a mimic of the warning
"shadowing outer local variable - foo" from `ruby -cw`.
This cop checks for the use of local variable names from an outer scope
in block arguments or block-local variables. This mirrors the warning
given by `ruby -cw` prior to Ruby 2.6:
"shadowing outer local variable - foo".

=== Examples

Expand Down
8 changes: 4 additions & 4 deletions lib/rubocop/cop/lint/shadowing_outer_local_variable.rb
Expand Up @@ -3,10 +3,10 @@
module RuboCop
module Cop
module Lint
# This cop looks for use of the same name as outer local variables
# for block arguments or block local variables.
# This is a mimic of the warning
# "shadowing outer local variable - foo" from `ruby -cw`.
# This cop checks for the use of local variable names from an outer scope
# in block arguments or block-local variables. This mirrors the warning
# given by `ruby -cw` prior to Ruby 2.6:
# "shadowing outer local variable - foo".
#
# @example
#
Expand Down