Ktlint fails with Wildcard import (cannot be auto-corrected)
Asked Answered
A

2

6

When I run gradlew ktlintCheck it fails with a lot of

Wildcard import (cannot be auto-corrected)

errors.

Abode answered 11/8, 2020 at 8:47 Comment(0)
A
11

Create a .editorconfig file on root level and add amongst others:

disabled_rules=no-wildcard-imports
Abode answered 11/8, 2020 at 9:4 Comment(0)
J
1

Came across this ktlint-gradle issue where it discussed about support to be added to ktlint-gradle for --disabled_rules. It eventually got included and a new cleaner way of disabling no-wildcard import check is as following.

ktlint {
    enableExperimentalRules.set(true)
    disabledRules.set(setOf("experimental:package-name", "no-wildcard-imports"))
}

FYI: Following rationale made --disabled_rules support possible.

Jordan answered 1/8, 2022 at 20:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.