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
Use node pattern generic parameters to simplify a cop #930
Conversation
RuboCop 0.8.7 we're currently depend on depends on |
c68c75c
to
08b5f46
Compare
end | ||
|
||
def find_aggregate_failures(example_node) | ||
example_node.send_node.each_ancestor(:block) | ||
.find { |block_node| aggregate_failures_present?(block_node) } | ||
.find { |block_node| aggregate_failures?(block_node, ANYTHING) } |
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.
A new addition to rubocop-ast
made it possible to pass in true
and _
-alike's.
That was it became possible to collapse two node matchers into one, since they only had that distinction.
One is used to match:
describe aggregate_examples: true do
# or
describe :aggregate_examples do
the other any of:
describe aggregate_examples: false do
# or
describe aggregate_examples: true do
# or
describe :aggregate_examples do
08b5f46
to
1a47e9e
Compare
Green. |
4afd467
to
4a6f646
Compare
#804 (comment) Support introduced in rubocop/rubocop-ast#31 Presumably this will land in RuboCop 1.0 or 1.0.1 worst case.
4a6f646
to
3b41df3
Compare
#804 (comment)
Support introduced in rubocop/rubocop-ast#31
Presumably generic parameters support will land in RuboCop 1.0 or 1.0.1 worst case.
Before submitting the PR make sure the following are checked:
master
(if not - rebase it).CHANGELOG.md
if the new code introduces user-observable changes.bundle exec rake
) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).