🎨 Add spotless formatting

This commit is contained in:
CybAtax 2024-11-17 18:20:09 +01:00
parent e75ac48743
commit de7b7c3b02
3 changed files with 26 additions and 0 deletions

7
.prettierrc.yml Normal file
View file

@ -0,0 +1,7 @@
plugins:
- prettier-plugin-java
parser: java
printWidth: 120
tabWidth: 4
singleQuote: false
useTabs: false

View file

@ -2,11 +2,16 @@ plugins {
java
id("org.springframework.boot") version "3.3.5"
id("io.spring.dependency-management") version "1.1.6"
id("com.diffplug.spotless") version "6.25.0"
}
group = "io.github.markl4yg.hca"
version = "0.0.1-SNAPSHOT"
apply(
from = file("./gradle/spotless.gradle")
)
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)

14
gradle/spotless.gradle Normal file
View file

@ -0,0 +1,14 @@
import java.nio.charset.StandardCharsets
spotless {
enforceCheck(false)
ratchetFrom "origin/main"
java {
target "src/**/java/**/*.java"
encoding(StandardCharsets.UTF_8)
removeUnusedImports()
prettier(['prettier': '3.0.3', 'prettier-plugin-java': '2.3.0'])
.configFile('.prettierrc.yml')
}
}