From 0cb221a37fb2c0fc5ea8e4636b9e83ffc68f9f26 Mon Sep 17 00:00:00 2001 From: Andrew Rouse Date: Wed, 24 Jan 2024 13:36:25 +0000 Subject: [PATCH] Validate formatting in CI build Add a profile to validate code formatting Use this profile in the github build action Currently, the build will autoformat the code. This change will ensure that code can't be merged if it wasn't formatted before it was committed. --- .github/workflows/build.yml | 2 +- pom.xml | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f4059d83..e547c8d4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,4 +23,4 @@ jobs: cache: 'maven' - name: build with maven - run: mvn -B --no-transfer-progress verify javadoc:javadoc --file pom.xml + run: mvn -B --no-transfer-progress verify javadoc:javadoc --file pom.xml -Pvalidate-formatting diff --git a/pom.xml b/pom.xml index e20c5df0..7ddde83b 100644 --- a/pom.xml +++ b/pom.xml @@ -93,4 +93,25 @@ spi + + + validate-formatting + + + + net.revelc.code.formatter + formatter-maven-plugin + + + + validate + + + + + + + + +