saveourtool/diktat

Detect useless scoped functions

Open

#972 opened on 2021年7月7日

GitHub で見る
 (0 comments) (0 reactions) (1 assignee)Kotlin (40 forks)github user discovery
enhancementgood first issuehelp wantedneeded

Repository metrics

Stars
 (571 stars)
PR merge metrics
 (PR metrics pending)

説明

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()

コントリビューターガイド