Skip to content

Add rule [RedundantSuspend] to detect redundant suspend modifiers #2156

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

Closed
tobiasschuerg opened this issue Dec 2, 2019 · 3 comments · Fixed by #2244
Closed

Add rule [RedundantSuspend] to detect redundant suspend modifiers #2156

tobiasschuerg opened this issue Dec 2, 2019 · 3 comments · Fixed by #2244

Comments

@tobiasschuerg
Copy link

There is already an inspection inside Intellij:

This inspection reports a suspend modifier as redundant if no other suspend functions are called inside.

Expected Behavior of the rule

Detects usages of suspend modifiers that are useless because the function is not suspendable.

suspend fun hello() {
  retrun "hello"
}

Context

@tobiasschuerg tobiasschuerg changed the title Add rule to detect redundant suspend Add rule [RedundantSuspend] to detect redundant suspend modifiers Dec 2, 2019
@schalkms
Copy link
Member

Good idea! Thanks for submitting this nice idea. 😊
Do you have some resources to help us out here? @tobiasschuerg
Any help is highly appreciated.

@schalkms
Copy link
Member

This rule should also go into the concurrenty ruleset. Please see my comment in #2155

@3flex 3flex self-assigned this Jan 7, 2020
@3flex 3flex removed their assignment Jan 11, 2020
@arturbosch arturbosch added this to the 1.4.0 milestone Jan 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants