Skip to content

package-name

Kotlinstyleno fixdefault: offkotlin/ktlint

Reports a package whose name has an uppercase letter or an underscore.

Package names in Kotlin and Java are in lowercase, joined without underscores, so a name with capitals looks like a class and does not match the directory on file systems that ignore case.

To fix, write the name in lowercase.

Reported
package a.My_pkg
val x = 1
kotlin:
lint:
rules:
package-name: warn # off (default), warn, error

Enabled by the presets: kotlin/ktlint.

Suppress one line with sudsy-disable-next-line package-name in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
ktlint package-name full