在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):vanniktech/gradle-code-quality-tools-plugin开源软件地址(OpenSource Url):https://github.com/vanniktech/gradle-code-quality-tools-plugin开源编程语言(OpenSource Language):Kotlin 98.7%开源软件介绍(OpenSource Introduction):gradle-code-quality-tools-pluginGradle plugin that configures Checkstyle, PMD, CPD, Lint, Detekt & Ktlint. All of these tools are also automatically hooked into the This plugin requires Gradle 5.0 or later. Set uproot/build.gradle buildscript {
repositories {
mavenCentral()
google()
}
dependencies {
classpath "com.vanniktech:gradle-code-quality-tools-plugin:0.21.0"
}
}
apply plugin: "com.vanniktech.code.quality.tools" Snapshotbuildscript {
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
dependencies {
classpath "com.vanniktech:gradle-code-quality-tools-plugin:0.22.0-SNAPSHOT"
}
}
apply plugin: "com.vanniktech.code.quality.tools" ConfigurationThe philosophy of this plugin is to fail early. This means having zero warnings / errors reported from any tools. If you're just getting started with this in a large code base you might not be able to achieve this right away in which case you might want to set Those are all the available configurations - shown with default values and their types. More information can be found in the Kotlin Documentation of the Extension and the respective extensions for designated integrations. codeQualityTools {
boolean failEarly = true
boolean xmlReports = true
boolean htmlReports = false
boolean textReports = false
String[] ignoreProjects = []
checkstyle {
boolean enabled = true
String toolVersion = '8.6'
String configFile = 'code_quality_tools/checkstyle.xml'
Boolean ignoreFailures = null
Boolean showViolations = null
String source = 'src'
List<String> include = ['**/*.java']
List<String> exclude = ['**/gen/**']
}
pmd {
boolean enabled = true
String toolVersion = '6.0.0'
String ruleSetFile = 'code_quality_tools/pmd.xml'
Boolean ignoreFailures = null
String source = 'src'
List<String> include = ['**/*.java']
List<String> exclude = ['**/gen/**']
}
lint {
boolean enabled = true
Boolean textReport = true
String textOutput = 'stdout'
Boolean abortOnError = null
Boolean warningsAsErrors = null
Boolean checkAllWarnings = null
String baselineFileName = null
Boolean absolutePaths = null
File lintConfig = null
Boolean checkReleaseBuilds = false
Boolean checkTestSources = null
Boolean checkDependencies = null
}
ktlint {
boolean enabled = true
String toolVersion = '0.32.0'
boolean experimental = false
}
detekt {
boolean enabled = true
String toolVersion = '1.0.0'
String config = 'code_quality_tools/detekt.yml'
String baselineFileName = null
boolean failFast = true
}
cpd {
boolean enabled = true
String source = 'src'
String language = 'java'
Boolean ignoreFailures = null
int minimumTokenCount = 50
}
kotlin {
boolean allWarningsAsErrors = true
}
} ToolsHere I'll give a bit more information about how each of the tools will be applied. If there's a Gradle task that this plugin will generate it will also be hooked up into the CheckstyleIt'll apply the Checkstyle Plugin and generate the PMDIt'll apply the PMD Plugin and generate the CPDIt'll apply the CPD Plugin and generate the LintThis will only work when one of the Android Plugins ( DetektIt'll use the specified detekt version and generate the KtlintIt'll use the specified ktlint version and then generate two tasks. Note: There might be some configuration properties that are not mirrored in which case feel free to open a PR. Personally, I don't have the need for all of them. LicenseCopyright (C) 2016 Vanniktech - Niklas Baudy Licensed under the Apache License, Version 2.0 |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论