A Kotlin (script) file should not be empty.

このページは日本語には対応しておりません。随時翻訳に取り組んでいます。
翻訳に関してご質問やご意見ございましたら、お気軽にご連絡ください

Metadata

ID: kotlin-best-practices/no-empty-file

Language: Kotlin

Severity: Notice

Category: Best Practices

Description

A Kotlin (script) file should not be empty. It needs to contain at least one declaration. Files only containing a package and/or import statements are disallowed.

Non-Compliant Code Examples

package foo

import foo

Compliant Code Examples

package test.foo.bar

import foo

fun foo() {
    println("File has declaration")
}
https://static.datadoghq.com/static/images/logos/github_avatar.svg https://static.datadoghq.com/static/images/logos/vscode_avatar.svg jetbrains

Seamless integrations. Try Datadog Code Analysis