spotless formatter

This commit is contained in:
lieght
2025-09-20 15:00:34 +02:00
parent f620ccc489
commit 323f401aad
4 changed files with 67 additions and 1 deletions

7
.idea/dictionaries/project.xml generated Normal file
View File

@@ -0,0 +1,7 @@
<component name="ProjectDictionaryState">
<dictionary name="project">
<words>
<w>aosp</w>
</words>
</dictionary>
</component>

52
pom.xml
View File

@@ -62,6 +62,13 @@
<version>2.25.1</version> <version>2.25.1</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/com.diffplug.spotless/spotless-maven-plugin -->
<dependency>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.46.1</version>
</dependency>
<dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl</artifactId></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl</artifactId></dependency>
<dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-glfw</artifactId></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-glfw</artifactId></dependency>
<dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-opengl</artifactId></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-opengl</artifactId></dependency>
@@ -97,6 +104,51 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.46.1</version>
<configuration>
<!-- optional: limit format enforcement to just the files changed by this feature branch -->
<ratchetFrom>origin/main</ratchetFrom>
<formats>
<!-- you can define as many formats as you want, each is independent -->
<format>
<!-- define the files to apply to -->
<includes>
<include>.gitattributes</include>
<include>.gitignore</include>
</includes>
<!-- define the steps to apply to those files -->
<trimTrailingWhitespace/>
<endWithNewline/>
<indent>
<tabs>true</tabs>
<spacesPerTab>4</spacesPerTab>
</indent>
</format>
</formats>
<!-- define a language-specific format -->
<java>
<!-- no need to specify files, inferred automatically, but you can if you want -->
<!-- apply a specific flavor of google-java-format and reflow long strings -->
<googleJavaFormat>
<version>1.28.0</version>
<style>AOSP</style>
<reflowLongStrings>true</reflowLongStrings>
<formatJavadoc>false</formatJavadoc>
</googleJavaFormat>
<!-- make sure every file has the following copyright header.
optionally, Spotless can set copyright years by digging
through git history (see "license" section below) -->
<!-- <licenseHeader>-->
<!-- <content>/* (C)$YEAR */</content> &lt;!&ndash; or <file>${project.basedir}/license-header</file> &ndash;&gt;-->
<!-- </licenseHeader>-->
</java>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
</project> </project>

View File

@@ -40,6 +40,13 @@ public class UIGameBoard {
// Game grid // Game grid
JPanel gameGrid = createGridPanel(TICTACTOE_SIZE, TICTACTOE_SIZE); JPanel gameGrid = createGridPanel(TICTACTOE_SIZE, TICTACTOE_SIZE);
tttPanel.add(gameGrid, BorderLayout.CENTER); tttPanel.add(gameGrid, BorderLayout.CENTER);
// localTicTacToe.setMoveListener((playerIndex, moveIndex, symbol) -> {
// SwingUtilities.invokeLater(() -> {
// cells[moveIndex].setText(String.valueOf(symbol));
// });
// });
} }
private JPanel createGridPanel(int sizeX, int sizeY) { private JPanel createGridPanel(int sizeX, int sizeY) {