Jakub Gwóźdź
08/08/2019, 9:07 AMval x = listOf(1, 2, 3)
.map { it + 1 }
.sum()
(on this example, the .map...
can be set to 16 spaces, but when I add one more space, suddenly it's Unexpected indentation (17) (it should be 12) (cannot be auto-corrected)
I'm running default config id("org.jlleitschuh.gradle.ktlint") version "8.2.0"
plugin during ./gradlew buildigor.wojda
08/13/2019, 10:06 AM* import
is called wildcard import
and yes ktlint has No wildcard imports
rule
2, Yes it does also checks for indents (your error message actually suggests that). Check Indentation formatting
/ indent size
You can read more on official ktlint page (ktlint tool page, not gradle ktlint plugin page) https://github.com/pinterest/ktlint
You can read more on official ktlint page https://github.com/pinterest/ktlintigor.wojda
08/13/2019, 11:14 AMindent_size = 4
in .editorconfig
. Here is my smaple project:
https://github.com/igorwojda/android-showcase/blob/master/.editorconfig
2. If I remember correctly wildcard import conflicts with Kotlin Android Extensions
(https://kotlinlang.org/docs/tutorials/android-plugin.html) that generates imports like this import kotlinx.android.synthetic.main.activity_main.*
. To validate imports I am suing detekt
which gives more controll and allows to exclude some of the wildcard imports. Check this custom detekt
config file (my project again):
https://github.com/igorwojda/android-showcase/blob/74d425ed7ac9d1f5b247c980db2b6f579b2d125f/config/detekt.yml#L541