From 698ebeb942d2624c7685f8cc9ab1f2c9779bc2a7 Mon Sep 17 00:00:00 2001 From: Ulli Hafner Date: Thu, 29 Feb 2024 12:15:34 +0100 Subject: [PATCH 1/3] Add configuration of OpenRewrite and POM sorting. --- pom.xml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 1263cbff..5855f4ac 100644 --- a/pom.xml +++ b/pom.xml @@ -106,6 +106,9 @@ 3.4.1 3.1.2 4.0.3 + 5.23.3 + 2.4.1 + 3.4.0 -Djava.util.logging.config.file=logging.properties @@ -753,7 +756,7 @@ org.openrewrite.maven rewrite-maven-plugin - 5.23.3 + ${rewrite-maven-plugin.version} org.openrewrite.java.testing.assertj.SimplifyChainedAssertJAssertions @@ -763,14 +766,14 @@ org.openrewrite.recipe rewrite-testing-frameworks - 2.4.1 + ${rewrite-testing-frameworks.version} com.github.ekryd.sortpom sortpom-maven-plugin - 3.4.0 + ${sortpom-maven-plugin.version} From 9456adfd1b4546c1494fa859a594f337eb631b5f Mon Sep 17 00:00:00 2001 From: Ulli Hafner Date: Tue, 5 Mar 2024 11:47:06 +0100 Subject: [PATCH 2/3] Fix styling with OpenRewrite. --- .gitignore | 2 ++ doc/Continuous-Integration.md | 2 +- pom.xml | 32 +++++++++++++++++++ .../java/edu/hm/hafner/util/LineRange.java | 1 - .../java/edu/hm/hafner/util/package-info.java | 2 +- .../edu/hm/hafner/util/ArchitectureRules.java | 2 +- 6 files changed, 37 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 9f04e894..e651159e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ node node_modules target *.iml +*.bak .classpath .project .settings @@ -11,4 +12,5 @@ release.properties metrics.env maven.log .DS_Store +.idea /package-lock.json diff --git a/doc/Continuous-Integration.md b/doc/Continuous-Integration.md index 01de3162..15bbd877 100644 --- a/doc/Continuous-Integration.md +++ b/doc/Continuous-Integration.md @@ -52,7 +52,7 @@ Eine solche Visualisierung ist unter GitHub Actions nicht verfügbar. Da es für Jenkins keinen öffentlichen Service wie bei GitHub Actions gibt, um eigene Projekte zu bauen, muss die Jenkins Integration lokal durchgeführt werden. Zur Vereinfachung des Jenkins Setup ist in diesem Coding Style eine lauffähige Jenkins Installation enthalten (im Sinne von *Infrastructure as Code*). -Diese kann über `jenkins.sh` im Hauptverzeichnis gestartet werden. Anschließend wird die +Diese kann über `bin/jenkins.sh` gestartet werden. Anschließend wird die aktuelle Jenkins LTS Version mit allen benötigten Plugins in einem Docker Container gebaut und gestartet (das dauert beim ersten Aufruf etwas). Dazu wird ebenso ein als Docker Container initialisierter Java Agent (**Achtung**: Java 8) verbunden, der die Builds ausführt. diff --git a/pom.xml b/pom.xml index 5855f4ac..6361ade5 100644 --- a/pom.xml +++ b/pom.xml @@ -106,9 +106,15 @@ 3.4.1 3.1.2 4.0.3 + 3.4.0 + + 5.23.3 2.4.1 3.4.0 + 1.3.1 + 2.9.0 + 1.2.2 -Djava.util.logging.config.file=logging.properties @@ -297,6 +303,7 @@ + org.apache.maven.plugins maven-compiler-plugin ${maven-compiler-plugin.version} @@ -396,6 +403,7 @@ + org.apache.maven.plugins maven-javadoc-plugin ${maven-javadoc-plugin.version} @@ -760,6 +768,15 @@ org.openrewrite.java.testing.assertj.SimplifyChainedAssertJAssertions + org.openrewrite.maven.BestPractices + org.openrewrite.staticanalysis.MissingOverrideAnnotation + org.openrewrite.staticanalysis.CommonStaticAnalysis + org.openrewrite.staticanalysis.RemoveExtraSemicolons + org.openrewrite.java.migrate.Java8toJava11 + org.openrewrite.java.migrate.util.SequencedCollection + org.openrewrite.java.format.RemoveTrailingWhitespace + org.openrewrite.java.format.BlankLines + org.openrewrite.java.format.EmptyNewlineAtEndOfFile @@ -768,6 +785,21 @@ rewrite-testing-frameworks ${rewrite-testing-frameworks.version} + + org.openrewrite.recipe + rewrite-static-analysis + ${rewrite-static-analysis.version} + + + org.openrewrite.recipe + rewrite-migrate-java + ${rewrite-migrate-java.version} + + + org.openrewrite.recipe + rewrite-recommendations + ${rewrite-recommendations.version} + diff --git a/src/main/java/edu/hm/hafner/util/LineRange.java b/src/main/java/edu/hm/hafner/util/LineRange.java index de5d72c0..16fea08b 100644 --- a/src/main/java/edu/hm/hafner/util/LineRange.java +++ b/src/main/java/edu/hm/hafner/util/LineRange.java @@ -129,4 +129,3 @@ public String toString() { return String.format("[%d-%d]", start, end); } } - diff --git a/src/main/java/edu/hm/hafner/util/package-info.java b/src/main/java/edu/hm/hafner/util/package-info.java index bfdc9ab5..f609b325 100644 --- a/src/main/java/edu/hm/hafner/util/package-info.java +++ b/src/main/java/edu/hm/hafner/util/package-info.java @@ -8,4 +8,4 @@ package edu.hm.hafner.util; import edu.umd.cs.findbugs.annotations.DefaultAnnotation; -import edu.umd.cs.findbugs.annotations.NonNull; \ No newline at end of file +import edu.umd.cs.findbugs.annotations.NonNull; diff --git a/src/test/java/edu/hm/hafner/util/ArchitectureRules.java b/src/test/java/edu/hm/hafner/util/ArchitectureRules.java index 3ea127df..6791e901 100644 --- a/src/test/java/edu/hm/hafner/util/ArchitectureRules.java +++ b/src/test/java/edu/hm/hafner/util/ArchitectureRules.java @@ -189,7 +189,7 @@ private static class ExceptionHasNoContext extends DescribedPredicate 0) { + if (!target.getRawParameterTypes().isEmpty()) { return false; } return target.getOwner().isAssignableTo(Throwable.class) From 0208f3ed7554879e522d4b6eade69afc67a46848 Mon Sep 17 00:00:00 2001 From: Ulli Hafner Date: Thu, 7 Mar 2024 10:53:41 +0100 Subject: [PATCH 3/3] Fix OpenRewrite configuration. --- pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6361ade5..fc1230b7 100644 --- a/pom.xml +++ b/pom.xml @@ -111,7 +111,6 @@ 5.23.3 2.4.1 - 3.4.0 1.3.1 2.9.0 1.2.2