From a6d94919e9abe6058ff1572fcb413ca5ae2d081e Mon Sep 17 00:00:00 2001
From: Florian BEZANNIER <48728684+flobz@users.noreply.github.com>
Date: Mon, 6 Oct 2025 10:50:22 +0200
Subject: [PATCH] Add Spotless for Code Formatting (#2613)
* style: format from cli
* ci: add style check
---
.../workflows/reusable_workflow_verify.yaml | 7 +++++++
pom.xml | 20 +++++++++++++++++++
2 files changed, 27 insertions(+)
diff --git a/.github/workflows/reusable_workflow_verify.yaml b/.github/workflows/reusable_workflow_verify.yaml
index 44e01e58f..44e5fc143 100644
--- a/.github/workflows/reusable_workflow_verify.yaml
+++ b/.github/workflows/reusable_workflow_verify.yaml
@@ -61,5 +61,12 @@ jobs:
- name: Check file license headers
run: mvn license:check -PcheckLicense --batch-mode
+ - name: Check code style
+ run: |
+ # compare style to target branch
+ git remote add target ${{ github.event.pull_request.base.repo.clone_url }}
+ git fetch target
+ mvn spotless:check -DratchetFrom=${{ github.event.pull_request.base.sha }}
+
- name: Run tests & javadoc
run: mvn clean verify javadoc:javadoc -DdetectOfflineLinks=false -PgenerateTestReport ${{ inputs.maven_properties }} --batch-mode
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 252425c45..d2cd6b722 100644
--- a/pom.xml
+++ b/pom.xml
@@ -130,6 +130,7 @@
false
+ origin/master
@@ -368,6 +369,25 @@
org.jacoco
jacoco-maven-plugin
+
+
+ com.diffplug.spotless
+ spotless-maven-plugin
+
+ ${ratchetFrom}
+
+
+ ${maven.multiModuleProjectDirectory}/eclipse_codeformatter.xml
+
+
+
+