-
Notifications
You must be signed in to change notification settings - Fork 226
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
Lint Lenient Mode for captured Disposable #307
Conversation
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.
Does this cover subscribeWith?
It does. I can add a test case. |
...alysis/autodispose-lint/src/test/kotlin/com/uber/autodispose/lint/AutoDisposeDetectorTest.kt
Outdated
Show resolved
Hide resolved
) { | ||
context.report(ISSUE, node, context.getLocation(node), LINT_DESCRIPTION) | ||
val isUnusedReturnValue = isExpressionValueUnused(node) | ||
if (isUnusedReturnValue || !isCapturedTypeAllowed(node.returnType, method)) { |
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.
Can you add a test for method references? Both in java and kotlin
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.
That was a good catch, thanks!
443573d
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.
LGTM! Rebase and should be good to go to merge
52f674a
to
3821088
Compare
Description: This checks if the returned
Disposable
is handled by the user and doesn't raise errors in that case. We assume that you know what you're doing with it.Resolves #295