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

highlight unused tests #411

Merged
merged 1 commit into from
Mar 13, 2023
Merged

Conversation

myazinn
Copy link
Collaborator

@myazinn myazinn commented Mar 12, 2023

Closes #402
Also improves detection of unused effects, now it can detect cases when effect is unused and followed by non-effect types like this

ZIO.succeed(1)
println("")

But I had to use internal plugin API to make it work :( I could just copy-pasted the whole method (wouldn't be the first time), but decided to use a temp hack. Hopefully it'll become a public API in the nearest releases. If not, we can use good old copy-pasting :)

import org.jetbrains.plugins.scala.lang.psi.api.expr.ScExpression

// dirty hack to make expressionResultIsNotUsed public
// todo use original method directly when (if) it's a public API
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this :) I would just rip the code, but I keep forgetting Scala can do this!

@hmemcpy
Copy link
Collaborator

hmemcpy commented Mar 13, 2023

<3 Thanks a lot!

@hmemcpy hmemcpy merged commit 6fd705c into zio:idea231.x Mar 13, 2023
hmemcpy pushed a commit that referenced this pull request Mar 13, 2023
@myazinn myazinn deleted the highlight_unused_tests branch March 14, 2023 17:22
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.

Detect missing test composition with + when using ZIO 2.0 tests
2 participants