From 388877730b125d2155c3e9bc25595c36e43437a0 Mon Sep 17 00:00:00 2001 From: Oliver Becker Date: Thu, 9 Sep 2021 09:39:58 +0200 Subject: [PATCH] Enforce code formatting of changed files This commit introduces the maven spotless plugin to the project that can format the source code using "mvn spotless:apply" based on the configuration in the parent pom.xml. Also it will perform a spotless:check during the verify phase to ensure that all files are properly formatted. --- config/license-header.txt | 15 + config/ocpsoft-eclipse-code-format.xml | 795 +++++++++++++++++++++++++ pom.xml | 33 + 3 files changed, 843 insertions(+) create mode 100644 config/license-header.txt create mode 100644 config/ocpsoft-eclipse-code-format.xml diff --git a/config/license-header.txt b/config/license-header.txt new file mode 100644 index 0000000..7b7dbac --- /dev/null +++ b/config/license-header.txt @@ -0,0 +1,15 @@ +/* + * Copyright $YEAR Lincoln Baxter, III + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ diff --git a/config/ocpsoft-eclipse-code-format.xml b/config/ocpsoft-eclipse-code-format.xml new file mode 100644 index 0000000..2f6e8da --- /dev/null +++ b/config/ocpsoft-eclipse-code-format.xml @@ -0,0 +1,795 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pom.xml b/pom.xml index 81ac6de..119b5db 100644 --- a/pom.xml +++ b/pom.xml @@ -139,6 +139,39 @@ + + com.diffplug.spotless + spotless-maven-plugin + 2.13.0 + + + + origin/master + + + + *.xml + *.md + .gitignore + + + + + true + 4 + + + + + + ${session.executionRootDirectory}/config/ocpsoft-eclipse-code-format.xml + + + ${session.executionRootDirectory}/config/license-header.txt + + + +