Skip to content
Open
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
46 changes: 46 additions & 0 deletions .github/workflows/swiftformat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: SwiftFormat
on:
workflow_dispatch:
workflow_call:
inputs:
identifier:
required: true
type: string

push:
branches-ignore:
- main
- v1
- release
- release-v1

permissions:
contents: read

concurrency:
group: ${{ inputs.identifier || github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main'}}

jobs:
run-swiftformat:
runs-on: ubuntu-latest
container:
image: ghcr.io/nicklockwood/swiftformat:0.54.3
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #v3.5.3
with:
persist-credentials: false

- name: SwiftFormat
run: |
swiftformat --lint . --reporter github-actions-log --swiftversion 5.9

confirm-pass:
runs-on: macos-latest
name: Confirm Passing SwiftFormat
if: ${{ !cancelled() }}
needs: [ run-swiftformat ]
env:
EXIT_CODE: ${{ contains(needs.*.result, 'failure') && 1 || 0 }}
steps:
- run: exit $EXIT_CODE
11 changes: 8 additions & 3 deletions .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,17 @@
--enable void
--empty void

--disable wrapArguments
--closingparen same-line
--wraparguments after-first
--enable wrapArguments
--closingparen balanced
--wraparguments before-first
--wrapcollections before-first
--wrapconditions preserve

# standalone rules
--disable preferKeyPath
--disable conditionalAssignment
--disable wrapMultilineConditionalAssignment
--disable wrapMultilineStatementBraces
--disable andOperator
--disable anyObjectProtocol
--disable blankLinesAroundMark
Expand Down
Loading