From 730eeced90c084e934ebc24858d689f650f44483 Mon Sep 17 00:00:00 2001 From: Kamil Czaja Date: Wed, 27 Mar 2024 14:44:11 +0100 Subject: [PATCH 1/6] wip --- .github/workflows/code_analysis.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/code_analysis.yml b/.github/workflows/code_analysis.yml index 0e9cab29b..6f2062886 100644 --- a/.github/workflows/code_analysis.yml +++ b/.github/workflows/code_analysis.yml @@ -30,8 +30,6 @@ jobs: id: check_spotbugs run: echo "spotbugs_active=$(if grep -q "spotbugs-maven-plugin" pom.xml; then echo "true"; else echo "false"; fi)" >> $GITHUB_OUTPUT run_checkstyle: - needs: [is_java_project] - if: needs.is_java_project.outputs.pom_exists == 'true' && needs.is_java_project.outputs.checkstyle_active == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -42,10 +40,8 @@ jobs: java-version: "17" cache: "maven" - name: Run style checks - run: mvn -B checkstyle:check --file pom.xml + run: mvn -B checkstyle:check --file build.gradle.kts run_spotbugs: - needs: [is_java_project] - if: needs.is_java_project.outputs.pom_exists == 'true' && needs.is_java_project.outputs.spotbugs_active == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -56,4 +52,4 @@ jobs: java-version: "17" cache: "maven" - name: Run static code analysis - run: mvn -B compile spotbugs:check --file pom.xml + run: mvn -B compile spotbugs:check --file build.gradle.kts From e238e778706b7b8418caf1f786aca5f6930c3e80 Mon Sep 17 00:00:00 2001 From: Kamil Czaja Date: Wed, 27 Mar 2024 15:24:44 +0100 Subject: [PATCH 2/6] wip --- .github/workflows/code_analysis.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/code_analysis.yml b/.github/workflows/code_analysis.yml index 6f2062886..a47815733 100644 --- a/.github/workflows/code_analysis.yml +++ b/.github/workflows/code_analysis.yml @@ -40,16 +40,4 @@ jobs: java-version: "17" cache: "maven" - name: Run style checks - run: mvn -B checkstyle:check --file build.gradle.kts - run_spotbugs: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 - with: - distribution: "temurin" - java-version: "17" - cache: "maven" - - name: Run static code analysis - run: mvn -B compile spotbugs:check --file build.gradle.kts + run: gradlew checkstyleMain checkstyleTest From 89a301752a2a939f155e0d8bb70cf08c1f60827f Mon Sep 17 00:00:00 2001 From: Kamil Czaja Date: Wed, 27 Mar 2024 15:53:06 +0100 Subject: [PATCH 3/6] wip --- .github/workflows/code_analysis.yml | 24 +--- docs/dev/checkstyle/checkstyle-config.xml | 162 +++++++++------------- 2 files changed, 66 insertions(+), 120 deletions(-) diff --git a/.github/workflows/code_analysis.yml b/.github/workflows/code_analysis.yml index a47815733..7ea1f2aac 100644 --- a/.github/workflows/code_analysis.yml +++ b/.github/workflows/code_analysis.yml @@ -9,26 +9,6 @@ on: - "docs/**" jobs: - is_java_project: - runs-on: ubuntu-latest - outputs: - pom_exists: ${{ steps.check_files.outputs.files_exists }} - checkstyle_active: ${{ steps.check_checkstyle.outputs.checkstyle_active }} - spotbugs_active: ${{ steps.check_spotbugs.outputs.spotbugs_active }} - steps: - - name: Checkout code - uses: actions/checkout@v3 - - name: Check file existence - id: check_files - uses: andstor/file-existence-action@v2 - with: - files: "pom.xml" - - name: check_checkstyle - id: check_checkstyle - run: echo "checkstyle_active=$(if grep -q "maven-checkstyle-plugin" pom.xml; then echo "true"; else echo "false"; fi)" >> $GITHUB_OUTPUT - - name: check_spotbugs - id: check_spotbugs - run: echo "spotbugs_active=$(if grep -q "spotbugs-maven-plugin" pom.xml; then echo "true"; else echo "false"; fi)" >> $GITHUB_OUTPUT run_checkstyle: runs-on: ubuntu-latest steps: @@ -38,6 +18,6 @@ jobs: with: distribution: "temurin" java-version: "17" - cache: "maven" + cache: "gradle" - name: Run style checks - run: gradlew checkstyleMain checkstyleTest + run: ./gradlew checkstyleMain checkstyleTest diff --git a/docs/dev/checkstyle/checkstyle-config.xml b/docs/dev/checkstyle/checkstyle-config.xml index dc848298a..193e5c524 100644 --- a/docs/dev/checkstyle/checkstyle-config.xml +++ b/docs/dev/checkstyle/checkstyle-config.xml @@ -1,7 +1,7 @@ + "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" + "https://checkstyle.org/dtds/configuration_1_3.dtd"> + + - + - - + + - + - + + default="checkstyle-suppressions.xml" /> - + - + - - - - - - - - - @@ -83,8 +75,6 @@ - - + COMPACT_CTOR_DEF, LITERAL_SWITCH"/> @@ -116,8 +106,10 @@ + value="COMMA, SEMI, TYPECAST, LITERAL_IF, LITERAL_ELSE, LITERAL_RETURN, + LITERAL_WHILE, LITERAL_DO, LITERAL_FOR, LITERAL_FINALLY, DO_WHILE, ELLIPSIS, + LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_CATCH, LAMBDA, + LITERAL_YIELD, LITERAL_CASE"/> @@ -135,7 +127,8 @@ NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, LITERAL_ASSERT, TYPE_EXTENSION_AND"/> + value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks + may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/> @@ -148,7 +141,7 @@ @@ -221,13 +214,8 @@ - - - - - + @@ -242,12 +230,12 @@ value="Record type name ''{0}'' must match pattern ''{1}''."/> - + - + @@ -263,12 +251,12 @@ value="GenericWhitespace ''{0}'' is not preceded with whitespace."/> - - - + + + - - + + @@ -279,13 +267,12 @@ RECORD_COMPONENT_DEF"/> - - - + + - + @@ -308,13 +295,12 @@ RECORD_DEF"/> - + - - + @@ -347,8 +333,22 @@ + + + + + + + + + + + - + @@ -359,58 +359,24 @@ - + + default="checkstyle-xpath-suppressions.xml" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + From cd9502e0c555d2918a62992f53b5f458aaac84eb Mon Sep 17 00:00:00 2001 From: Kamil Czaja Date: Wed, 27 Mar 2024 16:36:25 +0100 Subject: [PATCH 4/6] wip --- build.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle.kts b/build.gradle.kts index 2f094e0d3..be728befe 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -67,6 +67,7 @@ allprojects { configFile = rootProject.file("docs/dev/checkstyle/checkstyle-config.xml") configDirectory.set(rootProject.file("docs/dev/checkstyle")) maxErrors = 0 // does not tolerate errors + maxWarnings = 0 } repositories { From 4c804abb7fec27c969c8c37a824c9757fd179976 Mon Sep 17 00:00:00 2001 From: Kamil Czaja Date: Wed, 27 Mar 2024 16:41:42 +0100 Subject: [PATCH 5/6] wip --- build.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle.kts b/build.gradle.kts index be728befe..db2bb2e24 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -68,6 +68,7 @@ allprojects { configDirectory.set(rootProject.file("docs/dev/checkstyle")) maxErrors = 0 // does not tolerate errors maxWarnings = 0 + sourceSets = emptySet() } repositories { From 919cc036b0ec59b679cd89984c3c5eb0bda6ead4 Mon Sep 17 00:00:00 2001 From: Kamil Czaja Date: Wed, 27 Mar 2024 16:45:44 +0100 Subject: [PATCH 6/6] wip --- docs/dev/checkstyle/checkstyle-config.xml | 162 +++++++++++++--------- 1 file changed, 98 insertions(+), 64 deletions(-) diff --git a/docs/dev/checkstyle/checkstyle-config.xml b/docs/dev/checkstyle/checkstyle-config.xml index 193e5c524..dc848298a 100644 --- a/docs/dev/checkstyle/checkstyle-config.xml +++ b/docs/dev/checkstyle/checkstyle-config.xml @@ -1,7 +1,7 @@ + "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" + "https://checkstyle.org/dtds/configuration_1_3.dtd"> - - - + - - + + - + - + + default="resources/checkstyle-suppressions.xml" /> - + - + + + + + + + + + + @@ -75,6 +83,8 @@ + + + COMPACT_CTOR_DEF"/> @@ -106,10 +116,8 @@ + value="COMMA, SEMI, TYPECAST, LITERAL_IF, LITERAL_ELSE, + LITERAL_WHILE, LITERAL_DO, LITERAL_FOR, DO_WHILE"/> @@ -127,8 +135,7 @@ NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, LITERAL_ASSERT, TYPE_EXTENSION_AND"/> + value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/> @@ -141,7 +148,7 @@ @@ -214,8 +221,13 @@ + + + + - + @@ -230,12 +242,12 @@ value="Record type name ''{0}'' must match pattern ''{1}''."/> - + - + @@ -251,12 +263,12 @@ value="GenericWhitespace ''{0}'' is not preceded with whitespace."/> - - - + + + - - + + @@ -267,12 +279,13 @@ RECORD_COMPONENT_DEF"/> - - + + + - + @@ -295,12 +308,13 @@ RECORD_DEF"/> - + + + - @@ -333,22 +347,8 @@ - - - - - - - - - - - - + @@ -359,24 +359,58 @@ - + + default="checkstyle-xpath-suppressions.xml"/> - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +