From 5ac35bb37049d3cdc316ce82debd0d4c863dbd53 Mon Sep 17 00:00:00 2001 From: DragonSlayer_14 Date: Sun, 13 Sep 2026 00:20:01 +0200 Subject: [PATCH] =?UTF-8?q?Feat:=20F=C3=BCgt=20code-quality-Workflow=20f?= =?UTF-8?q?=C3=BCr=20automatische=20Formatierung=20und=20fixes=20hinzu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Introduced `code-quality.yaml` to automate Rust code formatting and Clippy fixes in the `dev` branch. - Updated `jsonSchemas.xml` to include schema paths for new Gitea workflows. --- .gitea/workflows/code-quality.yaml | 54 ++++++++++++++++++++++++++++++ .idea/jsonSchemas.xml | 3 ++ 2 files changed, 57 insertions(+) create mode 100644 .gitea/workflows/code-quality.yaml diff --git a/.gitea/workflows/code-quality.yaml b/.gitea/workflows/code-quality.yaml new file mode 100644 index 0000000..8c35d11 --- /dev/null +++ b/.gitea/workflows/code-quality.yaml @@ -0,0 +1,54 @@ +name: Code Quality (Auto-Format & Clippy-Fix) + +on: + push: + branches: + - dev + workflow_dispatch: + +jobs: + fix: + name: Formatierung & Clippy automatisch beheben + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v7 + with: + ref: ${{ gitea.ref_name || github.ref_name }} + token: ${{ secrets.PACKAGE_TOKEN || secrets.RELEASE_TOKEN || secrets.PUBLISH_TOKEN || secrets.API_TOKEN || secrets.PAT_TOKEN || secrets.CUSTOM_TOKEN || secrets.GITEA_TOKEN || secrets.GITHUB_TOKEN || github.token }} + + - name: Install Rust Toolchain + uses: actions-rust-lang/setup-rust-toolchain@v2 + with: + toolchain: stable + components: clippy, rustfmt + cache: false + + - name: Cache Cargo-Abhängigkeiten & Build-Artefakte + uses: actions/cache@v6 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: cargo-${{ runner.os }}-${{ hashFiles('Cargo.lock') }} + restore-keys: | + cargo-${{ runner.os }}- + + - name: Formatierung automatisch beheben + run: cargo fmt + + - name: Clippy-Fixes automatisch anwenden + run: cargo clippy --fix --allow-dirty --allow-staged --all-targets + + - name: Änderungen committen & pushen + run: | + if [ -n "$(git status --porcelain)" ]; then + git config user.name "Gitea-Bot" + git config user.email "no-reply@creativedragonslayer.de" + git add -A + git commit -m "Style: Automatische Formatierung & Clippy-Fixes" + git push origin HEAD:${{ gitea.ref_name || github.ref_name }} + else + echo "Keine Formatierungs- oder Clippy-Änderungen." + fi diff --git a/.idea/jsonSchemas.xml b/.idea/jsonSchemas.xml index 2c9f918..2ed321d 100644 --- a/.idea/jsonSchemas.xml +++ b/.idea/jsonSchemas.xml @@ -26,6 +26,9 @@ + +