From 6c5f93179b051880df8e77ca653b417db0d86d44 Mon Sep 17 00:00:00 2001 From: Ulli Hafner Date: Wed, 13 Mar 2024 15:36:54 +0100 Subject: [PATCH 1/7] Use multiple CheckStyle executions. --- .github/workflows/quality-monitor.yml | 78 ++++++++ ....xml => checkstyle-java-configuration.xml} | 0 etc/checkstyle-tests-configuration.xml | 182 ++++++++++++++++++ pom.xml | 29 ++- 4 files changed, 284 insertions(+), 5 deletions(-) rename etc/{checkstyle-configuration.xml => checkstyle-java-configuration.xml} (100%) create mode 100644 etc/checkstyle-tests-configuration.xml diff --git a/.github/workflows/quality-monitor.yml b/.github/workflows/quality-monitor.yml index 15a03dd6..ea959f55 100644 --- a/.github/workflows/quality-monitor.yml +++ b/.github/workflows/quality-monitor.yml @@ -34,3 +34,81 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} pr-number: ${{ steps.pr.outputs.number }} + config: | + { + "tests": { + "tools": [ + { + "id": "test", + "name": "Tests", + "pattern": "**/target/*-reports/TEST*.xml" + } + ], + "name": "Tests" + }, + "analysis": [ + { + "name": "Style", + "id": "style", + "tools": [ + { + "id": "checkstyle", + "name": "CheckStyle", + "pattern": "**/target/**/checkstyle-result.xml" + }, + { + "id": "pmd", + "name": "PMD", + "pattern": "**/target/**/pmd.xml" + } + ] + }, + { + "name": "Bugs", + "id": "bugs", + "icon": "bug", + "tools": [ + { + "id": "spotbugs", + "name": "SpotBugs", + "sourcePath": "src/main/java", + "pattern": "**/target/spotbugsXml.xml" + } + ] + } + ], + "coverage": [ + { + "name": "Code Coverage", + "tools": [ + { + "id": "jacoco", + "name": "Line Coverage", + "metric": "line", + "sourcePath": "src/main/java", + "pattern": "**/target/site/jacoco/jacoco.xml" + }, + { + "id": "jacoco", + "name": "Branch Coverage", + "metric": "branch", + "sourcePath": "src/main/java", + "pattern": "**/target/site/jacoco/jacoco.xml" + } + ] + }, + { + "name": "Mutation Coverage", + "tools": [ + { + "id": "pit", + "name": "Mutation Coverage", + "metric": "mutation", + "sourcePath": "src/main/java", + "pattern": "**/target/pit-reports/mutations.xml" + } + ] + } + ] + } + diff --git a/etc/checkstyle-configuration.xml b/etc/checkstyle-java-configuration.xml similarity index 100% rename from etc/checkstyle-configuration.xml rename to etc/checkstyle-java-configuration.xml diff --git a/etc/checkstyle-tests-configuration.xml b/etc/checkstyle-tests-configuration.xml new file mode 100644 index 00000000..c7ab6cd8 --- /dev/null +++ b/etc/checkstyle-tests-configuration.xml @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pom.xml b/pom.xml index f80ff47f..b0fe368a 100644 --- a/pom.xml +++ b/pom.xml @@ -587,10 +587,9 @@ ${maven-checkstyle-plugin.version} false - **/*Assert*.java,**/*_jmh*,**/module-info.java - false - etc/checkstyle-configuration.xml - true + true + **/module-info.java + false @@ -601,11 +600,31 @@ - run-checkstyle + run-checkstyle-java checkstyle verify + + false + **/*Assert*.java,**/*_jmh*,**/module-info.java + etc/checkstyle-java-configuration.xml + false + ${project.build.directory}/checkstyle-java/checkstyle-result.xml + + + + run-checkstyle-tests + + checkstyle + + verify + + **/*Assert*.java,**/*_jmh*,**/module-info.java + etc/checkstyle-tests-configuration.xml + true + ${project.build.directory}/checkstyle-tests/checkstyle-result.xml + From ec4de1416f4fb10fcabb789bcc38e095303e8549 Mon Sep 17 00:00:00 2001 From: Ulli Hafner Date: Wed, 13 Mar 2024 15:43:21 +0100 Subject: [PATCH 2/7] Improve glob to mach no directory. --- .github/workflows/quality-monitor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/quality-monitor.yml b/.github/workflows/quality-monitor.yml index ea959f55..c6fad912 100644 --- a/.github/workflows/quality-monitor.yml +++ b/.github/workflows/quality-monitor.yml @@ -54,12 +54,12 @@ jobs: { "id": "checkstyle", "name": "CheckStyle", - "pattern": "**/target/**/checkstyle-result.xml" + "pattern": "**/target/**checkstyle-result.xml" }, { "id": "pmd", "name": "PMD", - "pattern": "**/target/**/pmd.xml" + "pattern": "**/target/**pmd.xml" } ] }, From 6b92b6fc4d49c21034bec5e3c58795df2e952924 Mon Sep 17 00:00:00 2001 From: Ulli Hafner Date: Wed, 13 Mar 2024 15:52:00 +0100 Subject: [PATCH 3/7] Fix link to new checkstyle config. --- doc/Continuous-Integration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/Continuous-Integration.md b/doc/Continuous-Integration.md index 15bbd877..13b617c7 100644 --- a/doc/Continuous-Integration.md +++ b/doc/Continuous-Integration.md @@ -11,12 +11,12 @@ definiert, d.h. eine Aktualisierung lässt sich im entsprechenden Abschnitt leic über den [Dependabot](https://dependabot.com) Roboter von GitHub automatisch über einen Pull Request aktualisiert. U.a. sind die folgenden Plugins vorkonfiguriert: - maven-compiler-plugin: konfiguriert die Java Version auf Java 8 und legt alle Error Prone Regeln fest. Die Java - Version kann beliebig aktualisert werden. + Version kann beliebig aktualisiert werden. - maven-javadoc-plugin: aktiviert die strikte Prüfung von JavaDoc Kommentaren - maven-jar-plugin: legt einen Modulnamen fest, falls das Projekt in Java 9 oder höher verwendet wird. Außerdem wird ein test-jar konfiguriert, sodass alle Tests (und abstrakte Testklassen) auch als Dependencies genutzt werden können. - maven-pmd-plugin: prüft das Projekt mit PMD, die Regeln liegen in der Datei [pmd-configuration.xml](../etc/pmd-configuration.xml). -- maven-checkstyle-plugin: prüft das Projekt mit CheckStyle, die Regeln liegen in der Datei [checkstyle-configuration.xml](../etc/checkstyle-configuration.xml). +- maven-checkstyle-plugin: prüft das Projekt mit CheckStyle, die Regeln liegen in den Dateien [checkstyle-java-configuration.xml](../etc/checkstyle-java-configuration.xml) und [checkstyle-tests-configuration.xml](../etc/checkstyle-tests-configuration.xml). - spotbugs-maven-plugin: prüft das Projekt mit SpotBugs, alle Regeln werden verwendet mit den Ausnahmen definiert in der Datei [spotbugs-exclusion-filter.xml](../etc/spotbugs-exclusion-filter.xml). - org.revapi: prüft, ob die aktuelle Versionsnummer die [semantische Versionierung](https://semver.org) berücksichtigt (source and binary). D.h. es gilt: 1. Eine neue **Major** Version wurde definiert, wenn das API nicht mehr abwärtskompatibel ist. From 327c146797ddf8edfd6364856b308c01dc70e618 Mon Sep 17 00:00:00 2001 From: Ulli Hafner Date: Wed, 13 Mar 2024 16:45:21 +0100 Subject: [PATCH 4/7] Simplify CheckStyle configuration. --- pom.xml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index b0fe368a..e21df1e5 100644 --- a/pom.xml +++ b/pom.xml @@ -588,7 +588,6 @@ false true - **/module-info.java false @@ -606,10 +605,9 @@ verify - false - **/*Assert*.java,**/*_jmh*,**/module-info.java - etc/checkstyle-java-configuration.xml + **/module-info.java false + etc/checkstyle-java-configuration.xml ${project.build.directory}/checkstyle-java/checkstyle-result.xml @@ -621,8 +619,8 @@ verify **/*Assert*.java,**/*_jmh*,**/module-info.java - etc/checkstyle-tests-configuration.xml true + etc/checkstyle-tests-configuration.xml ${project.build.directory}/checkstyle-tests/checkstyle-result.xml From aa8a40602e7db2e148d38059eb978802240641b6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 15:46:13 +0000 Subject: [PATCH 5/7] Bump error-prone.version from 2.25.0 to 2.26.1 Bumps `error-prone.version` from 2.25.0 to 2.26.1. Updates `com.google.errorprone:error_prone_annotations` from 2.25.0 to 2.26.1 - [Release notes](https://github.com/google/error-prone/releases) - [Commits](https://github.com/google/error-prone/compare/v2.25.0...v2.26.1) Updates `com.google.errorprone:error_prone_core` from 2.25.0 to 2.26.1 - [Release notes](https://github.com/google/error-prone/releases) - [Commits](https://github.com/google/error-prone/compare/v2.25.0...v2.26.1) --- updated-dependencies: - dependency-name: com.google.errorprone:error_prone_annotations dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: com.google.errorprone:error_prone_core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ff22ff32..8d0c4bef 100644 --- a/pom.xml +++ b/pom.xml @@ -94,7 +94,7 @@ 0.8.11 1.15.8 1.2.1 - 2.25.0 + 2.26.1 0.10.24 0.15.0 0.28.1 From 3e1bb942159e3d3e5be0dc1a2722d6563e228c97 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 16:39:06 +0000 Subject: [PATCH 6/7] Bump org.openrewrite.recipe:rewrite-testing-frameworks Bumps [org.openrewrite.recipe:rewrite-testing-frameworks](https://github.com/openrewrite/rewrite-testing-frameworks) from 2.4.1 to 2.5.0. - [Release notes](https://github.com/openrewrite/rewrite-testing-frameworks/releases) - [Commits](https://github.com/openrewrite/rewrite-testing-frameworks/compare/v2.4.1...v2.5.0) --- updated-dependencies: - dependency-name: org.openrewrite.recipe:rewrite-testing-frameworks dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ff22ff32..26512953 100644 --- a/pom.xml +++ b/pom.xml @@ -110,7 +110,7 @@ 5.24.0 - 2.4.1 + 2.5.0 1.3.1 2.9.1 1.2.3 From 9eb85739188a30d7dd9bd36f39fffd3a171d2e65 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 16:39:10 +0000 Subject: [PATCH 7/7] Bump org.openrewrite.recipe:rewrite-migrate-java from 2.9.1 to 2.10.0 Bumps [org.openrewrite.recipe:rewrite-migrate-java](https://github.com/openrewrite/rewrite-migrate-java) from 2.9.1 to 2.10.0. - [Release notes](https://github.com/openrewrite/rewrite-migrate-java/releases) - [Commits](https://github.com/openrewrite/rewrite-migrate-java/compare/v2.9.1...v2.10.0) --- updated-dependencies: - dependency-name: org.openrewrite.recipe:rewrite-migrate-java dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ff22ff32..4e08d154 100644 --- a/pom.xml +++ b/pom.xml @@ -112,7 +112,7 @@ 5.24.0 2.4.1 1.3.1 - 2.9.1 + 2.10.0 1.2.3