Skip to content

Commit

Permalink
Lint/ShadowingOuterLocalVariable: clarify the ruby warning [doc] (#8513)
Browse files Browse the repository at this point in the history
  • Loading branch information
chocolateboy committed Aug 11, 2020
1 parent 1cc36a0 commit c14d8c0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
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

0 comments on commit c14d8c0

Please sign in to comment.