saveourtool/diktat

New rule: Empty functions should be one-liner and return `Unit`

Open

#1,701 opened on 2023年6月29日

GitHub で見る
 (2 comments) (1 reaction) (1 assignee)Kotlin (40 forks)github user discovery
enhancementgood first issue

Repository metrics

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

説明

If for some reasons, function have no any logic, but exists only for some kind of execution: in cases of testing via JUnit Runners or JUnit Rules or some other purposes, it shouldn't have any body and should be fixed in the following way

@Test
@SomeAnnotation
fun foo() {
// no-op here
}
// no-op here
@Test
@SomeAnnotation
fun foo() = Unit

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