Skip to content

Commit 85e4b35

Browse files
committed
Fixed some swiftlint errors
1 parent a1a7766 commit 85e4b35

File tree

65 files changed

+215
-239
lines changed

Some content is hidden

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

65 files changed

+215
-239
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ let package = Package(
2727
dependencies: [
2828
"Version-Control"
2929
]
30-
),
30+
)
3131
]
3232
)

Sources/Version-Control/Base/Actions/GitHub/GitHubActions.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ public enum GitHubViewType: String {
1414
}
1515

1616
public struct GitHubActions {
17-
17+
1818
internal func getBranchName(directoryURL: URL) throws -> String {
1919
return try Branch().getCurrentBranch(directoryURL: directoryURL)
2020
}
21-
21+
2222
internal func getCurrentRepositoryGitHubURL(directoryURL: URL) throws -> String {
2323
let remoteUrls: [GitRemote] = try Remote().getRemotes(directoryURL: directoryURL)
24-
24+
2525
for remote in remoteUrls {
2626
if remote.url.contains("github.com") {
2727
return remote.url
2828
}
2929
}
3030
return ""
3131
}
32-
32+
3333
/// Open a specific branch of a GitHub repository in a web browser.
3434
///
3535
/// This function constructs the URL for a specific branch of a GitHub repository based on the provided parameters and opens it in the default web browser.
@@ -61,10 +61,10 @@ public struct GitHubActions {
6161
}
6262

6363
let url = URL(string: "\(htmlURL)/\(viewType)/\(encodedBranchName)")
64-
64+
6565
NSWorkspace.shared.open(url!)
6666
}
67-
67+
6868
/// Open the GitHub issue creation page for the current repository in a web browser.
6969
///
7070
/// This function constructs the URL for creating a new issue in the current repository on GitHub and opens it in the default web browser.
@@ -83,9 +83,9 @@ public struct GitHubActions {
8383
/// }
8484
public func openIssueCreationOnGitHub(directoryURL: URL) throws {
8585
let repositoryURL = try getCurrentRepositoryGitHubURL(directoryURL: directoryURL)
86-
86+
8787
let url = URL(string: "\(repositoryURL)/issues/new/choose")
88-
88+
8989
NSWorkspace.shared.open(url!)
9090
}
9191
}

