diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2351429..e8d865c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -101,6 +101,44 @@ jobs: name: tests-result path: ${{ github.workspace }}/build/reports/tests + # Run Qodana inspections and provide a report + inspectCode: + name: Inspect code + needs: [ build ] + runs-on: ubuntu-latest + permissions: + contents: write + checks: write + pull-requests: write + steps: + + # Free GitHub Actions Environment Disk Space + - name: Maximize Build Space + uses: jlumbroso/free-disk-space@v1.3.1 + with: + tool-cache: false + large-packages: false + + # Check out the current repository + - name: Fetch Sources + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit + fetch-depth: 0 # a full history is required for pull request analysis + + # Set up the Java environment for the next steps + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: zulu + java-version: 17 + + # Run Qodana inspections + - name: Qodana - Code Inspection + uses: JetBrains/qodana-action@v2025.1.1 + with: + cache-default-branch-only: true + # Run plugin structure verification along with IntelliJ Plugin Verifier verify: name: Verify plugin diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..a59e26c --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 3e435eb..4530f17 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,6 +5,7 @@ plugins { id("java") // Java support alias(libs.plugins.kotlin) // Kotlin support alias(libs.plugins.intelliJPlatform) // IntelliJ Platform Gradle Plugin + alias(libs.plugins.qodana) // Gradle Qodana Plugin alias(libs.plugins.changelog) // Gradle Changelog Plugin } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 75b9f01..07d76a7 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,6 +6,7 @@ junit = "4.13.2" changelog = "2.2.1" intelliJPlatform = "2.0.1" # TODO: update this in next update: https://youtrack.jetbrains.com/issue/MP-7019 kotlin = "1.9.25" +qodana = "2025.1.1" [libraries] junit = { group = "junit", name = "junit", version.ref = "junit" } @@ -14,3 +15,4 @@ junit = { group = "junit", name = "junit", version.ref = "junit" } changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" } intelliJPlatform = { id = "org.jetbrains.intellij.platform", version.ref = "intelliJPlatform" } kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } +qodana = { id = "org.jetbrains.qodana", version.ref = "qodana" } diff --git a/qodana.yaml b/qodana.yaml new file mode 100644 index 0000000..1f59880 --- /dev/null +++ b/qodana.yaml @@ -0,0 +1,12 @@ +# Qodana configuration: +# https://www.jetbrains.com/help/qodana/qodana-yaml.html + +version: "1.0" +linter: jetbrains/qodana-jvm-community:2024.3 +projectJDK: "21" +profile: + name: Project_Default +exclude: + - name: All + paths: + - .qodana