Skip to content

Commit e2c50b1

Browse files
authored
chore: format check/apply for ci & build (#65)
1 parent 3c6c706 commit e2c50b1

File tree

2 files changed

+22
-16
lines changed

2 files changed

+22
-16
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,14 @@ jobs:
2323
- name: Validate Gradle wrapper
2424
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
2525

26-
- name: check Java code format
27-
uses: axel-op/googlejavaformat-action@v3
28-
with:
29-
version: "1.10.0"
30-
skipCommit: true
31-
args: "--set-exit-if-changed"
32-
33-
- name: check Kotlin code format
34-
run: ./gradlew ktlintCheck
26+
- name: check Java & Kotlin code format
27+
run: |
28+
./gradlew spotlessJavaCheck
29+
./gradlew spotlessKotlinCheck
30+
./gradlew spotlessKotlinGradleCheck
3531
3632
- name: Prepare test env
37-
run: script/prepare-test-env-latest.sh
33+
run: script/prepare-test-env-latest.sh
3834

3935
- name: Build and test with Gradle
4036
run: ./gradlew build

client/build.gradle.kts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ plugins {
1212
id("signing")
1313

1414
kotlin("jvm") version "1.6.10"
15-
id("org.jlleitschuh.gradle.ktlint") version "10.2.1"
15+
id("com.diffplug.spotless") version "6.2.0"
1616
}
1717

1818
group = "io.hstream"
@@ -30,8 +30,6 @@ java {
3030
}
3131
}
3232

33-
// val ktlint by configurations.creating
34-
3533
dependencies {
3634
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.1")
3735

@@ -85,9 +83,6 @@ protobuf {
8583
id("grpc")
8684
id("grpckt")
8785
}
88-
// it.builtins {
89-
// id("kotlin")
90-
// }
9186
}
9287
}
9388
}
@@ -173,3 +168,18 @@ tasks.withType<Javadoc> {
173168
)
174169
exclude("io/hstream/impl/**", "io/hstream/util/**")
175170
}
171+
172+
spotless {
173+
java {
174+
googleJavaFormat()
175+
}
176+
177+
kotlin {
178+
ktlint()
179+
}
180+
181+
kotlinGradle {
182+
target("*.gradle.kts")
183+
ktlint()
184+
}
185+
}

0 commit comments

Comments
 (0)