在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):detekt/detekt开源软件地址(OpenSource Url):https://github.com/detekt/detekt开源编程语言(OpenSource Language):Kotlin 99.0%开源软件介绍(OpenSource Introduction):detektMeet detekt, a static code analysis tool for the Kotlin programming language. Visit the project website for installation guides, rule descriptions, configuration options and more. Features
Quick-Links
Quick Start ...with the command-line interfacecurl -sSLO https://github.com/detekt/detekt/releases/download/v[version]/detekt-cli-[version]-all.jar
java -jar detekt-cli-[version]-all.jar --help You can find other ways to install detekt here with Gradleplugins {
id("io.gitlab.arturbosch.detekt").version("[version]")
}
repositories {
mavenCentral()
}
detekt {
buildUponDefaultConfig = true // preconfigure defaults
allRules = false // activate all available (even unstable) rules.
config = files("$projectDir/config/detekt.yml") // point to your custom config defining rules to run, overwriting default behavior
baseline = file("$projectDir/config/baseline.xml") // a way of suppressing issues before introducing detekt
}
tasks.withType<Detekt>().configureEach {
reports {
html.required.set(true) // observe findings in your browser with structure and code snippets
xml.required.set(true) // checkstyle like format mainly for integrations like Jenkins
txt.required.set(true) // similar to the console output, contains issue signature to manually edit baseline files
sarif.required.set(true) // standardized SARIF format (https://sarifweb.azurewebsites.net/) to support integrations with Github Code Scanning
md.required.set(true) // simple Markdown format
}
}
// Groovy DSL
tasks.withType(Detekt).configureEach {
jvmTarget = "1.8"
}
tasks.withType(DetektCreateBaselineTask).configureEach {
jvmTarget = "1.8"
}
// or
// Kotlin DSL
tasks.withType<Detekt>().configureEach {
jvmTarget = "1.8"
}
tasks.withType<DetektCreateBaselineTask>().configureEach {
jvmTarget = "1.8"
} See maven central for releases and sonatype for snapshots. If you want to use a SNAPSHOT version, you can find more info on this documentation page. RequirementsGradle 6.1+ is the minimum requirement. However, the recommended versions together with the other tools recommended versions are:
The list of recommended versions for previous detekt version is listed here. Adding more rule setsdetekt itself provides a wrapper over ktlint as the dependencies {
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:[version]")
} Likewise custom extensions can be added to detekt. ContributingSee CONTRIBUTING Thanks to all the people who contributed to detekt! MentionsAs mentioned in...
Integrations:
Custom rules and reports from 3rd parties:
Credits
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论