We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The AssertPredicate cop does not appear to recognize when a method receives a block argument.
The AssertPredicate cop should not consider this an offense:
assert [1, 2, 3].any? { some_filter_function _1 }
Minitest/AssertPredicate: Prefer using assert_predicate([1, 2, 3], :any?).
Also, the autocorrect function discards the block entirely, leaving:
assert_predicate [1, 2, 3], :any?
1.28.2 (using Parser 3.1.2.0, rubocop-ast 1.17.0, running on ruby 3.1.2 arm64-darwin21)
The text was updated successfully, but these errors were encountered:
I just discovered as well that when disabling the cop with a comment, I get the following violation:
Unnecessary disabling of `Minitest/AssertPredicate` (did you mean `Minitest/AssertMatch`?).Lint/RedundantCopDisableDirective(RuboCop)
Sorry, something went wrong.
[Fix rubocop#172] Fix a false positive for Minitest/AssertPredicate
Minitest/AssertPredicate
f29cdca
Fixes rubocop#172. This PR fixes a false positive for `Minitest/AssertPredicate` and `Minitest/RefutePredicate` when using numbered parameters.
Merge pull request #173 from koic/fix_a_false_positive_for_minitest_a…
7706943
…ssert_predicate [Fix #172] Fix a false positive for `Minitest/AssertPredicate`
Successfully merging a pull request may close this issue.
The AssertPredicate cop does not appear to recognize when a method receives a block argument.
Expected behavior
The AssertPredicate cop should not consider this an offense:
Actual behavior
Also, the autocorrect function discards the block entirely, leaving:
RuboCop version
1.28.2 (using Parser 3.1.2.0, rubocop-ast 1.17.0, running on ruby 3.1.2 arm64-darwin21)
The text was updated successfully, but these errors were encountered: