From 6a309f04dc93f079afc85e5cb7ccfd73c3430fef Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Tue, 5 Sep 2023 23:33:56 -0400 Subject: [PATCH 01/23] Update dtd reference in mv_checks.xml. --- config/mv_checks.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/mv_checks.xml b/config/mv_checks.xml index 0c660d8d..ec984d74 100644 --- a/config/mv_checks.xml +++ b/config/mv_checks.xml @@ -6,8 +6,8 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> + "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" + "https://checkstyle.org/dtds/configuration_1_3.dtd"> From e04b0faa85835d2e94d18a0474319a16587a966c Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Tue, 5 Sep 2023 23:52:20 -0400 Subject: [PATCH 02/23] Upgrade checkstyle to version 10.12.2. --- build.gradle | 2 +- config/mv_checks.xml | 38 +++++++++++++++++++------------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/build.gradle b/build.gradle index 1f1b84fa..08f4e6b0 100644 --- a/build.gradle +++ b/build.gradle @@ -161,7 +161,7 @@ processResources { checkstyle { - toolVersion = '6.1.1' + toolVersion = '10.12.2' configFile file('config/mv_checks.xml') ignoreFailures = true } diff --git a/config/mv_checks.xml b/config/mv_checks.xml index ec984d74..8b12b256 100644 --- a/config/mv_checks.xml +++ b/config/mv_checks.xml @@ -10,6 +10,11 @@ "https://checkstyle.org/dtds/configuration_1_3.dtd"> + + + + + @@ -23,29 +28,24 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - + From ab2dd9d3162074fd7ec57c553f1808a1603aa358 Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Wed, 6 Sep 2023 01:05:13 -0400 Subject: [PATCH 03/23] Configure Javadoc checkstyle. --- config/mv_checks.xml | 43 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/config/mv_checks.xml b/config/mv_checks.xml index 8b12b256..b17df785 100644 --- a/config/mv_checks.xml +++ b/config/mv_checks.xml @@ -15,9 +15,7 @@ - - - + @@ -43,16 +41,47 @@ + + + + + - - + + + + + + + + + + + + + + - + - + + + + + + + + + + + + + + + From 28edf86c96c8b0f160b1600a619e8f3c0a8d52d2 Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Wed, 6 Sep 2023 01:15:33 -0400 Subject: [PATCH 04/23] Configure Annotation checkstyle. --- config/mv_checks.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/mv_checks.xml b/config/mv_checks.xml index b17df785..0729305f 100644 --- a/config/mv_checks.xml +++ b/config/mv_checks.xml @@ -43,6 +43,11 @@ + + + + + From f72572393276d759267850315dd5ac7c0eb93d58 Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Wed, 6 Sep 2023 07:57:36 -0400 Subject: [PATCH 05/23] Configure Block Checks checkstyle. --- config/mv_checks.xml | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/config/mv_checks.xml b/config/mv_checks.xml index 0729305f..93fb3876 100644 --- a/config/mv_checks.xml +++ b/config/mv_checks.xml @@ -43,11 +43,32 @@ + + + + + + + + + + + + + + + + + + + + + @@ -93,6 +114,7 @@ + @@ -132,12 +154,6 @@ - - - - - - @@ -169,7 +185,5 @@ - - From 1d47473cd30bf102d46ea6df3c64e603003c5748 Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Wed, 6 Sep 2023 08:22:01 -0400 Subject: [PATCH 06/23] Configure Class Design checkstyle. --- config/mv_checks.xml | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/config/mv_checks.xml b/config/mv_checks.xml index 93fb3876..5ef6ae87 100644 --- a/config/mv_checks.xml +++ b/config/mv_checks.xml @@ -68,6 +68,23 @@ + + + + + + + + + + + + + + + + + @@ -167,15 +184,6 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -171,23 +235,10 @@ - - - - - - - - - - - From 086c3e8af002af8d3585f43671b20d13790d6512 Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Wed, 6 Sep 2023 09:26:00 -0400 Subject: [PATCH 08/23] Configure Imports checkstyle. --- config/mv_checks.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/config/mv_checks.xml b/config/mv_checks.xml index 3997f37e..e4e34c2c 100644 --- a/config/mv_checks.xml +++ b/config/mv_checks.xml @@ -149,6 +149,15 @@ + + + + + + + + + @@ -204,15 +213,6 @@ - - - - - - - - - From d7f236492b8bf15ac026f495eaf122ba687d4120 Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Wed, 6 Sep 2023 09:43:37 -0400 Subject: [PATCH 09/23] Configure Metrics checkstyle. --- config/mv_checks.xml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/config/mv_checks.xml b/config/mv_checks.xml index e4e34c2c..bbe59fb3 100644 --- a/config/mv_checks.xml +++ b/config/mv_checks.xml @@ -205,6 +205,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + From 67f2f1f6b0cb3935c543522aef1b3cb7da4a0bb8 Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Wed, 6 Sep 2023 10:03:44 -0400 Subject: [PATCH 10/23] Configure Miscellaneous checkstyle. --- config/mv_checks.xml | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/config/mv_checks.xml b/config/mv_checks.xml index bbe59fb3..8a7ed83c 100644 --- a/config/mv_checks.xml +++ b/config/mv_checks.xml @@ -15,9 +15,16 @@ + + + + + + + @@ -229,6 +236,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -262,11 +294,5 @@ - - - - - - From e8e8c4aff6f7c883df4a1e1aa3f135d772af4546 Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Wed, 6 Sep 2023 11:40:17 -0400 Subject: [PATCH 11/23] Configure Modifiers checkstyle. --- config/mv_checks.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config/mv_checks.xml b/config/mv_checks.xml index 8a7ed83c..77fc95e7 100644 --- a/config/mv_checks.xml +++ b/config/mv_checks.xml @@ -261,6 +261,10 @@ + + + + @@ -289,8 +293,6 @@ - - From 073d13cf4d030394274403d9e732ef51afd0c336 Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Wed, 6 Sep 2023 12:05:47 -0400 Subject: [PATCH 12/23] Configure Naming Conventions checkstyle. --- config/mv_checks.xml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/config/mv_checks.xml b/config/mv_checks.xml index 77fc95e7..c764a363 100644 --- a/config/mv_checks.xml +++ b/config/mv_checks.xml @@ -265,14 +265,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + From 405a033d85de7c53ef1bf9c11f965b10439f98d4 Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Wed, 6 Sep 2023 13:40:19 -0400 Subject: [PATCH 13/23] Configure Size Violations checkstyle. --- config/mv_checks.xml | 52 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 10 deletions(-) diff --git a/config/mv_checks.xml b/config/mv_checks.xml index c764a363..6c0a0f73 100644 --- a/config/mv_checks.xml +++ b/config/mv_checks.xml @@ -10,11 +10,6 @@ "https://checkstyle.org/dtds/configuration_1_3.dtd"> - - - - - @@ -25,7 +20,16 @@ - + + + + + + + + + + @@ -298,11 +302,39 @@ - - - + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 407dcb3125493fbac5daa39a3744aa5dc33a3ba8 Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Wed, 6 Sep 2023 13:41:41 -0400 Subject: [PATCH 14/23] Configure Regexp checkstyle. --- config/mv_checks.xml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/config/mv_checks.xml b/config/mv_checks.xml index 6c0a0f73..95cf1bca 100644 --- a/config/mv_checks.xml +++ b/config/mv_checks.xml @@ -20,6 +20,12 @@ + + + + + + @@ -33,10 +39,6 @@ - - - - From bc830ee7801126ce753b83c8dac31cd8b129c282 Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Wed, 6 Sep 2023 17:22:50 -0400 Subject: [PATCH 15/23] Configure Whitespace checkstyle. --- config/mv_checks.xml | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/config/mv_checks.xml b/config/mv_checks.xml index 95cf1bca..b70868ed 100644 --- a/config/mv_checks.xml +++ b/config/mv_checks.xml @@ -36,9 +36,11 @@ + + @@ -337,21 +339,41 @@ + + + + + + + + + - + + + + + + + + - - + + + + + + + + + - - - - - - + + + From dcbcca9a62e427f5fb8ebfe45170aa7ccb6f204f Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Wed, 6 Sep 2023 17:23:15 -0400 Subject: [PATCH 16/23] Remove extra check. --- config/mv_checks.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/config/mv_checks.xml b/config/mv_checks.xml index b70868ed..553c6530 100644 --- a/config/mv_checks.xml +++ b/config/mv_checks.xml @@ -373,9 +373,5 @@ - - - - From 8b895d41f716f96673aa7c5df9bce845cd354ac4 Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Wed, 6 Sep 2023 17:37:31 -0400 Subject: [PATCH 17/23] Add workflow for running and reporting checkstyle. --- .github/workflows/generic.checkstyle.yml | 18 ++++++++++++++++++ .github/workflows/pr.checkstyle.yml | 9 +++++++++ 2 files changed, 27 insertions(+) create mode 100644 .github/workflows/generic.checkstyle.yml create mode 100644 .github/workflows/pr.checkstyle.yml diff --git a/.github/workflows/generic.checkstyle.yml b/.github/workflows/generic.checkstyle.yml new file mode 100644 index 00000000..ecac7d73 --- /dev/null +++ b/.github/workflows/generic.checkstyle.yml @@ -0,0 +1,18 @@ +name: 'Generic: Checkstyle' + +on: + workflow_call: + +jobs: + checkstyle: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v3 + + - uses: dbelyaev/action-checkstyle@v0.8.4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + checkstyle_version: 10.12.2 + checkstyle_config: ./config/mv_checks.yml diff --git a/.github/workflows/pr.checkstyle.yml b/.github/workflows/pr.checkstyle.yml new file mode 100644 index 00000000..b75defc5 --- /dev/null +++ b/.github/workflows/pr.checkstyle.yml @@ -0,0 +1,9 @@ +name: 'PR: Checkstyle' + +on: + pull_request: + types: [opened, synchronize] + +jobs: + test: + uses: ./.github/workflows/generic.checkstyle.yml From 950fe1217a957e570c3d82b6f5a29b5d176c7bcd Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Wed, 6 Sep 2023 17:42:17 -0400 Subject: [PATCH 18/23] Add reviewdog debug flag for checkstyle action. --- .github/workflows/generic.checkstyle.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/generic.checkstyle.yml b/.github/workflows/generic.checkstyle.yml index ecac7d73..f8836478 100644 --- a/.github/workflows/generic.checkstyle.yml +++ b/.github/workflows/generic.checkstyle.yml @@ -16,3 +16,4 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} checkstyle_version: 10.12.2 checkstyle_config: ./config/mv_checks.yml + reviewdog_flags: -tee From 49fcadf434c47f0ea1ffc1db51ab8a7a8267e94e Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Wed, 6 Sep 2023 17:43:25 -0400 Subject: [PATCH 19/23] Use the correct file extension for checkstyle config. --- .github/workflows/generic.checkstyle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generic.checkstyle.yml b/.github/workflows/generic.checkstyle.yml index f8836478..8e84154e 100644 --- a/.github/workflows/generic.checkstyle.yml +++ b/.github/workflows/generic.checkstyle.yml @@ -15,5 +15,5 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} checkstyle_version: 10.12.2 - checkstyle_config: ./config/mv_checks.yml + checkstyle_config: ./config/mv_checks.xml reviewdog_flags: -tee From 5b8984a492d78a2b868bf8e6cc50f8808c5b0ec1 Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Wed, 6 Sep 2023 17:46:50 -0400 Subject: [PATCH 20/23] Test change that fails checkstyle. --- .../MultiverseCore/destination/AnchorDestination.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/onarandombox/MultiverseCore/destination/AnchorDestination.java b/src/main/java/com/onarandombox/MultiverseCore/destination/AnchorDestination.java index 0efea017..e3c7fdb7 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/destination/AnchorDestination.java +++ b/src/main/java/com/onarandombox/MultiverseCore/destination/AnchorDestination.java @@ -23,7 +23,8 @@ import java.util.List; public class AnchorDestination implements MVDestination { private boolean isValid; private Location location; - private MultiverseCore plugin; + private MultiverseCore plugin ; + private Object test ; private String name; /** From 87271aa4eb4e8232e0bacb2a4a0436e0701ffbf6 Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Wed, 6 Sep 2023 17:49:41 -0400 Subject: [PATCH 21/23] Revert "Test change that fails checkstyle." This reverts commit 5b8984a492d78a2b868bf8e6cc50f8808c5b0ec1. --- .../MultiverseCore/destination/AnchorDestination.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/onarandombox/MultiverseCore/destination/AnchorDestination.java b/src/main/java/com/onarandombox/MultiverseCore/destination/AnchorDestination.java index e3c7fdb7..0efea017 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/destination/AnchorDestination.java +++ b/src/main/java/com/onarandombox/MultiverseCore/destination/AnchorDestination.java @@ -23,8 +23,7 @@ import java.util.List; public class AnchorDestination implements MVDestination { private boolean isValid; private Location location; - private MultiverseCore plugin ; - private Object test ; + private MultiverseCore plugin; private String name; /** From d50e8c1dde09908cd1d068699b0a53a60c137cce Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Wed, 6 Sep 2023 17:49:59 -0400 Subject: [PATCH 22/23] Remove checkstyle debug flag. --- .github/workflows/generic.checkstyle.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/generic.checkstyle.yml b/.github/workflows/generic.checkstyle.yml index 8e84154e..a57e6cd2 100644 --- a/.github/workflows/generic.checkstyle.yml +++ b/.github/workflows/generic.checkstyle.yml @@ -16,4 +16,3 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} checkstyle_version: 10.12.2 checkstyle_config: ./config/mv_checks.xml - reviewdog_flags: -tee From 3198fcc4b18c22b98f9c96be8544aca2281a0eb5 Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Wed, 6 Sep 2023 17:54:19 -0400 Subject: [PATCH 23/23] Fix job name in pr.checkstyle.yml. --- .github/workflows/pr.checkstyle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.checkstyle.yml b/.github/workflows/pr.checkstyle.yml index b75defc5..100efc0b 100644 --- a/.github/workflows/pr.checkstyle.yml +++ b/.github/workflows/pr.checkstyle.yml @@ -5,5 +5,5 @@ on: types: [opened, synchronize] jobs: - test: + checkstyle: uses: ./.github/workflows/generic.checkstyle.yml