Skip to content

Commit f11f40c

Browse files
committed
Format source code and run git diff instead of listing first
The diff yields more insightful results than `swift-format lint`
1 parent b639ffe commit f11f40c

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

.github/workflows/pull_request.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,30 @@ jobs:
4444
swift /tmp/cross-pr-checkout.swift "${{ github.repository }}" "${{ github.event.number }}"
4545
- name: Build
4646
run: swift build --configuration release
47+
- name: Download check format script
48+
run: |
49+
curl https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main/.github/workflows/scripts/check-swift-format.sh > /tmp/check-swift-format.sh
4750
- name: Format swift-format
48-
run: .build/release/swift-format lint --parallel --recursive --strict .
51+
run: |
52+
cd "$GITHUB_WORKSPACE"
53+
bash /tmp/check-swift-format.sh
4954
- name: Checkout swift-syntax
5055
uses: actions/checkout@v4
5156
with:
5257
repository: swiftlang/swift-syntax
5358
persist-credentials: false
5459
path: swift-syntax
5560
- name: Format swift-syntax
56-
run: .build/release/swift-format lint --parallel --recursive --strict swift-syntax
61+
run: |
62+
cd "$GITHUB_WORKSPACE/swift-syntax"
63+
bash /tmp/check-swift-format.sh
5764
- name: Checkout sourcekit-lsp
5865
uses: actions/checkout@v4
5966
with:
6067
repository: swiftlang/sourcekit-lsp
6168
persist-credentials: false
6269
path: sourcekit-lsp
6370
- name: Format sourcekit-lsp
64-
run: .build/release/swift-format lint --parallel --recursive --strict sourcekit-lsp
71+
run: |
72+
cd "$GITHUB_WORKSPACE/sourcekit-lsp"
73+
bash /tmp/check-swift-format.sh

0 commit comments

Comments
 (0)