diff --git a/.github/workflows/format-check-cpp.yml b/.github/workflows/format-check-cpp.yml new file mode 100644 index 000000000..0476d00b3 --- /dev/null +++ b/.github/workflows/format-check-cpp.yml @@ -0,0 +1,22 @@ +name: Check C++ Formatting + +on: + push: + workflow_dispatch: + +jobs: + check-cpp: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v3 + + - name: Setup clang-format + run: ./formatters/setup-clang-format-docker.sh + + - name: Format C++ + run: ./formatters/format-cpp.sh + + - name: Check for changes + run: | + git ls-files -m + if [[ `git ls-files -m` ]]; then echo "Detected C++ formatting errors!" & exit 1; fi \ No newline at end of file diff --git a/.github/workflows/format-check-csharp.yml b/.github/workflows/format-check-csharp.yml new file mode 100644 index 000000000..4073627b3 --- /dev/null +++ b/.github/workflows/format-check-csharp.yml @@ -0,0 +1,24 @@ +name: Check C# Formatting + +on: + push: + workflow_dispatch: + +jobs: + check-csharp: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v3 + + - name: Install dotnet + uses: actions/setup-dotnet@v3 + with: + dotnet-version: "8.0.x" + + - name: Format C# + run: ./formatters/format-csharp.sh + + - name: Check for changes + run: | + git ls-files -m + if [[ `git ls-files -m` ]]; then echo "Detected C# formatting errors!" & exit 1; fi \ No newline at end of file diff --git a/.github/workflows/format-check-dart.yml b/.github/workflows/format-check-dart.yml new file mode 100644 index 000000000..c88e6c225 --- /dev/null +++ b/.github/workflows/format-check-dart.yml @@ -0,0 +1,28 @@ +name: Check Dart Formatting + +on: + push: + workflow_dispatch: + +jobs: + check-dart: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v3 + + - name: Install Dart + uses: dart-lang/setup-dart@v1 + with: + sdk: '3.8.1' + + - name: Check dart format version + run: | + dart format --version + + - name: Format Dart + run: ./formatters/format-dart.sh + + - name: Check for changes + run: | + git ls-files -m + if [[ `git ls-files -m` ]]; then echo "Detected Dart formatting errors!" & exit 1; fi \ No newline at end of file diff --git a/.github/workflows/format-check-haxe.yml b/.github/workflows/format-check-haxe.yml new file mode 100644 index 000000000..e6ccf8ca7 --- /dev/null +++ b/.github/workflows/format-check-haxe.yml @@ -0,0 +1,25 @@ +name: Check Haxe Formatting + +on: + push: + workflow_dispatch: + +jobs: + check-haxe: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v3 + + - name: Install Haxe + uses: krdlab/setup-haxe@v1 + with: + haxe-version: '4.3.2' + - run: haxelib install formatter + + - name: Format Haxe + run: ./formatters/format-haxe.sh + + - name: Check for changes + run: | + git ls-files -m + if [[ `git ls-files -m` ]]; then echo "Detected Haxe formatting errors!" & exit 1; fi \ No newline at end of file diff --git a/.github/workflows/format-check-java.yml b/.github/workflows/format-check-java.yml new file mode 100644 index 000000000..afb5fa7eb --- /dev/null +++ b/.github/workflows/format-check-java.yml @@ -0,0 +1,25 @@ +name: Check Java Formatting + +on: + push: + workflow_dispatch: + +jobs: + check-java: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v3 + + - name: Install JDK + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: "16" + + - name: Format Java + run: ./formatters/format-java.sh + + - name: Check for changes + run: | + git ls-files -m + if [[ `git ls-files -m` ]]; then echo "Detected Java formatting errors!" & exit 1; fi \ No newline at end of file diff --git a/.github/workflows/format-check-typescript.yml b/.github/workflows/format-check-typescript.yml new file mode 100644 index 000000000..2a1a3f266 --- /dev/null +++ b/.github/workflows/format-check-typescript.yml @@ -0,0 +1,24 @@ +name: Check TypeScript Formatting + +on: + push: + workflow_dispatch: + +jobs: + check-typescript: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v3 + + - name: Install Node and dependencies + uses: actions/setup-node@v3 + with: + node-version: "24" + + - name: Format TypeScript + run: ./formatters/format-ts.sh + + - name: Check for changes + run: | + git ls-files -m + if [[ `git ls-files -m` ]]; then echo "Detected TypeScript formatting errors!" & exit 1; fi \ No newline at end of file diff --git a/.github/workflows/format-check.yml b/.github/workflows/format-check.yml index 2a781ed32..5fa7cee1b 100644 --- a/.github/workflows/format-check.yml +++ b/.github/workflows/format-check.yml @@ -1,4 +1,4 @@ -name: Check Formatting +name: Check All Formatting (Combined) on: push: diff --git a/.github/workflows/format-debug.yml b/.github/workflows/format-debug.yml deleted file mode 100644 index 222f30a08..000000000 --- a/.github/workflows/format-debug.yml +++ /dev/null @@ -1,90 +0,0 @@ -name: Debug Formatting Issues - -on: - workflow_dispatch: - -jobs: - debug: - runs-on: ubuntu-24.04 - steps: - - - uses: actions/checkout@v3 - - - name: Setup clang-format - run: ./formatters/setup-clang-format-docker.sh - - - name: Install dotnet - uses: actions/setup-dotnet@v3 - with: - dotnet-version: "8.0.x" - - - name: Install Node and dependencies - uses: actions/setup-node@v3 - with: - node-version: "24" - - - name: Install JDK - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: "16" - - - name: Install Haxe - uses: krdlab/setup-haxe@v1 - with: - haxe-version: '4.3.2' - - run: haxelib install formatter - - - name: Install Dart - uses: dart-lang/setup-dart@v1 - with: - sdk: '3.8.1' - - - name: Show environment info - run: | - echo "=== Dart Version ===" - dart --version - echo "=== Dart Format Version ===" - dart format --version - echo "=== Git Status Before ===" - git status --porcelain - echo "=== OS Info ===" - uname -a - lsb_release -a - - - name: Show specific Flutter files before formatting - run: | - echo "=== Sample Flutter files before formatting ===" - head -10 spine-flutter/lib/extensions.dart || echo "File not found" - head -10 spine-flutter/lib/spine_dart.dart || echo "File not found" - - - name: Run Dart formatter only - run: | - echo "=== Running Dart formatter ===" - ./formatters/format-dart.sh - echo "=== Git status after Dart formatting ===" - git status --porcelain - echo "=== Modified files ===" - git ls-files -m - - - name: Show diff for first few files - run: | - echo "=== Showing diffs for first 3 modified files ===" - for file in $(git ls-files -m | head -3); do - echo "--- Diff for $file ---" - git diff "$file" | head -50 - echo "" - done - - - name: Archive all diffs - run: | - git diff > all-format-diffs.txt - git status --porcelain > git-status.txt - - - name: Upload debug artifacts - uses: actions/upload-artifact@v4 - with: - name: format-debug-artifacts - path: | - all-format-diffs.txt - git-status.txt \ No newline at end of file