Skip to content

Commit a843846

Browse files
committed
[lint] apply spring java format
1 parent 27c75dd commit a843846

File tree

8 files changed

+12
-14
lines changed

8 files changed

+12
-14
lines changed

Diff for: .githooks/pre-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22

33
GIT_DIR=$(git rev-parse --show-toplevel)
4-
$GIT_DIR/gradlew spotlessCheck
4+
$GIT_DIR/gradlew checkFormat

Diff for: .github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Lint
2424
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
2525
with:
26-
arguments: spotlessCheck
26+
arguments: checkFormat
2727
- name: Test
2828
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
2929
with:

Diff for: .springjavaformatconfig

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
indentation-style=spaces

Diff for: README.md

+4
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ This setting makes it easier to run the `test code` out of the box.
130130
Build, Execution, Deployment > Build Tools > Gradle > Run tests using > IntelliJ IDEA
131131
```
132132

133+
If you want to apply lint settings to the format of IDEA, please refer to the guide below.
134+
135+
[Spring Java Format IntelliJ IDEA](https://github.com/spring-io/spring-javaformat#intellij-idea)
136+
133137
---
134138

135139
# Supported By

Diff for: build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ plugins {
22
id 'java-library'
33
id 'org.springframework.boot' apply(false)
44
id 'io.spring.dependency-management'
5+
id 'io.spring.javaformat' apply(false)
56
id 'org.asciidoctor.jvm.convert' apply(false)
6-
id 'com.diffplug.spotless' apply(false)
77
}
88

99
apply from: 'lint.gradle'

Diff for: gradle.properties

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ javaVersion=17
77

88
### Plugin depdency versions ###
99
asciidoctorConvertVersion=3.3.2
10-
spotlessVersion=6.18.0
11-
spotlessFindbugsVersion=3.0.2
10+
springJavaFormatVersion=0.0.39
1211

1312
### Spring dependency versions ###
1413
springBootVersion=3.1.1

Diff for: lint.gradle

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
subprojects {
22
apply plugin: 'java'
3-
apply plugin: 'com.diffplug.spotless'
3+
apply plugin: 'io.spring.javaformat'
44

55
dependencies {
6-
compileOnly "com.google.code.findbugs:jsr305:${spotlessFindbugsVersion}"
7-
}
8-
9-
spotless {
10-
java {
11-
googleJavaFormat().aosp()
12-
}
6+
compileOnly "io.spring.javaformat:spring-javaformat-gradle-plugin:${springJavaFormatVersion}"
137
}
148
}

Diff for: settings.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pluginManagement {
33
id 'org.springframework.boot' version "${springBootVersion}"
44
id 'io.spring.dependency-management' version "${springDependencyManagementVersion}"
55
id 'org.asciidoctor.jvm.convert' version "${asciidoctorConvertVersion}"
6-
id 'com.diffplug.spotless' version "${spotlessVersion}"
6+
id 'io.spring.javaformat' version "${springJavaFormatVersion}"
77
}
88
}
99

0 commit comments

Comments
 (0)