Skip to content

Commit c330b9d

Browse files
tomerdktoso
authored andcommitted
standardize formatting (#3)
motivation: prepare for CI changes: * add default swiftformat settings and apply them * update linux generation script to conform to formatting rules
1 parent ff11368 commit c330b9d

File tree

274 files changed

+7197
-7212
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

274 files changed

+7197
-7212
lines changed

.swiftformat

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# file options
2+
3+
--exclude .build
4+
5+
# format options
6+
7+
--self insert
8+
--patternlet inline
9+
--stripunusedargs unnamed-only
10+
--comments ignore
11+
--ifdef no-indent
12+
13+
# rules

IntegrationTests/tests_01_actor/test_01_resources/shared.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import Foundation
1615
import DistributedActors
16+
import Foundation
1717

1818
// Just consume the argument.
1919
// It's important that this function is in another module than the tests
2020
// which are using it.
2121
@inline(never)
22-
public func blackHole<T>(_ x: T) {
23-
}
22+
public func blackHole<T>(_: T) {}
2423

2524
// Return the passed argument without letting the optimizer know that.
2625
@inline(never)

IntegrationTests/tests_01_actor/test_01_resources/test_002_actor_spawn_100.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@
1414

1515
import DistributedActors
1616

17-
1817
func run(identifier: String) {
1918
let system = ActorSystem("\(identifier)")
2019

2120
measure(identifier: identifier) {
2221
var i = 0
23-
for _ in 0..<100 {
22+
for _ in 0 ..< 100 {
2423
let _: ActorRef<String> = try! system.spawn(.anonymous, .ignore)
2524
i += 1
2625
}

IntegrationTests/tests_01_actor/test_01_resources/test_003_actor_spawn_1000.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@
1414

1515
import DistributedActors
1616

17-
1817
func run(identifier: String) {
1918
let system = ActorSystem("\(identifier)")
2019

2120
measure(identifier: identifier) {
2221
var i = 0
23-
for _ in 0..<1000 {
22+
for _ in 0 ..< 1000 {
2423
let _: ActorRef<String> = try! system.spawn(.anonymous, .ignore)
2524
i += 1
2625
}

IntegrationTests/tests_01_actor/test_01_resources/todo_test_004_actor_pingPong_1000.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@
1414

1515
import DistributedActors
1616

17-
1817
func run(identifier: String) {
1918
let system = ActorSystem("\(identifier)")
2019

2120
measure(identifier: identifier) {
22-
// TODO replicate ping pong benchmark here, so we know how much a message send allocates
21+
// TODO: replicate ping pong benchmark here, so we know how much a message send allocates
2322
}
2423

2524
system.shutdown()

Package.swift

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,17 @@ let targets: [PackageDescription.Target] = [
1515
"DistributedActorsConcurrencyHelpers",
1616
"CDistributedActorsMailbox",
1717
"CDistributedActorsRunQueue",
18-
"SwiftProtobuf"
18+
"SwiftProtobuf",
1919
]
2020
),
2121

2222
.target(
2323
name: "DistributedActorsSampleProcessIsolated",
2424
dependencies: [
25-
"DistributedActors"
25+
"DistributedActors",
2626
]
2727
),
2828

29-
3029
/// This target is intended only for use in tests, though we have no way to mark this
3130
.target(
3231
name: "DistributedActorsTestKit",
@@ -45,8 +44,7 @@ let targets: [PackageDescription.Target] = [
4544

4645
// NOT SUPPORTED transient library until Swift receives Atomics
4746
.target(name: "CDistributedActorsAtomics",
48-
dependencies: []
49-
),
47+
dependencies: []),
5048

5149
// NOT SUPPORTED transient library until Swift receives Atomics
5250
.target(
@@ -79,8 +77,8 @@ let targets: [PackageDescription.Target] = [
7977
.target(
8078
name: "DistributedActorsBenchmarks",
8179
dependencies: [
82-
"DistributedActors",
83-
"SwiftBenchmarkTools"
80+
"DistributedActors",
81+
"SwiftBenchmarkTools",
8482
]
8583
),
8684
.target(
@@ -105,15 +103,15 @@ let targets: [PackageDescription.Target] = [
105103
.testTarget(
106104
name: "DistributedActorsDocumentationTests",
107105
dependencies: ["DistributedActors", "DistributedActorsTestKit"]
108-
)
106+
),
109107
]
110108

111109
let dependencies: [Package.Dependency] = [
112-
.package(url: "https://github.com/apple/swift-nio.git", from: "2.7.0"),
110+
.package(url: "https://github.com/apple/swift-nio.git", from: "2.7.0"),
113111
.package(url: "https://github.com/apple/swift-nio-extras.git", from: "1.2.0"),
114-
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.2.0"),
115-
.package(url: "https://github.com/apple/swift-protobuf.git", from: "1.4.0"),
116-
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
112+
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.2.0"),
113+
.package(url: "https://github.com/apple/swift-protobuf.git", from: "1.4.0"),
114+
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
117115
]
118116

119117
let package = Package(

0 commit comments

Comments
 (0)