Skip to content

Commit f0f250f

Browse files
authored
Running swift format on the whole project (#42)
Co-authored-by: Alex Guretzki <[email protected]>
1 parent 75249fd commit f0f250f

File tree

69 files changed

+460
-136
lines changed

Some content is hidden

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

69 files changed

+460
-136
lines changed

Sources/ExecutableTargets/CommandLineTool/CommandLineTool+Extensions.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1+
//
2+
// Copyright (c) 2024 Adyen N.V.
3+
//
4+
// This file is open source and available under the MIT license. See the LICENSE file for more info.
5+
//
6+
17
import ArgumentParser
28

3-
import PADSwiftInterfaceFileLocator
49
import PADLogging
10+
import PADSwiftInterfaceFileLocator
511

612
extension SwiftInterfaceType: ExpressibleByArgument {
713
public init?(argument: String) {

Sources/ExecutableTargets/CommandLineTool/CommandLineTool.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import Foundation
1010
import PADCore
1111
import PADLogging
1212

13-
import PADSwiftInterfaceDiff
14-
import PADProjectBuilder
1513
import PADOutputGenerator
1614
import PADPackageFileAnalyzer
15+
import PADProjectBuilder
16+
import PADSwiftInterfaceDiff
1717

1818
@main
1919
struct PublicApiDiff: AsyncParsableCommand {

Sources/ExecutableTargets/CommandLineTool/FrameworkToOutputCommand.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1+
//
2+
// Copyright (c) 2024 Adyen N.V.
3+
//
4+
// This file is open source and available under the MIT license. See the LICENSE file for more info.
5+
//
6+
17
import ArgumentParser
28
import Foundation
39

410
import PADCore
511
import PADLogging
612

7-
import PADSwiftInterfaceDiff
8-
import PADSwiftInterfaceFileLocator
913
import PADOutputGenerator
1014
import PADPackageFileAnalyzer
15+
import PADSwiftInterfaceDiff
16+
import PADSwiftInterfaceFileLocator
1117

1218
/// Command that analyzes the differences between an old and new project and produces a human readable output
1319
struct FrameworkToOutputCommand: AsyncParsableCommand {

Sources/ExecutableTargets/CommandLineTool/ProjectToOutputCommand.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1+
//
2+
// Copyright (c) 2024 Adyen N.V.
3+
//
4+
// This file is open source and available under the MIT license. See the LICENSE file for more info.
5+
//
6+
17
import ArgumentParser
28
import Foundation
39

410
import PADCore
511
import PADLogging
612
import PADSwiftInterfaceFileLocator
713

8-
import PADSwiftInterfaceDiff
9-
import PADProjectBuilder
1014
import PADOutputGenerator
1115
import PADPackageFileAnalyzer
16+
import PADProjectBuilder
17+
import PADSwiftInterfaceDiff
1218

1319
/// Command that analyzes the differences between an old and new project and produces a human readable output
1420
struct ProjectToOutputCommand: AsyncParsableCommand {
@@ -168,7 +174,7 @@ private extension ProjectToOutputCommand {
168174
case .xcodeProject:
169175
warnings = []
170176
changes = []
171-
break // Nothing to do
177+
// Nothing to do
172178
}
173179
}
174180

Sources/ExecutableTargets/CommandLineTool/SwiftInterfaceToOutputCommand.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1+
//
2+
// Copyright (c) 2024 Adyen N.V.
3+
//
4+
// This file is open source and available under the MIT license. See the LICENSE file for more info.
5+
//
6+
17
import ArgumentParser
28
import Foundation
39

410
import PADCore
511
import PADLogging
612

7-
import PADSwiftInterfaceDiff
8-
import PADProjectBuilder
913
import PADOutputGenerator
1014
import PADPackageFileAnalyzer
15+
import PADProjectBuilder
16+
import PADSwiftInterfaceDiff
1117

1218
/// Command that analyzes the differences between an old and new `.swiftinterface` file and produces a human readable output
1319
struct SwiftInterfaceToOutputCommand: AsyncParsableCommand {

Sources/PublicModules/PADOutputGenerator/MarkdownOutputGenerator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public struct MarkdownOutputGenerator: OutputGenerating {
2525
let changes = Self.changeLines(changesPerModule: changesPerTarget)
2626

2727
var lines = [
28-
Self.title(changesPerTarget: changesPerTarget),
28+
Self.title(changesPerTarget: changesPerTarget)
2929
]
3030

3131
if let oldVersionName, let newVersionName {

Sources/PublicModules/PADPackageFileAnalyzer/SwiftPackageFileAnalyzing.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
//
2+
// Copyright (c) 2024 Adyen N.V.
3+
//
4+
// This file is open source and available under the MIT license. See the LICENSE file for more info.
5+
//
6+
17
import Foundation
28
import PADCore
39

Sources/PublicModules/PADProjectBuilder/ProjectBuilder.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1+
//
2+
// Copyright (c) 2024 Adyen N.V.
3+
//
4+
// This file is open source and available under the MIT license. See the LICENSE file for more info.
5+
//
6+
17
import Foundation
28

3-
import PADLogging
49
import PADCore
10+
import PADLogging
511
import PADSwiftInterfaceFileLocator
612

7-
import ShellModule
813
import FileHandlingModule
14+
import ShellModule
915

1016
/// The ``PADProjectBuilder/ProjectBuilder`` builds the old & new project and outputs a list
1117
/// of ``PADCore/SwiftInterfaceFile``s as well as changes that happened to the

Sources/PublicModules/PADProjectBuilder/ProjectSetup/Git.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
//
2+
// Copyright (c) 2024 Adyen N.V.
3+
//
4+
// This file is open source and available under the MIT license. See the LICENSE file for more info.
5+
//
6+
17
import Foundation
28

39
import PADCore

Sources/PublicModules/PADProjectBuilder/ProjectSetup/ProjectSetupHelper.swift

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
//
2+
// Copyright (c) 2024 Adyen N.V.
3+
//
4+
// This file is open source and available under the MIT license. See the LICENSE file for more info.
5+
//
6+
17
import Foundation
28

39
import PADCore
410
import PADLogging
511

6-
import ShellModule
712
import FileHandlingModule
13+
import ShellModule
814

915
/// Helps setting up the project by:
1016
/// - Copying project files into a working directory (and skipping unwanted files)
@@ -38,9 +44,9 @@ struct ProjectSetupHelper: ProjectSetupHelping {
3844
try await Task {
3945
let checkoutPath = workingDirectoryPath + "\(randomStringGenerator.generateRandomString())"
4046
switch projectSource {
41-
case .local(let path):
47+
case let .local(path):
4248
shell.execute("cp -a '\(path)' '\(checkoutPath)'")
43-
case .git(let branch, let repository):
49+
case let .git(branch, repository):
4450
let git = Git(shell: shell, fileHandler: fileHandler, logger: logger)
4551
try git.clone(repository, at: branch, targetDirectoryPath: checkoutPath)
4652
}
@@ -84,10 +90,10 @@ private extension ProjectType {
8490

8591
var excludedFileSuffixes: [String] {
8692
switch self {
87-
case .swiftPackage:
88-
[".xcodeproj", ".xcworkspace"]
89-
case .xcodeProject:
90-
["Package.swift"]
93+
case .swiftPackage:
94+
[".xcodeproj", ".xcworkspace"]
95+
case .xcodeProject:
96+
["Package.swift"]
9197
}
9298
}
9399

0 commit comments

Comments
 (0)