Skip to content

Commit 3ab7a88

Browse files
nakamura-toclaude
andcommitted
Apply code formatting and consolidate repository configuration
- Apply Google Java Format to all Java source files for consistent code style - Move repository configuration to root build.gradle.kts to reduce duplication - Configure Spotless plugin for automatic code formatting across all projects 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent c966e44 commit 3ab7a88

File tree

10 files changed

+36
-34
lines changed

10 files changed

+36
-34
lines changed

build.gradle.kts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
plugins {
2-
base
2+
java
3+
alias(libs.plugins.spotless)
34
}
45

6+
val catalog = libs
7+
8+
allprojects {
9+
apply(plugin = catalog.plugins.spotless.get().pluginId)
10+
11+
spotless {
12+
java {
13+
googleJavaFormat(libs.versions.google.java.format.get())
14+
}
15+
}
16+
17+
repositories {
18+
mavenCentral()
19+
}
20+
}

compile-java-test/build.gradle.kts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ tasks {
1414
}
1515
}
1616

17-
repositories {
18-
mavenCentral()
19-
}
20-
2117
dependencies {
2218
annotationProcessor(libs.doma.processor)
2319
implementation(libs.doma.core)

compile-java-test/src/main/java/example/Employee.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
@Entity
77
public class Employee {
8-
@Id
9-
public Integer id;
10-
public String name;
8+
@Id public Integer id;
9+
public String name;
1110
}

compile-java-test/src/main/java/example/EmployeeDao.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
@Dao
88
public interface EmployeeDao {
9-
@Select
10-
Employee selectById(Integer id);
9+
@Select
10+
Employee selectById(Integer id);
1111

12-
@Script
13-
void create();
12+
@Script
13+
void create();
1414
}

compile-java-test/src/test/java/example/GenerationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package example;
22

3-
import org.junit.jupiter.api.Test;
4-
53
import static org.junit.jupiter.api.Assertions.assertNotNull;
64

5+
import org.junit.jupiter.api.Test;
6+
77
public class GenerationTest {
88

99
@Test

compile-kotlin-test/build.gradle.kts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ java {
1414
toolchain.languageVersion.set(JavaLanguageVersion.of(libs.versions.java.get().toInt()))
1515
}
1616

17-
repositories {
18-
mavenCentral()
19-
}
20-
2117
tasks {
2218
test {
2319
useJUnitPlatform()

compile-mix-test/build.gradle.kts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ tasks {
2020
}
2121
}
2222

23-
repositories {
24-
mavenCentral()
25-
}
26-
2723
dependencies {
2824
kapt(libs.doma.processor)
2925
implementation(libs.doma.core)

compile-mix-test/src/main/java/example/Address.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
@Entity
77
class Address {
8-
@Id
9-
public Integer id;
10-
public String name;
11-
}
8+
@Id public Integer id;
9+
public String name;
10+
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package example;
22

33
import org.seasar.doma.Dao;
4-
import org.seasar.doma.Select;
54
import org.seasar.doma.Script;
5+
import org.seasar.doma.Select;
66

77
@Dao
88
interface AddressDao {
9-
@Select
10-
Address selectById(Integer id);
9+
@Select
10+
Address selectById(Integer id);
1111

12-
@Script
13-
void create();
14-
}
12+
@Script
13+
void create();
14+
}

compile-mix-test/src/test/java/example/GenerationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package example;
22

3-
import org.junit.jupiter.api.Test;
4-
53
import static org.junit.jupiter.api.Assertions.assertNotNull;
64

5+
import org.junit.jupiter.api.Test;
6+
77
public class GenerationTest {
88

99
@Test

0 commit comments

Comments
 (0)