saveourtool/diktat

Detect useless scoped functions

Open

#972 创建于 2021年7月7日

在 GitHub 查看
 (0 评论) (0 反应) (1 负责人)Kotlin (40 fork)github user discovery
enhancementgood first issuehelp wantedneeded

仓库指标

Star
 (571 star)
PR 合并指标
 (PR 指标待抓取)

描述

Implement the rule, which will detect useless scoped functions, and remove extra actions. For example, in a bundle of let - run it can be quite often met situations, when run contain single statement, which is actually will work without run:

someValue?.let {
                foo()
            }
                ?: run {
                    bar()
                }

Expected behavior

someValue?.let {
                foo()
            }
                ?: bar()

贡献者指南