5

When I run gradlew ktlintCheck it fails with a lot of

Wildcard import (cannot be auto-corrected)

errors.

Ralf Wickum
  • 2,850
  • 9
  • 55
  • 103

2 Answers2

10

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

disabled_rules=no-wildcard-imports
Ralf Wickum
  • 2,850
  • 9
  • 55
  • 103
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.

Mithun
  • 2,075
  • 3
  • 19
  • 26