Skip to content

Commit

Permalink
[Fix #7495] Documentation for Lint/AmbiguousBlockAssociation
Browse files Browse the repository at this point in the history
Add example on documentation for `Lint/AmbiguousBlockAssociation` to
make clear the possible resolutions
  • Loading branch information
AllanSiqueira authored and marcandre committed Oct 5, 2020
1 parent 90997a4 commit f6e0115
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -23,6 +23,7 @@
* [#8843](https://github.com/rubocop-hq/rubocop/issues/8843): Fix an incorrect autocorrect for `Lint/AmbiguousRegexpLiteral` when sending method to regexp literal receiver. ([@koic][])
* [#8842](https://github.com/rubocop-hq/rubocop/issues/8842): Save actual status to cache, except corrected. ([@hatkyinc2][])
* [#8835](https://github.com/rubocop-hq/rubocop/issues/8835): Fix an incorrect autocorrect for `Style/RedundantInterpolation` when using string interpolation for non-operator methods. ([@koic][])
* [#7495](https://github.com/rubocop-hq/rubocop/issues/7495): Example for `Lint/AmbiguousBlockAssociation` cop. ([@AllanSiqueira][])

### Changes

Expand Down Expand Up @@ -4956,3 +4957,4 @@
[@rdunlop]: https://github.com/rdunlop
[@ghiculescu]: https://github.com/ghiculescu
[@hatkyinc2]: https://github.com/hatkyinc2
[@AllanSiqueira]: https://github.com/allansiqueira
2 changes: 2 additions & 0 deletions docs/modules/ROOT/pages/cops_lint.adoc
Expand Up @@ -27,6 +27,8 @@ some_method a { |val| puts val }
----
# good
# With parentheses, there's no ambiguity.
some_method(a { |val| puts val })
# or (different meaning)
some_method(a) { |val| puts val }
# good
Expand Down
2 changes: 2 additions & 0 deletions lib/rubocop/cop/lint/ambiguous_block_association.rb
Expand Up @@ -15,6 +15,8 @@ module Lint
#
# # good
# # With parentheses, there's no ambiguity.
# some_method(a { |val| puts val })
# # or (different meaning)
# some_method(a) { |val| puts val }
#
# # good
Expand Down

0 comments on commit f6e0115

Please sign in to comment.