mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
This saves time in CI spent performing the same source-level checks in every build job. Checkstyle, PMD, and Spotless are now run once in the "Lint and Format" job. The -PskipPMD flag was replaced with a -PskipJavaFormat flag that disables Checkstyle, PMD, and Spotless.
25 lines
658 B
Groovy
25 lines
658 B
Groovy
if (!project.hasProperty('skipJavaFormat')) {
|
|
apply plugin: 'checkstyle'
|
|
|
|
checkstyle {
|
|
toolVersion = "8.38"
|
|
configDirectory = file("${project.rootDir}/styleguide")
|
|
config = resources.text.fromFile(new File(configDirectory.get().getAsFile(), "checkstyle.xml"))
|
|
}
|
|
|
|
apply plugin: 'pmd'
|
|
|
|
pmd {
|
|
toolVersion = '6.7.0'
|
|
consoleOutput = true
|
|
reportsDir = file("$project.buildDir/reports/pmd")
|
|
ruleSetFiles = files(new File(rootDir, "styleguide/pmd-ruleset.xml"))
|
|
ruleSets = []
|
|
}
|
|
}
|
|
|
|
task javaFormat {
|
|
dependsOn(tasks.withType(Checkstyle))
|
|
dependsOn(tasks.withType(Pmd))
|
|
}
|