Skip to content

Commit eb343c9

Browse files
committed
Add swift format rules
1 parent fdbf819 commit eb343c9

File tree

7 files changed

+42
-21
lines changed

7 files changed

+42
-21
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ repos:
2222
hooks:
2323
- id: swift-format
2424
name: swift-format
25-
entry: swift-format
25+
entry: swift-format format --in-place --recursive .
2626
language: system
2727
types: [swift]
2828
files: \.swift$

.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+
"spacesAroundRangeFormationOperators": true
7+
}

Package.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ let package = Package(
1616
targets: ["DiffusionKit"]
1717
),
1818
.library(
19-
name: "DiffusionKitMLX",
20-
targets: ["DiffusionKitMLX"]
19+
name: "DiffusionKitMLX",
20+
targets: ["DiffusionKitMLX"]
2121
),
2222
],
2323
dependencies: [
@@ -29,7 +29,7 @@ let package = Package(
2929
.target(
3030
name: "DiffusionKit",
3131
dependencies: [
32-
.product(name: "Transformers", package: "swift-transformers"),
32+
.product(name: "Transformers", package: "swift-transformers")
3333
],
3434
path: "swift/Sources/DiffusionKit"
3535
),
@@ -58,6 +58,6 @@ let package = Package(
5858
.product(name: "Transformers", package: "swift-transformers"),
5959
],
6060
path: "swift/Tests/DiffusionKitMLXTests"
61-
)
61+
),
6262
]
6363
)
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1-
// The Swift Programming Language
2-
// https://docs.swift.org/swift-book
1+
// For licensing see accompanying LICENSE.md file.
2+
// Copyright © 2024 Argmax, Inc. All rights reserved.
3+
4+
open class DiffusionKit {
5+
init() {
6+
print("DiffusionKit initialized")
7+
}
8+
}
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1-
// The Swift Programming Language
2-
// https://docs.swift.org/swift-book
1+
// For licensing see accompanying LICENSE.md file.
2+
// Copyright © 2024 Argmax, Inc. All rights reserved.
3+
4+
open class DiffusionKitMLX {
5+
init() {
6+
print("DiffusionKitMLX initialized")
7+
}
8+
}
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
// For licensing see accompanying LICENSE.md file.
2+
// Copyright © 2024 Argmax, Inc. All rights reserved.
3+
14
import XCTest
5+
26
@testable import DiffusionKitMLX
37

48
final class DiffusionKitMLXTests: XCTestCase {
5-
func testExample() throws {
6-
// XCTest Documentation
7-
// https://developer.apple.com/documentation/xctest
8-
9-
// Defining Test Cases and Test Methods
10-
// https://developer.apple.com/documentation/xctest/defining_test_cases_and_test_methods
9+
func testInit() throws {
10+
let diffusionKitMLX = DiffusionKitMLX()
11+
XCTAssertNotNil(diffusionKitMLX)
1112
}
1213
}
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
// For licensing see accompanying LICENSE.md file.
2+
// Copyright © 2024 Argmax, Inc. All rights reserved.
3+
14
import XCTest
5+
26
@testable import DiffusionKit
37

48
final class DiffusionKitTests: XCTestCase {
5-
func testExample() throws {
6-
// XCTest Documentation
7-
// https://developer.apple.com/documentation/xctest
8-
9-
// Defining Test Cases and Test Methods
10-
// https://developer.apple.com/documentation/xctest/defining_test_cases_and_test_methods
9+
func testInit() throws {
10+
let diffusionKit = DiffusionKit()
11+
XCTAssertNotNil(diffusionKit)
1112
}
1213
}

0 commit comments

Comments
 (0)