detekt compiler plugin
0.4.0
detekt-compiler-plugin ได้ถูกย้ายไปที่ detekt repo
การสนับสนุนการทดลองสำหรับการรวม Detekt เป็นปลั๊กอินคอมไพเลอร์ Kotlin

plugins {
id( " io.github.detekt.gradle.compiler-plugin " ) version " 0.4.0 "
}
detekt {
isEnabled = true // or with a property: System.getProperty("runDetekt") != null
// everything from https://detekt.github.io/detekt/kotlindsl.html#options-for-detekt-configuration-closure
// is supported to declare, only some options are used. See limitations.
} สามารถเพิ่มปลั๊กอิน Detekt ลงในโครงการของคุณโดยใช้การกำหนดค่า detektPlugins :
dependencies {
detektPlugins( " io.gitlab.arturbosch.detekt:detekt-formatting:<version> " )
} รายงานสามารถปรับแต่งได้โดยใช้ส่วนขยาย detekt ซึ่งจะถูกเพิ่มเข้าไปในงาน KotlinCompile การใช้ groovy สิ่งนี้อาจมีลักษณะ:
tasks . withType( org.jetbrains.kotlin.gradle.tasks.KotlinCompile ) . configureEach {
detekt {
reports {
xml . enabled . set( true )
txt . enabled . set( false )
create( " custom " ) {
enabled . set( false )
}
}
}
} ทุกสิ่งที่รองรับปลั๊กอิน Gradle ( DetektExtension ) ของเรารองรับได้รับการสนับสนุนในด้านประกาศด้วยปลั๊กอินนี้
อย่างไรก็ตามมีเพียงตัวเลือกต่อไปนี้เท่านั้นที่นำไปใช้/ส่งผ่านไปยัง Detekt: