Skip to content
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

Merged
merged 5 commits into from Dec 12, 2018
Merged

Conversation

ShaishavGandhi
Copy link
Collaborator

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

Copy link
Collaborator

@ZacSweers ZacSweers left a 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?

@ShaishavGandhi
Copy link
Collaborator Author

It does. I can add a test case.

) {
context.report(ISSUE, node, context.getLocation(node), LINT_DESCRIPTION)
val isUnusedReturnValue = isExpressionValueUnused(node)
if (isUnusedReturnValue || !isCapturedTypeAllowed(node.returnType, method)) {
Copy link
Collaborator

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

Copy link
Collaborator Author

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

Copy link
Collaborator

@ZacSweers ZacSweers left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants