From b6e3a8e2a2ada0a8df7e2f141c075295e9651466 Mon Sep 17 00:00:00 2001 From: Martin Wittlinger Date: Mon, 15 Aug 2022 08:47:43 +0200 Subject: [PATCH 01/17] change qodana options to match new style --- .github/workflows/tests.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4a07d78cf05..854609439ee 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -157,12 +157,7 @@ jobs: - name: Qodana - Code Inspection uses: JetBrains/qodana-action@ab695492d98902c49b33382782175107ec63ca28 # tag=v2022.2.1 with: - linter: ${{ env.QODANA_LINTER }} - project-dir: "${{ github.workspace }}/pull_request" - inspected-dir: ./src/main/java # only main spoon project at first - results-dir: "${{ github.workspace }}/result" - changes: true - fail-threshold: 0 + args: --linter, ${{ env.QODANA_LINTER }}, project-dir, "${{ github.workspace }}/pull_request",source-directory, ./src/main/java,results-dir "${{ github.workspace }}/result",changes,true,fail-threshold,0 use-annotations: false use-caches: false # we disable cache for consistent results - uses: github/codeql-action/upload-sarif@3f62b754e23e0dd60f91b744033e1dc1654c0ec6 # tag=v2 From dc27d77ef34d65ca1f9da6ca5aac6d2e1c924ca7 Mon Sep 17 00:00:00 2001 From: MartinWitt Date: Mon, 15 Aug 2022 08:56:34 +0200 Subject: [PATCH 02/17] Update tests.yml --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 854609439ee..1130330cf52 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -157,7 +157,7 @@ jobs: - name: Qodana - Code Inspection uses: JetBrains/qodana-action@ab695492d98902c49b33382782175107ec63ca28 # tag=v2022.2.1 with: - args: --linter, ${{ env.QODANA_LINTER }}, project-dir, "${{ github.workspace }}/pull_request",source-directory, ./src/main/java,results-dir "${{ github.workspace }}/result",changes,true,fail-threshold,0 + args: --linter, ${{ env.QODANA_LINTER }}, project-dir, "${{ github.workspace }}/pull_request",source-directory, ./src/main/java,results-dir, "${{ github.workspace }}/result",changes,true,fail-threshold,0 use-annotations: false use-caches: false # we disable cache for consistent results - uses: github/codeql-action/upload-sarif@3f62b754e23e0dd60f91b744033e1dc1654c0ec6 # tag=v2 From 3f4993318acaa5cfbfc2fea5e3cd29346f7a09fd Mon Sep 17 00:00:00 2001 From: MartinWitt Date: Mon, 15 Aug 2022 09:00:06 +0200 Subject: [PATCH 03/17] Update tests.yml --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1130330cf52..72013e867f7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -157,7 +157,7 @@ jobs: - name: Qodana - Code Inspection uses: JetBrains/qodana-action@ab695492d98902c49b33382782175107ec63ca28 # tag=v2022.2.1 with: - args: --linter, ${{ env.QODANA_LINTER }}, project-dir, "${{ github.workspace }}/pull_request",source-directory, ./src/main/java,results-dir, "${{ github.workspace }}/result",changes,true,fail-threshold,0 + args: --linter, ${{ env.QODANA_LINTER }}, project-dir,${{ github.workspace }}/pull_request,source-directory, /src/main/java,results-dir,${{ github.workspace }}/result,changes,true,fail-threshold,0 use-annotations: false use-caches: false # we disable cache for consistent results - uses: github/codeql-action/upload-sarif@3f62b754e23e0dd60f91b744033e1dc1654c0ec6 # tag=v2 From 1d2af6a9ec212f9810b188b609c01c6c494735a9 Mon Sep 17 00:00:00 2001 From: Martin Wittlinger Date: Mon, 15 Aug 2022 09:22:43 +0200 Subject: [PATCH 04/17] up --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 854609439ee..54df5fbc8de 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -148,6 +148,7 @@ jobs: uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2 with: path: pull_request + fetch-depth: 0 - uses: actions/setup-java@2c7a4878f5d120bd643426d54ae1209b29cc01a3 # tag=v3.4.1 with: java-version: 17 @@ -160,11 +161,10 @@ jobs: args: --linter, ${{ env.QODANA_LINTER }}, project-dir, "${{ github.workspace }}/pull_request",source-directory, ./src/main/java,results-dir "${{ github.workspace }}/result",changes,true,fail-threshold,0 use-annotations: false use-caches: false # we disable cache for consistent results - - uses: github/codeql-action/upload-sarif@3f62b754e23e0dd60f91b744033e1dc1654c0ec6 # tag=v2 + - uses: github/codeql-action/upload-sarif@v2 if: always() with: - sarif_file: "${{ github.workspace }}/result/qodana.sarif.json" - + sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json reproducible-builds: runs-on: ubuntu-latest env: From 97f98a77c9786ef316a8e1b791a41de75bc55660 Mon Sep 17 00:00:00 2001 From: Martin Wittlinger Date: Mon, 15 Aug 2022 09:26:06 +0200 Subject: [PATCH 05/17] qodana test --- src/main/java/spoon/support/compiler/ZipFolder.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/spoon/support/compiler/ZipFolder.java b/src/main/java/spoon/support/compiler/ZipFolder.java index 4aeb67e1712..c27113584c1 100644 --- a/src/main/java/spoon/support/compiler/ZipFolder.java +++ b/src/main/java/spoon/support/compiler/ZipFolder.java @@ -39,6 +39,9 @@ public ZipFolder(File file) throws IOException { if (!file.isFile()) { throw new IOException(file.getName() + " is not a valid zip file"); } + if (false==true) { + String s = new String[0].toString(); + } this.file = file; } From 3e150e8a9da6b8eef5dc0c19f5deca850f10bb47 Mon Sep 17 00:00:00 2001 From: MartinWitt Date: Mon, 15 Aug 2022 09:30:36 +0200 Subject: [PATCH 06/17] Update tests.yml --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0bd74ee5a08..cca6ef486b9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -158,7 +158,7 @@ jobs: - name: Qodana - Code Inspection uses: JetBrains/qodana-action@ab695492d98902c49b33382782175107ec63ca28 # tag=v2022.2.1 with: - args: --linter, ${{ env.QODANA_LINTER }}, project-dir,${{ github.workspace }}/pull_request,source-directory, /src/main/java,results-dir,${{ github.workspace }}/result,changes,true,fail-threshold,0 + args: --linter, ${{ env.QODANA_LINTER }}, project-dir,${{ github.workspace }}/pull_request,results-dir,${{ github.workspace }}/result,changes,true,fail-threshold,0 use-annotations: false use-caches: false # we disable cache for consistent results - uses: github/codeql-action/upload-sarif@v2 From c6e86d026808396fc520606e61a434544e0399a1 Mon Sep 17 00:00:00 2001 From: MartinWitt Date: Mon, 15 Aug 2022 09:31:09 +0200 Subject: [PATCH 07/17] Update tests.yml --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cca6ef486b9..f6ce08e386f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -158,7 +158,7 @@ jobs: - name: Qodana - Code Inspection uses: JetBrains/qodana-action@ab695492d98902c49b33382782175107ec63ca28 # tag=v2022.2.1 with: - args: --linter, ${{ env.QODANA_LINTER }}, project-dir,${{ github.workspace }}/pull_request,results-dir,${{ github.workspace }}/result,changes,true,fail-threshold,0 + args: --linter, ${{ env.QODANA_LINTER }}, project-dir,${{ github.workspace }}/pull_request,changes,true,fail-threshold,0 use-annotations: false use-caches: false # we disable cache for consistent results - uses: github/codeql-action/upload-sarif@v2 From ffa956abf8359a9502dff8830fc05e847ed8822a Mon Sep 17 00:00:00 2001 From: MartinWitt Date: Sun, 25 Sep 2022 11:58:22 +0200 Subject: [PATCH 08/17] Update .github/workflows/tests.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Simon Larsén --- .github/workflows/tests.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f6ce08e386f..d81e5ac95f8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -158,7 +158,15 @@ jobs: - name: Qodana - Code Inspection uses: JetBrains/qodana-action@ab695492d98902c49b33382782175107ec63ca28 # tag=v2022.2.1 with: - args: --linter, ${{ env.QODANA_LINTER }}, project-dir,${{ github.workspace }}/pull_request,changes,true,fail-threshold,0 + args: >- + --linter, + ${{ env.QODANA_LINTER }}, + project-dir, + ${{ github.workspace }}/pull_request, + changes, + true, + fail-threshold, + 0 use-annotations: false use-caches: false # we disable cache for consistent results - uses: github/codeql-action/upload-sarif@v2 From c4a8af6e02b86d5008c7596b3c2af3f9da14753e Mon Sep 17 00:00:00 2001 From: MartinWitt Date: Sun, 25 Sep 2022 11:59:07 +0200 Subject: [PATCH 09/17] Update tests.yml --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d81e5ac95f8..cf53a31aecc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -169,7 +169,7 @@ jobs: 0 use-annotations: false use-caches: false # we disable cache for consistent results - - uses: github/codeql-action/upload-sarif@v2 + - uses: github/codeql-action/upload-sarif@3f62b754e23e0dd60f91b744033e1dc1654c0ec6 # tag=v2 if: always() with: sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json From be160cd45a4624d1cf8c1a1f542e6f31eb850e42 Mon Sep 17 00:00:00 2001 From: MartinWitt Date: Sun, 25 Sep 2022 12:09:35 +0200 Subject: [PATCH 10/17] Update tests.yml --- .github/workflows/tests.yml | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1054a4f41aa..6a0948904c8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -144,32 +144,16 @@ jobs: QODANA_LINTER: jetbrains/qodana-jvm-community@sha256:c388ddd7b852296f71b1a786d3b30f458a993eb252d5cd4963422007e5b824db name: code-quality qodana steps: - - name: Checkout - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2 + - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2 with: - path: pull_request + fetch-depth: 0 - uses: actions/setup-java@d854b6da19cdadd9a010605529e522c2393ebd38 # tag=v3.5.0 with: java-version: 17 distribution: ${{ env.JAVA_DISTRIBUTION }} - - name: git reset - run: cd pull_request && git fetch && git reset --soft origin/master - - name: Qodana - Code Inspection - uses: JetBrains/qodana-action@ab695492d98902c49b33382782175107ec63ca28 # tag=v2022.2.1 - with: - args: >- - --linter, - ${{ env.QODANA_LINTER }}, - project-dir, - ${{ github.workspace }}/pull_request, - changes, - true, - fail-threshold, - 0 - use-annotations: false - use-caches: false # we disable cache for consistent results - - uses: github/codeql-action/upload-sarif@b398f525a5587552e573b247ac661067fafa920b # tag=v2 - if: always() + - name: 'Qodana Scan' + uses: JetBrains/qodana-action@v2022.2.1 + - uses: github/codeql-action/upload-sarif@v2 with: sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json reproducible-builds: From 9c6e284a7e3c0c6865d954444c6a455c5c5a01d9 Mon Sep 17 00:00:00 2001 From: MartinWitt Date: Sun, 25 Sep 2022 12:13:26 +0200 Subject: [PATCH 11/17] Update ZipFolder.java --- src/main/java/spoon/support/compiler/ZipFolder.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/spoon/support/compiler/ZipFolder.java b/src/main/java/spoon/support/compiler/ZipFolder.java index 3ebaf4cb161..cd041e94a82 100644 --- a/src/main/java/spoon/support/compiler/ZipFolder.java +++ b/src/main/java/spoon/support/compiler/ZipFolder.java @@ -47,11 +47,11 @@ public ZipFolder(File file) throws IOException { if (!file.isFile()) { throw new IOException(file.getName() + " is not a valid zip file"); } - if (false==true) { - String s = new String[0].toString(); - } this.file = file; } + private Object deleteMe() { + return null; + } @Override public List getAllFiles() { From 3c08c4e548f0f71a6bca520ca503c2a868d80b6d Mon Sep 17 00:00:00 2001 From: Martin Wittlinger Date: Sun, 30 Oct 2022 17:00:23 +0100 Subject: [PATCH 12/17] test qodana --- src/main/java/spoon/javadoc/internal/Javadoc.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/spoon/javadoc/internal/Javadoc.java b/src/main/java/spoon/javadoc/internal/Javadoc.java index 022489cee5e..03049656bad 100644 --- a/src/main/java/spoon/javadoc/internal/Javadoc.java +++ b/src/main/java/spoon/javadoc/internal/Javadoc.java @@ -36,7 +36,7 @@ public class Javadoc implements Serializable { private static final long serialVersionUID = 1L; - private JavadocDescription description; + transient private JavadocDescription description; private List blockTags; public Javadoc() { From 1b0b4a4fdd857f8ef990f149eff36e9c96752cea Mon Sep 17 00:00:00 2001 From: Martin Wittlinger Date: Sun, 30 Oct 2022 17:15:56 +0100 Subject: [PATCH 13/17] up --- qodana.yml => qodana.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename qodana.yml => qodana.yaml (97%) diff --git a/qodana.yml b/qodana.yaml similarity index 97% rename from qodana.yml rename to qodana.yaml index f0fca6196bc..7921172d3a9 100644 --- a/qodana.yml +++ b/qodana.yaml @@ -1,4 +1,4 @@ -version: 1.0 +version: "1.0" profile: name: qodana.recommended include: From 2a4fd6e7e303f5af388e269bda126e872533cf23 Mon Sep 17 00:00:00 2001 From: Martin Wittlinger Date: Sun, 30 Oct 2022 17:31:22 +0100 Subject: [PATCH 14/17] up --- qodana.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/qodana.yaml b/qodana.yaml index d8c1598c7e6..ff4f10f44d8 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -1,4 +1,5 @@ version: "1.0" +linter: jetbrains/qodana-jvm-community:2022.2 profile: name: qodana.recommended include: From 179aa3f6ad29aa27b144e7e7facb72df0fafb8bc Mon Sep 17 00:00:00 2001 From: Martin Wittlinger Date: Sun, 30 Oct 2022 17:49:48 +0100 Subject: [PATCH 15/17] refactor qodana action to new style. - Remove deprecated cli options. - set to strict mode failing if more then zero issues are found. --- .github/workflows/tests.yml | 13 ++++--------- qodana.yaml | 4 ++-- src/main/java/spoon/javadoc/internal/Javadoc.java | 2 +- src/main/java/spoon/support/compiler/ZipFolder.java | 3 --- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 434f5e69e00..1bf22a7dbb0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -142,22 +142,17 @@ jobs: - name: Run Javadoc quality check run: ./chore/check-javadoc-regressions.py COMPARE_WITH_MASTER - code-quality: # we create a new step here because qodana analyzer takes around 10min + code-quality: runs-on: ubuntu-latest - env: - MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false - QODANA_LINTER: jetbrains/qodana-jvm-community@sha256:c388ddd7b852296f71b1a786d3b30f458a993eb252d5cd4963422007e5b824db name: code-quality qodana steps: - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2 with: fetch-depth: 0 - - uses: actions/setup-java@d854b6da19cdadd9a010605529e522c2393ebd38 # tag=v3.5.0 - with: - java-version: 17 - distribution: ${{ env.JAVA_DISTRIBUTION }} - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2022.2.1 + uses: JetBrains/qodana-action@v2022.2.2 + with: + args: --source-directory,./src/main/java , --fail-threshold, 0 - uses: github/codeql-action/upload-sarif@v2 with: sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json diff --git a/qodana.yaml b/qodana.yaml index ff4f10f44d8..e858314af16 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -1,7 +1,7 @@ -version: "1.0" -linter: jetbrains/qodana-jvm-community:2022.2 profile: name: qodana.recommended +version: "1.0" +linter: jetbrains/qodana-jvm-community:2022.3-eap include: - name: Anonymous2MethodRef - name: AssignmentToCatchBlockParameter diff --git a/src/main/java/spoon/javadoc/internal/Javadoc.java b/src/main/java/spoon/javadoc/internal/Javadoc.java index 03049656bad..022489cee5e 100644 --- a/src/main/java/spoon/javadoc/internal/Javadoc.java +++ b/src/main/java/spoon/javadoc/internal/Javadoc.java @@ -36,7 +36,7 @@ public class Javadoc implements Serializable { private static final long serialVersionUID = 1L; - transient private JavadocDescription description; + private JavadocDescription description; private List blockTags; public Javadoc() { diff --git a/src/main/java/spoon/support/compiler/ZipFolder.java b/src/main/java/spoon/support/compiler/ZipFolder.java index cd041e94a82..e743e7b951c 100644 --- a/src/main/java/spoon/support/compiler/ZipFolder.java +++ b/src/main/java/spoon/support/compiler/ZipFolder.java @@ -49,9 +49,6 @@ public ZipFolder(File file) throws IOException { } this.file = file; } - private Object deleteMe() { - return null; - } @Override public List getAllFiles() { From b3f2b961eb8ab9de99ca08010aa1f37c87be204f Mon Sep 17 00:00:00 2001 From: Martin Wittlinger Date: Sun, 20 Nov 2022 10:59:17 +0100 Subject: [PATCH 16/17] =?UTF-8?q?=F0=9F=92=A9=20add=20code=20to=20showcase?= =?UTF-8?q?=20qodana=20works?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/spoon/support/StandardEnvironment.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/spoon/support/StandardEnvironment.java b/src/main/java/spoon/support/StandardEnvironment.java index fec94930e7d..a8cedaf3dfc 100644 --- a/src/main/java/spoon/support/StandardEnvironment.java +++ b/src/main/java/spoon/support/StandardEnvironment.java @@ -763,4 +763,11 @@ public boolean isIgnoreDuplicateDeclarations() { public void setIgnoreDuplicateDeclarations(boolean ignoreDuplicateDeclarations) { this.ignoreDuplicateDeclarations = ignoreDuplicateDeclarations; } + + static public void foo() { + // TODO Auto-generated method stub + int[] a = null; + Arrays.toString(a); + boolean b = a == null | false; + } } From e053a5bd66b8666a31ff70745909817e2fe77d8f Mon Sep 17 00:00:00 2001 From: Martin Wittlinger Date: Sun, 20 Nov 2022 11:09:05 +0100 Subject: [PATCH 17/17] =?UTF-8?q?Revert=20"=F0=9F=92=A9=20add=20code=20to?= =?UTF-8?q?=20showcase=20qodana=20works"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b3f2b961eb8ab9de99ca08010aa1f37c87be204f. --- src/main/java/spoon/support/StandardEnvironment.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/main/java/spoon/support/StandardEnvironment.java b/src/main/java/spoon/support/StandardEnvironment.java index a8cedaf3dfc..fec94930e7d 100644 --- a/src/main/java/spoon/support/StandardEnvironment.java +++ b/src/main/java/spoon/support/StandardEnvironment.java @@ -763,11 +763,4 @@ public boolean isIgnoreDuplicateDeclarations() { public void setIgnoreDuplicateDeclarations(boolean ignoreDuplicateDeclarations) { this.ignoreDuplicateDeclarations = ignoreDuplicateDeclarations; } - - static public void foo() { - // TODO Auto-generated method stub - int[] a = null; - Arrays.toString(a); - boolean b = a == null | false; - } }