Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

review: Use official qodana github action #4843

Merged
merged 22 commits into from
Nov 21, 2022
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -157,19 +158,13 @@ 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,changes,true,fail-threshold,0
MartinWitt marked this conversation as resolved.
Show resolved Hide resolved
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't remove the commit pins. Pinning on tag is not safe as they can move. But most prominently it leads to unexpected failures when devs introduce breaking changes and move tags to those.

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:
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/spoon/support/compiler/ZipFolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guessing this is just to trigger an error?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

this.file = file;
}

Expand Down