Skip to content

Commit eee774b

Browse files
committed
chore: add swift-version
1 parent 56cfed4 commit eee774b

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.github/workflows/format.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ jobs:
1111

1212
steps:
1313
- uses: actions/checkout@v4
14+
15+
- name: Install Nick Lockwood's SwiftFormat
16+
run: brew install swiftformat
17+
1418
- name: Check formatting
1519
run: |
1620
found_issues=false
@@ -31,14 +35,15 @@ jobs:
3135
else
3236
echo "✅ All Swift files are properly formatted!"
3337
fi
38+
3439
- name: Suggest fixes (if check fails)
3540
if: failure()
3641
run: |
3742
echo "### Here's how to fix the formatting locally:" >> $GITHUB_STEP_SUMMARY
3843
echo '```bash' >> $GITHUB_STEP_SUMMARY
39-
echo "# Install swift-format if you haven't already" >> $GITHUB_STEP_SUMMARY
40-
echo "brew install swift-format" >> $GITHUB_STEP_SUMMARY
44+
echo "# Install SwiftFormat if you haven't already" >> $GITHUB_STEP_SUMMARY
45+
echo "brew install swiftformat" >> $GITHUB_STEP_SUMMARY
4146
echo "" >> $GITHUB_STEP_SUMMARY
4247
echo "# Format all Swift files" >> $GITHUB_STEP_SUMMARY
43-
echo 'find . -name "*.swift" -type f -exec swift-format format --in-place {} \;' >> $GITHUB_STEP_SUMMARY
48+
echo 'swiftformat --config .swiftformat .' >> $GITHUB_STEP_SUMMARY
4449
echo '```' >> $GITHUB_STEP_SUMMARY

.swiftformat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
--swiftversion 5.9
12
--acronyms ID,URL,UUID
23
--allman false
34
--anonymousforeach convert
@@ -63,7 +64,6 @@
6364
--tabwidth unspecified
6465
--throwcapturing
6566
--trailingclosures
66-
--trimwhitespace always
6767
--typeattributes preserve
6868
--typeblanklines remove
6969
--typemark "MARK: - %t"
@@ -83,3 +83,4 @@
8383
--disable blankLineAfterImports,unusedArguments
8484
--enable docComments
8585
--disable enumnamespaces
86+
--trimwhitespace nonblank-lines

0 commit comments

Comments
 (0)