Open
Description
Add @CheckResult
/@CheckReturnValue
to assertThat
so that Detekt can makes sure that you do something with the result of the assertThat
methods.
See https://detekt.github.io/detekt/potential-bugs.html#ignoredreturnvalue
You could use an existing annotation from another dependency, or even just assertk.annotation.CheckReturnValue
would be good enough to use with the detekt rule.
Related:
- Errorprone check: https://errorprone.info/bugpattern/CheckReturnValue
- Jspecify might add an annotation:
@MayIgnoreResult
/@MustUseResult
: mark whether a non-void function is okay to call as if void jspecify/jspecify#200 - Kotlin might add something related: https://youtrack.jetbrains.com/issue/KT-12719