Skip to content

Add a rule to flag places where ifBlank and ifEmpty can be used #2840

@BraisGabin

Description

@BraisGabin

Kotlin provides the functions ifBlank and ifEmpty so we should flag the points where this functions could be used. Example:

if (api.name.isBlank()) "John" else api.name
can be replaced to:
api.name.ifBlank { "John" }

The same for ifEmpty.

Context

https://twitter.com/kotlin/status/1277897234043097090

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions