-
Notifications
You must be signed in to change notification settings - Fork 11
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
Allow unit return type for suspend functions #293
base: main
Are you sure you want to change the base?
Conversation
Thanks for the contribution! Before we can merge this, we need @oguzcelik to sign the Salesforce Inc. Contributor License Agreement. |
Let's make this more intentional. Could we either add an opt-in annotation like |
import slack.lint.BaseSlackLintTest | ||
|
||
class RetrofitUsageDetectorTest : BaseSlackLintTest() { | ||
|
||
private companion object { | ||
private val allowUnitResponse = |
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 followed other examples of how to make the test recognise this import. Don't know if there is a better way.
* to have a return type of Unit, which otherwise will be flagged as an issue. | ||
*/ | ||
@Target(AnnotationTarget.FUNCTION) | ||
@Retention(AnnotationRetention.BINARY) |
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.
Marked as Binary retention as we don't need this at runtime.
Would you want to make the docs more explicit ? Something like:
|
Summary
This pr aims to fix the lint rule for retrofit usage. Solves this issue
For suspend functions it's a valid case to return Unit.
Requirements (place an
x
in each[ ]
)Unfortunately the contributing guidelines and Contributor license agreement links are not working.