【发布时间】:2021-05-30 13:38:02
【问题描述】:
我想试用 Kotlin 和 ktlint,我很高兴看到它通过 editorconfig 文件支持制表符缩进(自 this PR 起)。可悲的是,它似乎对我不起作用。我之前没用过editorconfig,可能是我犯了一些简单的错误。
我在根文件夹中的.editorconfig:
indent_style = tab
我的 gradle 文件:
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val koinVersion: String by project
val junitVersion: String by project
plugins {
application
kotlin("jvm") version "1.4.30"
id("org.jlleitschuh.gradle.ktlint") version "10.0.0"
}
group = "me.me"
version = "1.0-SNAPSHOT"
application {
mainClassName = "de.me.bot.translate.MainKt"
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
implementation("com.sksamuel.hoplite:hoplite-core:+")
implementation("org.koin:koin-core:$koinVersion")
testImplementation("org.koin:koin-test:$koinVersion")
testImplementation(kotlin("test-junit5"))
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
}
tasks.test {
useJUnitPlatform()
}
tasks.withType<KotlinCompile>() {
kotlinOptions.jvmTarget = "13"
}
但是,由于意外的制表符,运行 gradle ktlintCheck 仍然会引发异常。我不明白为什么。我用 --debug 运行它,但它没有给我任何有用的信息。
【问题讨论】:
-
我认为你的项目被隐藏了
-
@YuriSchimke 我真笨,谢谢。现在可见
标签: kotlin editorconfig ktlint