Skip to content

Commit 7da953a

Browse files
committed
swift format
1 parent 0964a7e commit 7da953a

23 files changed

Lines changed: 166 additions & 167 deletions

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ let package = Package(
1919
.package(url: "https://github.com/tuist/XcodeProj.git", .exact("7.10.0")),
2020
.package(url: "https://github.com/jakeheis/SwiftCLI.git", from: "6.0.0"),
2121
.package(url: "https://github.com/mxcl/Version", from: "2.0.0"),
22-
.package(url: "https://github.com/SwiftDocOrg/GraphViz.git", from: "0.1.0")
22+
.package(url: "https://github.com/SwiftDocOrg/GraphViz.git", from: "0.1.0"),
2323
],
2424
targets: [
2525
.target(name: "XcodeGen", dependencies: [

Sources/ProjectSpec/GroupOrdering.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,30 @@ import JSONUtilities
33

44
/// Describes an order of groups.
55
public struct GroupOrdering: Equatable {
6-
6+
77
/// A group name pattern.
88
public var pattern: String
9-
9+
1010
/// A group name regex.
1111
public var regex: NSRegularExpression?
12-
12+
1313
/// Subgroups orders.
1414
public var order: [String]
15-
15+
1616
public init(pattern: String = "", order: [String] = []) {
1717
self.pattern = pattern
1818
self.regex = try? NSRegularExpression(pattern: pattern)
1919
self.order = order
2020
}
21-
21+
2222
}
2323

2424
extension GroupOrdering: JSONObjectConvertible {
25-
25+
2626
public init(jsonDictionary: JSONDictionary) throws {
2727
pattern = jsonDictionary.json(atKeyPath: "pattern") ?? ""
2828
regex = try? NSRegularExpression(pattern: pattern)
2929
order = jsonDictionary.json(atKeyPath: "order") ?? []
3030
}
31-
31+
3232
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import Foundation
22

33
public extension NSRegularExpression {
4-
4+
55
func isMatch(to string: String) -> Bool {
66
let range = NSRange(location: 0, length: string.utf16.count)
77
return self.firstMatch(in: string, options: [], range: range) != nil
88
}
9-
9+
1010
}

Sources/ProjectSpec/Project.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,11 @@ extension Project {
186186
}
187187
// For backward compatibility of old `localPackages:` format
188188
if let localPackages: [String] = jsonDictionary.json(atKeyPath: "localPackages") {
189-
packages.merge(localPackages.reduce(into: [String: SwiftPackage](), {
189+
packages.merge(localPackages.reduce(into: [String: SwiftPackage]()) {
190190
// Project name will be obtained by resolved abstractpath's lastComponent for dealing with some path case, like "../"
191191
let packageName = (basePath + Path($1).normalize()).lastComponent
192-
$0[packageName] = .local(path: $1) })
192+
$0[packageName] = .local(path: $1)
193+
}
193194
)
194195
}
195196
if jsonDictionary["options"] != nil {

Sources/ProjectSpec/Scheme.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public struct Scheme: Equatable {
3737
case predefined = "1"
3838
case gpx = "0"
3939
}
40-
40+
4141
public var allow: Bool
4242
public var defaultLocation: String?
4343

@@ -333,7 +333,7 @@ extension Scheme.SimulateLocation: JSONObjectConvertible {
333333
extension Scheme.SimulateLocation: JSONEncodable {
334334
public func toJSONValue() -> Any {
335335
var dict: [String: Any] = [
336-
"allow": allow
336+
"allow": allow,
337337
]
338338

339339
if let defaultLocation = defaultLocation {
@@ -367,7 +367,7 @@ extension Scheme.Run: JSONObjectConvertible {
367367
} else if let string: String = jsonDictionary.json(atKeyPath: "launchAutomaticallySubstyle") {
368368
launchAutomaticallySubstyle = string
369369
}
370-
370+
371371
if let askLaunch: Bool = jsonDictionary.json(atKeyPath: "askForAppToLaunch") {
372372
askForAppToLaunch = askLaunch
373373
}
@@ -392,7 +392,7 @@ extension Scheme.Run: JSONEncodable {
392392
if disableMainThreadChecker != Scheme.Run.disableMainThreadCheckerDefault {
393393
dict["disableMainThreadChecker"] = disableMainThreadChecker
394394
}
395-
395+
396396
if stopOnEveryMainThreadCheckerIssue != Scheme.Run.stopOnEveryMainThreadCheckerIssueDefault {
397397
dict["stopOnEveryMainThreadCheckerIssue"] = stopOnEveryMainThreadCheckerIssue
398398
}

Sources/ProjectSpec/SpecValidation.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ extension Project {
196196

197197
for scheme in schemes {
198198
errors.append(
199-
contentsOf: scheme.build.targets.compactMap({ validationError(for: $0.target, in: scheme, action: "build") })
199+
contentsOf: scheme.build.targets.compactMap { validationError(for: $0.target, in: scheme, action: "build") }
200200
)
201201
if let action = scheme.run, let config = action.config, getConfig(config) == nil {
202202
errors.append(.invalidSchemeConfig(scheme: scheme.name, config: config))
@@ -205,10 +205,10 @@ extension Project {
205205
errors.append(.invalidSchemeConfig(scheme: scheme.name, config: config))
206206
}
207207
errors.append(
208-
contentsOf: scheme.test?.targets.compactMap({ validationError(for: $0.targetReference, in: scheme, action: "test") }) ?? []
208+
contentsOf: scheme.test?.targets.compactMap { validationError(for: $0.targetReference, in: scheme, action: "test") } ?? []
209209
)
210210
errors.append(
211-
contentsOf: scheme.test?.coverageTargets.compactMap({ validationError(for: $0, in: scheme, action: "test") }) ?? []
211+
contentsOf: scheme.test?.coverageTargets.compactMap { validationError(for: $0, in: scheme, action: "test") } ?? []
212212
)
213213
if let action = scheme.profile, let config = action.config, getConfig(config) == nil {
214214
errors.append(.invalidSchemeConfig(scheme: scheme.name, config: config))

Sources/ProjectSpec/SwiftPackage.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public enum SwiftPackage: Equatable {
99

1010
case remote(url: String, versionRequirement: VersionRequirement)
1111
case local(path: String)
12-
12+
1313
public var isLocal: Bool {
1414
if case .local = self {
1515
return true
@@ -80,7 +80,7 @@ extension SwiftPackage: JSONEncodable {
8080
case .local(let path):
8181
dictionary["path"] = path
8282
}
83-
83+
8484
return dictionary
8585
}
8686
}

Sources/ProjectSpec/TargetScheme.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ extension TargetScheme: JSONEncodable {
9898
if disableMainThreadChecker != TargetScheme.disableMainThreadCheckerDefault {
9999
dict["disableMainThreadChecker"] = disableMainThreadChecker
100100
}
101-
101+
102102
if stopOnEveryMainThreadCheckerIssue != TargetScheme.stopOnEveryMainThreadCheckerIssueDefault {
103103
dict["stopOnEveryMainThreadCheckerIssue"] = stopOnEveryMainThreadCheckerIssue
104104
}

Sources/ProjectSpec/VersionExtensions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// File.swift
3-
//
3+
//
44
//
55
// Created by Yonas Kolb on 7/2/20.
66
//

Sources/XcodeGenKit/CarthageVersionLoader.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Mutex<T> {
2323
return try closure(&value)
2424
}
2525

26-
func get(closure: (inout T) -> ()) {
26+
func get(closure: (inout T) -> Void) {
2727
semaphore.wait()
2828
closure(&value)
2929
semaphore.signal()

0 commit comments

Comments
 (0)