test: Verify pre-commit hook formatting check

This commit is contained in:
2025-11-14 18:13:41 +09:00
parent ce56da70d7
commit 74e1c6bb9c
7 changed files with 363 additions and 0 deletions

View File

@@ -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'
}