Skip to content

Commit

Permalink
reenable sonarqube, disable the crappy things
Browse files Browse the repository at this point in the history
* also fix some encoding in recorder/src files
  • Loading branch information
wadoon committed Jun 24, 2024
1 parent c2adfc6 commit 82ef399
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 260 deletions.
39 changes: 0 additions & 39 deletions .github/old_workflows/sonarqube.yml

This file was deleted.

88 changes: 0 additions & 88 deletions .github/workflows/artiweb.yml

This file was deleted.

89 changes: 1 addition & 88 deletions .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,6 @@ jobs:
with:
arguments: -DENABLE_NULLNESS=true compileTest


qodana:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 'Qodana Scan'
uses: JetBrains/[email protected]

- uses: github/codeql-action/upload-sarif@v3
if: success() || failure()
with:
sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json

formatting:
runs-on: ubuntu-latest
steps:
Expand All @@ -51,76 +36,4 @@ jobs:
- name: Build with Gradle
uses: gradle/[email protected]
with:
arguments: --continue spotlessCheck

# checkstyle:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - run: scripts/tools/checkstyle/runIncrementalCheckstyle.sh --xml | tee report.xml
# - run: |
# npx violations-command-line -sarif sarif-report.json \
# -v "CHECKSTYLE" "." ".*/report.xml$" "Checkstyle" \
# -diff-to $(git merge-base HEAD origin/main) -pv false

# - uses: github/codeql-action/upload-sarif@v3
# if: success() || failure()
# with:
# sarif_file: sarif-report.json


checkstyle_new:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '21'
cache: 'gradle'

- name: Build with Gradle
uses: gradle/[email protected]
with:
arguments: --continue checkstyleMainChanged
- run: |
npx violations-command-line -sarif sarif-report.json \
-v "CHECKSTYLE" "." ".*/build/reports/checkstyle/main_diff.xml$" "Checkstyle"
#-diff-from $(git merge-base HEAD origin/main)
# - run: python3 ./.github/printcs.py */build/reports/checkstyle/main_diff.xml

# $(git merge-base HEAD origin/main)

- uses: github/codeql-action/upload-sarif@v3
if: success() || failure()
with:
sarif_file: sarif-report.json

pmd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '21'
cache: 'gradle'
- name: Build with Gradle
uses: gradle/[email protected]
with:
arguments: --continue pmdMainChanged

# - run: python3 ./.github/printAnnotations.py */build/reports/pmd/main.xml

- run: |
npx violations-command-line -sarif pmd-report.json \
-v "PMD" "." ".*/build/reports/pmd/main_diff.xml$" "PMD"
# -diff-from $(git merge-base HEAD origin/main)
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: pmd-report.json
arguments: --continue spotlessCheck
43 changes: 0 additions & 43 deletions .github/workflows/codeql.yml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/sonarqube.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
## Copied from SonarCloud

name: SonarCloud
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]

jobs:
build:
name: Build and analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: 21
distribution: 'zulu'
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@v3
with:
build-scan-publish: true
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-use-agree: "yes"

- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GRADLE_OPTS: "-Xmx6g -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8"
run: ./gradlew --parallel --continue -DjacocoEnabled=true -x :key.core.symbolic_execution:test -x :key.core.proof_references:test classes testClasses :key.util:test jacocoTestReport sonar
11 changes: 11 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,19 @@ plugins {

// EISOP Checker Framework
id "org.checkerframework" version "0.6.39"

id("org.sonarqube") version "5.0.0.4638"
}

sonar {
properties {
property "sonar.projectKey", "KeYProject_key"
property "sonar.organization", "keyproject"
property "sonar.host.url", "https://sonarcloud.io"
}
}


// Configure this project for use inside IntelliJ:
idea {
module {
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import recoder.service.ProgramModelInfo;

/**
* Represents an intersection type, which was introduced in java 5. See JLS, 3rd edition, 4.9 for
* Represents an intersection type, which was introduced in java 5. See JLS, 3rd edition, §4.9 for
* details.
*
* @author Tobias Gutzmann
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import recoder.list.generic.ASTList;

/**
* converts an enhanced for loop to an "old style" for loop. This follows JLS 3rd edition, 14.14.2.
* converts an enhanced for loop to an "old style" for loop. This follows JLS 3rd edition, §14.14.2.
* <p>
* Currently, if given enhanced for iterates over an array, this will replace the enhanced for with
* a statement block and not inline it into a possibly given statement block, yielding possibly not
Expand Down

0 comments on commit 82ef399

Please sign in to comment.