Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
22 changes: 22 additions & 0 deletions .github/workflows/swiftfmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Swift format
on:
push:
branches:
- main
pull_request:
paths:
- '.github/workflows/swiftfmt.yml'
- '**.swift'
jobs:
swiftfmt:
name: Run swift format
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
show-progress: false

# Re-enable in follow-up PR that does the formatting.
# - name: Check formating
# run: swiftformat --lint . --reporter github-actions-log
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
Install all of the following things:

- [`xcode`](https://apps.apple.com/us/app/xcode/)
- [`swiftformat`](https://github.com/nicklockwood/SwiftFormat)
- [`android-studio`](https://developer.android.com/studio)
- [`flutter` 3.29.0](https://docs.flutter.dev/get-started/install)
- [`gomobile`](https://pkg.go.dev/golang.org/x/mobile/cmd/gomobile)
Expand Down Expand Up @@ -41,6 +42,10 @@ dart format lib/ test/ -l 120

In Android Studio, set the line length using Preferences -> Editor -> Code Style -> Dart -> Line length, set it to 120. Enable auto-format with Preferences -> Languages & Frameworks -> Flutter -> Format code on save.

`swiftformat .` can be used to format the `*.swift` code in the repo.

There are several options for editor integrations listed in the source repo: <https://github.com/nicklockwood/SwiftFormat>


# Release

Expand Down
2 changes: 2 additions & 0 deletions ios/.swiftformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--swiftversion 5
--exclude Pods,Generated
3 changes: 3 additions & 0 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
Expand Down Expand Up @@ -772,6 +773,7 @@
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand Down Expand Up @@ -825,6 +827,7 @@
SUPPORTED_PLATFORMS = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
Expand Down