From 234a481b0ddfdb339f4886cf60b1c3238796b4db Mon Sep 17 00:00:00 2001 From: md678685 <1917406+md678685@users.noreply.github.com> Date: Sat, 3 Oct 2020 16:40:11 +0100 Subject: [PATCH] Add Checkstyle rules and suppressions This commit adds Checkstyle rules for EssentialsX, based on those from the adventure library (https://github.com/KyoriPowered/adventure/tree/master/.checkstyle). It also makes Checkstyle passes mandatory for a GH build to pass. --- .checkstyle/checkstyle.xml | 183 +++++++++++++++++++++++++++++++++++ .checkstyle/suppressions.xml | 6 ++ .github/workflows/build.yml | 2 +- .gitignore | 9 +- .idea/checkstyle-idea.xml | 19 ++++ pom.xml | 27 +++++- 6 files changed, 238 insertions(+), 8 deletions(-) create mode 100644 .checkstyle/checkstyle.xml create mode 100644 .checkstyle/suppressions.xml create mode 100644 .idea/checkstyle-idea.xml diff --git a/.checkstyle/checkstyle.xml b/.checkstyle/checkstyle.xml new file mode 100644 index 000000000..2b482b36c --- /dev/null +++ b/.checkstyle/checkstyle.xml @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.checkstyle/suppressions.xml b/.checkstyle/suppressions.xml new file mode 100644 index 000000000..549f4e95f --- /dev/null +++ b/.checkstyle/suppressions.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3d4b31e2b..76cfb0ad3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ jobs: with: java-version: 1.8 - name: Build with Maven - run: mvn package --file pom.xml + run: mvn package verify --file pom.xml - name: Copy artifacts run: mkdir -p ./out/ && cp -t ./out/ **/target/Essentials*.jar - uses: actions/upload-artifact@master diff --git a/.gitignore b/.gitignore index d5ab3034d..4d8855434 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,14 @@ -# IDE files +# Other IDE files *.classpath *.project *.settings/ -.idea/ +.idea/* *.iml .DS_Store +# Checkstyle-IDEA config +!.idea/checkstyle-idea.xml + # Essentials files /Essentials/userdata /Essentials/config.yml @@ -16,4 +19,4 @@ # Build files target/ jars/ -out/ \ No newline at end of file +out/ diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 000000000..dff7bebd8 --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index d9845880b..7a4a98e65 100644 --- a/pom.xml +++ b/pom.xml @@ -35,10 +35,10 @@ paper-repo https://papermc.io/repo/repository/maven-public/ - - jitpack - https://jitpack.io - + + jitpack + https://jitpack.io + @@ -188,6 +188,7 @@ ${full.version} + $${build.number} ${full.version} @@ -251,7 +252,24 @@ + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.1.1 + + .checkstyle/checkstyle.xml + .checkstyle/suppressions.xml + + + + + check + + + + + src @@ -274,6 +292,7 @@ 2.18.1 + ${git.closest.tag.commit.count} ${release.version}.${build.version}