Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add formatting job in test workflow
  • Loading branch information
patrickavs committed Sep 30, 2025
commit 33dd081906239870bb61fd68632dbf79da8dc007
6 changes: 6 additions & 0 deletions .github/format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
set -e

cd ..
Copy link

Copilot AI Sep 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script changes to the parent directory with cd .., but this will likely navigate outside the repository root when executed from .github/. This should be cd "$(dirname "$0")/.." to properly navigate to the repository root relative to the script's location.

Suggested change
cd ..
cd "$(dirname "$0")/.."

Copilot uses AI. Check for mistakes.

swift format --recursive --in-place .
17 changes: 16 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,19 @@ jobs:
run: swift build -Xswiftc -warnings-as-errors --enable-experimental-prebuilts

- name: Run Tests
run: swift test -Xswiftc -warnings-as-errors --enable-experimental-prebuilts
run: swift test -Xswiftc -warnings-as-errors --enable-experimental-prebuilts
format:
runs-on: macos-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Run formatter
run: sh .github/format.sh

- name: Check if formatting changes exist
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Formatting changes detected."
exit 1
fi