Sources/Version-Control/Base/Commands/Apply.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public struct Apply {
4747
let info = oldFile.stdout.split(separator: "\t",
4848
maxSplits: 1,
4949
omittingEmptySubsequences: true)[0]
50-
let components = info.split(separator: " ",
50+
let components = info.split(separator: " ",
5151
maxSplits: 3,
5252
omittingEmptySubsequences: true)
5353
let mode = components[0]

Sources/Version-Control/Base/Commands/Branch.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public struct Branch {
198198
"HEAD",
199199
"-n",
200200
"2500",
201-
"--",
201+
"--"
202202
]
203203

204204
let result = try GitShell().git(args: args,
@@ -262,7 +262,7 @@ public struct Branch {
262262
"--after=\(afterDate.timeIntervalSince1970)",
263263
"--pretty=%H %gd %gs",
264264
"--grep-reflog=checkout: moving from .* to .*$",
265-
"--",
265+
"--"
266266
]
267267

268268
let result = try GitShell().git(args: args,
@@ -307,20 +307,20 @@ public struct Branch {
307307
startPoint: String?,
308308
noTrack: Bool = false) throws {
309309
var args: [String]
310-
310+
311311
if let startPoint = startPoint {
312312
args = ["branch", name, startPoint]
313313
} else {
314314
args = ["branch", name]
315315
}
316-
316+
317317
// If we're branching directly from a remote branch, we don't want to track it
318318
// Tracking it will make the rest of the desktop think we want to push to that
319319
// remote branch's upstream (which would likely be the upstream of the fork)
320320
if noTrack {
321321
args.append("--no-track")
322322
}
323-
323+
324324
try GitShell().git(args: args,
325325
path: directoryURL,
326326
name: "createBranch")
@@ -362,12 +362,12 @@ public struct Branch {
362362
"branch",
363363
"-D",
364364
branchName]
365-
365+
366366
/// Prepare and execute the Git command to delete the local branch using a ShellClient.
367367
try GitShell().git(args: args,
368368
path: directoryURL,
369369
name: "deleteLocalBranch")
370-
370+
371371
// Return true to indicate that the branch deletion was attempted.
372372
return true
373373
}

Sources/Version-Control/Base/Commands/Checkout-Index.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Foundation
99

1010
public struct CheckoutIndex {
1111

12-
public init(){}
12+
public init() {}
1313

1414
public func checkoutIndex(directoryURL: URL,
1515
paths: [String]) async throws {

Sources/Version-Control/Base/Commands/Checkout.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public struct GitCheckout {
3434
if enableRecurseSubmodulesFlag {
3535
if branch.type == BranchType.remote {
3636
return baseArgs + [
37-
branch.name,
37+
branch.name,
3838
"-b",
3939
branch.nameWithoutRemote,
4040
"--recurse-submodules",
@@ -50,7 +50,7 @@ public struct GitCheckout {
5050
} else {
5151
if branch.type == BranchType.remote {
5252
return baseArgs + [
53-
branch.name,
53+
branch.name,
5454
"-b",
5555
branch.nameWithoutRemote,
5656
"--"

Sources/Version-Control/Base/Commands/Cherry-Pick.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,11 @@ public struct CherryPick {
161161
let headPath = directoryURL.appendingPathComponent(".git/sequencer/head").path
162162
let todoPath = directoryURL.appendingPathComponent(".git/sequencer/todo").path
163163

164-
guard let abortSafetySha = try? String(contentsOfFile: abortSafetyPath,
164+
guard let abortSafetySha = try? String(contentsOfFile: abortSafetyPath,
165165
encoding: .utf8).trimmingCharacters(in: .whitespacesAndNewlines),
166-
let headSha = try? String(contentsOfFile: headPath,
166+
let headSha = try? String(contentsOfFile: headPath,
167167
encoding: .utf8).trimmingCharacters(in: .whitespacesAndNewlines),
168-
let remainingPicks = try? String(contentsOfFile: todoPath,
168+
let remainingPicks = try? String(contentsOfFile: todoPath,
169169
encoding: .utf8).trimmingCharacters(in: .whitespacesAndNewlines) else {
170170
print("Could not read file")
171171
return nil

Sources/Version-Control/Base/Commands/Clone.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public struct Clone {
4141

4242
func clone(directoryURL: URL,
4343
path: String,
44-
options: CloneOptions,
44+
options: CloneOptions,
4545
progressCallback: ((ICloneProgress) -> Void)? = nil) async throws {
4646
// let env = try await envForRemoteOperation(options.account, url)
4747
let defaultBranch = options.defaultBranch ?? (DefaultBranch().getDefaultBranch())

Sources/Version-Control/Base/Commands/Diff-Check.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010

1111
public struct DiffCheck {
1212

13-
public init(){}
13+
public init() {}
1414

1515
/// Matches a line reporting a leftover conflict marker
1616
/// and captures the name of the file
@@ -24,7 +24,6 @@ public struct DiffCheck {
2424
path: directoryURL,
2525
name: #function,
2626
options: IGitExecutionOptions(successExitCodes: Set([0, 2])))
27-
2827

2928
let captures = Regex().getCaptures(text: output.stdout,
3029
expression: try NSRegularExpression(pattern: pattern,

Sources/Version-Control/Base/Commands/Diff.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,8 @@ public struct GitDiff {
628628
let fullPath = directoryURL.appendingPathComponent(path).path
629629
let url = try Config().getConfigValue(directoryURL: directoryURL, name: "submodule.\(path).url")
630630

631-
var oldSHA: String? = nil
632-
var newSHA: String? = nil
631+
var oldSHA: String?
632+
var newSHA: String?
633633

634634
if status.commitChanged ||
635635
file.status.kind == .new ||

0 commit comments

Comments
 (0)