Skip to content

Commit d7968a8

Browse files
committed
swiftformat
1 parent ac0273d commit d7968a8

File tree

3 files changed

+34
-131
lines changed

3 files changed

+34
-131
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: SwiftFormat Check
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
pull_request:
8+
branches:
9+
- '**'
10+
11+
jobs:
12+
format-check:
13+
name: SwiftFormat Check
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Install SwiftFormat
21+
run: |
22+
wget -O swiftformat.zip https://github.com/nicklockwood/SwiftFormat/archive/0.55.6.zip
23+
unzip swiftformat.zip
24+
cd SwiftFormat-0.55.6
25+
swift build -c release
26+
sudo cp .build/release/swiftformat /usr/local/bin/
27+
28+
- name: Check if SwiftFormat has been run
29+
run: |
30+
swiftformat --lint --config .swiftformat Split
31+
if [ $? -ne 0 ]; then
32+
echo "::error::SwiftFormat check failed. Please run SwiftFormat locally before pushing."
33+
exit 1
34+
fi

.github/workflows/swiftlint.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.swiftlint.yml

Lines changed: 0 additions & 108 deletions
This file was deleted.

0 commit comments

Comments
 (0)