Skip to content

Commit a384d20

Browse files
Merge pull request #6 from GraphQLSwift/feat/swift-format
Converts to swift-format
2 parents 96d80df + 7736039 commit a384d20

File tree

4 files changed

+20
-11
lines changed

4 files changed

+20
-11
lines changed

.github/workflows/lint.yaml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,20 @@ on:
66
package_path:
77
type: string
88
required: false
9-
default: ''
9+
default: './'
1010
description: "Specifies a subpath of the checkout that the package is contained in."
1111

1212
jobs:
1313
format:
1414
name: Format linting
1515
runs-on: ubuntu-latest
16+
container: swift:latest
1617
steps:
17-
- name: Checkout
18-
uses: actions/checkout@v4
19-
- name: Set up Docker Buildx
20-
uses: docker/setup-buildx-action@v3
21-
- name: Pull formatting docker image
22-
run: docker pull ghcr.io/nicklockwood/swiftformat:latest
23-
- name: Run format linting
24-
run: docker run --rm -v ${{ github.workspace }}:/repo ghcr.io/nicklockwood/swiftformat:latest /repo/${{ inputs.package_path }} --lint
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
- name: Format
21+
run: |
22+
swift format lint \
23+
--parallel \
24+
--recursive \
25+
${{ inputs.package_path != './' && inputs.package_path || './' }}

WorkflowTestPackage/.swift-format

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"version": 1,
3+
"indentation" : {
4+
"spaces" : 4
5+
},
6+
"lineBreakBeforeEachArgument": true
7+
}

WorkflowTestPackage/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ let package = Package(
88
.library(
99
name: "WorkflowTestPackage",
1010
targets: ["WorkflowTestPackage"]
11-
),
11+
)
1212
],
1313
targets: [
1414
// Targets are the basic building blocks of a package, defining a module or a test suite.

WorkflowTestPackage/Tests/WorkflowTestPackageTests/WorkflowTestPackageTests.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
@testable import WorkflowTestPackage
21
import XCTest
32

3+
@testable import WorkflowTestPackage
4+
45
class WorkflowTestPackageTests: XCTestCase {
56
func testHello() {
67
XCTAssertEqual(WorkflowTest().hello(), "world")

0 commit comments

Comments
 (0)