test: Verify pre-commit hook formatting check
This commit is contained in:
20
build.gradle
20
build.gradle
@@ -2,6 +2,7 @@ plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '3.5.7'
|
||||
id 'io.spring.dependency-management' version '1.1.7'
|
||||
id 'com.diffplug.spotless' version '6.25.0'
|
||||
}
|
||||
|
||||
group = 'com.kamco.cd'
|
||||
@@ -58,3 +59,22 @@ tasks.named('test') {
|
||||
bootJar {
|
||||
archiveFileName = 'ROOT.jar'
|
||||
}
|
||||
|
||||
// Spotless configuration for code formatting
|
||||
spotless {
|
||||
java {
|
||||
target 'src/**/*.java'
|
||||
googleJavaFormat('1.19.2').aosp().reflowLongStrings()
|
||||
indentWithSpaces(2)
|
||||
trimTrailingWhitespace()
|
||||
endWithNewline()
|
||||
importOrder()
|
||||
removeUnusedImports()
|
||||
formatAnnotations()
|
||||
}
|
||||
}
|
||||
|
||||
// Run spotlessCheck before build
|
||||
tasks.named('build') {
|
||||
dependsOn 'spotlessCheck'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user