From 6d2c649c5a93c5a6b61f2cb38932d0c2cb8e2e09 Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Wed, 1 Apr 2026 13:57:21 +0300 Subject: [PATCH 1/6] Add .gitattributes file for consistent line endings and file handling --- .gitattributes | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..236146e --- /dev/null +++ b/.gitattributes @@ -0,0 +1,47 @@ +# Default behavior: +* text=auto eol=lf + +# Python files +*.py text eol=lf + +# Configuration and text files +*.toml text eol=lf +*.ini text eol=lf +*.cfg text eol=lf +*.md text eol=lf +*.txt text eol=lf +*.json text eol=lf +*.yml text eol=lf +*.yaml text eol=lf +.editorconfig text eol=lf +.gitignore text eol=lf +.gitattributes text eol=lf + +# Lock files should be treated as text with LF endings +uv.lock text eol=lf + +# Make Jupyter Notebook diffs readable +# Requires users to install nbdime (pip install nbdime) +# and run `nbdime config-git --enable --global` +*.ipynb diff=nbdime + +# Mark binary files to prevent Git from trying to change their line endings +# This prevents corruption of these files. +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.ico binary +*.pyc binary +*.so binary +*.sqlite3 binary +*.db binary +*.zip binary +*.gz binary +*.pdf binary + +# Exclude specific files/directories from git archive (e.g., when downloading a zip) +# This is great for providing students with a clean project download. +/.github export-ignore +/tests/ export-ignore +/.pytest_cache/ export-ignore \ No newline at end of file From cabe3b82b982d5f2b876f76f6c9b16fa26a3a983 Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Wed, 1 Apr 2026 13:59:02 +0300 Subject: [PATCH 2/6] Integrate Qodana configuration and GitHub Actions workflow for code quality analysis --- .github/workflows/qodana_code_quality.yml | 40 ++++++++++++++++++ qodana.yaml | 49 +++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 .github/workflows/qodana_code_quality.yml create mode 100644 qodana.yaml diff --git a/.github/workflows/qodana_code_quality.yml b/.github/workflows/qodana_code_quality.yml new file mode 100644 index 0000000..72788ec --- /dev/null +++ b/.github/workflows/qodana_code_quality.yml @@ -0,0 +1,40 @@ +#-------------------------------------------------------------------------------# +# Discover all capabilities of Qodana in our documentation # +# https://www.jetbrains.com/help/qodana/about-qodana.html # +#-------------------------------------------------------------------------------# + +name: Qodana +on: + workflow_dispatch: + pull_request: + push: + branches: + - master + - chore/versoins-bump + +jobs: + qodana: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + checks: write + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + - name: 'Qodana Scan' + uses: JetBrains/qodana-action@v2026.1 + env: + QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} + with: + # When pr-mode is set to true, Qodana analyzes only the files that have been changed + pr-mode: false + use-caches: true + post-pr-comment: true + use-annotations: true + # Upload Qodana results (SARIF, other artifacts, logs) as an artifact to the job + upload-result: false + # quick-fixes available in Ultimate and Ultimate Plus plans + push-fixes: 'none' \ No newline at end of file diff --git a/qodana.yaml b/qodana.yaml new file mode 100644 index 0000000..3d53e23 --- /dev/null +++ b/qodana.yaml @@ -0,0 +1,49 @@ +#-------------------------------------------------------------------------------# +# Qodana analysis is configured by qodana.yaml file # +# https://www.jetbrains.com/help/qodana/qodana-yaml.html # +#-------------------------------------------------------------------------------# + +################################################################################# +# WARNING: Do not store sensitive information in this file, # +# as its contents will be included in the Qodana report. # +################################################################################# +version: "1.0" + +#Specify inspection profile for code analysis +profile: + name: qodana.starter + +#Enable inspections +#include: +# - name: + +#Disable inspections +#exclude: +# - name: +# paths: +# - + +projectJDK: "17" #(Applied in CI/CD pipeline) + +#Execute shell command before Qodana execution (Applied in CI/CD pipeline) +#bootstrap: sh ./prepare-qodana.sh + +#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline) +#plugins: +# - id: #(plugin id can be found at https://plugins.jetbrains.com) + +# Quality gate. Will fail the CI/CD pipeline if any condition is not met +# severityThresholds - configures maximum thresholds for different problem severities +# testCoverageThresholds - configures minimum code coverage on a whole project and newly added code +# Code Coverage is available in Ultimate and Ultimate Plus plans +#failureConditions: +# severityThresholds: +# any: 15 +# critical: 5 +# testCoverageThresholds: +# fresh: 70 +# total: 50 + +#Qodana supports other languages, for example, Python, JavaScript, TypeScript, Go, C#, PHP +#For all supported languages see https://www.jetbrains.com/help/qodana/linters.html +linter: jetbrains/qodana-jvm-community:2026.1 From 0eeba3783d94da6486eba1af8495c881c4cff179 Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Wed, 1 Apr 2026 13:59:21 +0300 Subject: [PATCH 3/6] Update GitHub Actions workflow versions and Java configuration --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 72b8671..ff8405c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,15 +10,15 @@ jobs: name: Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: Set up JDK 17 - uses: actions/setup-java@v1 + uses: actions/setup-java@v5 with: - java-version: 17 + java-version: 25 - name: Cache SonarCloud packages - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.sonar/cache key: ${{ runner.os }}-sonar From 0dcf17219e609fdb59a368ec884573ea006f320c Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Wed, 1 Apr 2026 14:02:24 +0300 Subject: [PATCH 4/6] Downgrade Qodana GitHub Action to version 2025.3 in workflow configuration --- .github/workflows/qodana_code_quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/qodana_code_quality.yml b/.github/workflows/qodana_code_quality.yml index 72788ec..0f8b254 100644 --- a/.github/workflows/qodana_code_quality.yml +++ b/.github/workflows/qodana_code_quality.yml @@ -25,7 +25,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2026.1 + uses: JetBrains/qodana-action@v2025.3 env: QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} with: From fcf2bc6253ec6f6e4f7337e7253b5f4ef97ae53c Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Wed, 1 Apr 2026 14:03:32 +0300 Subject: [PATCH 5/6] Upgrade Gradle cache action in GitHub workflow to version v4 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ff8405c..d20a197 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - name: Cache Gradle packages - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.gradle/caches key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} From 8f0e992c0a0cf761572164d21cb86094a3758a34 Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Wed, 1 Apr 2026 14:05:43 +0300 Subject: [PATCH 6/6] Update GitHub Actions workflow to use JDK 25 with Temurin distribution --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d20a197..95a17e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,9 +13,10 @@ jobs: - uses: actions/checkout@v6 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Set up JDK 17 + - name: Set up JDK 25 uses: actions/setup-java@v5 with: + distribution: 'temurin' java-version: 25 - name: Cache SonarCloud packages uses: actions/cache@v4