diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 0000000..cdabaa6 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,21 @@ +name: SwiftFormat +on: + push: + branches: + - main +jobs: + format: + name: SwiftFormat + runs-on: macOS-latest + steps: + - uses: actions/checkout@v2 + - name: Install + run: brew install swiftformat + - name: Format + run: make format + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: Run swiftformat + branch: 'main' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Makefile b/Makefile index fb136a5..09a7517 100644 --- a/Makefile +++ b/Makefile @@ -14,3 +14,8 @@ test: xcodebuild \ -scheme AdaptiveCardUI_watchOS \ -destination '$(DESTINATION_WATCHOS)' + +format: + swiftformat . + +.PHONY: format diff --git a/Tests/AdaptiveCardUITests/UI/ActionRenderingTests.swift b/Tests/AdaptiveCardUITests/UI/ActionRenderingTests.swift index 0af1658..3e5ebf7 100644 --- a/Tests/AdaptiveCardUITests/UI/ActionRenderingTests.swift +++ b/Tests/AdaptiveCardUITests/UI/ActionRenderingTests.swift @@ -1,7 +1,7 @@ #if os(iOS) && canImport(SwiftUI) +import SwiftUI import SnapshotTesting - import SwiftUI import XCTest import AdaptiveCardUI