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 rubocop#10969] Allow Lint/AmbiguousBlockAssociation
`AllowedPa…
#10970
Conversation
@@ -81,7 +81,7 @@ def ambiguous_block_association?(send_node) | |||
def allowed_method_pattern?(node) | |||
node.assignment? || node.operator_method? || node.method?(:[]) || | |||
allowed_method?(node.last_argument.method_name) || |
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.
How about the same problem with AllowedMethods
?
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 there it's fine to match on the name. Generally, it's a bit unclear which patterns would need to match on the entire send
node's source.
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.
AllowedMethods
and AllowedPatterns
have different uses, so AllowedMethods
seems fine.
I'm planning to cut a new release very soon, so it'd be nice to update this changelog entry and wrap up this bugfix in time for the next release. |
fa047b5
to
525cff1
Compare
Please let me know if I should make any further changes. Thank you. 🙇 |
changelog/fix_allow_ambigious_block_association_to_match_source.md
Outdated
Show resolved
Hide resolved
…ttern` to match on `send_node.source` instead of `method_name`.
Thanks! |
[Fix #10969] Allow
Lint/AmbiguousBlockAssociation
AllowedPattern
to match onsend_node.source
instead ofmethod_name
[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.