Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import SwiftUI

// swiftlint:disable for_where
struct AccountPreferencesView: View {
@StateObject
private var prefs: AppPreferencesModel = .shared
Expand Down Expand Up @@ -167,11 +166,9 @@ struct AccountPreferencesView: View {
private func removeSourceControlAccount(selectedAccountId: String) {
var gitAccounts = prefs.preferences.accounts.sourceControlAccounts.gitAccount

for account in gitAccounts {
if account.id == selectedAccountId {
let index = gitAccounts.firstIndex(of: account)
gitAccounts.remove(at: index ?? 0)
}
for account in gitAccounts where account.id == selectedAccountId {
let index = gitAccounts.firstIndex(of: account)
gitAccounts.remove(at: index ?? 0)
}
}

Expand Down
4 changes: 2 additions & 2 deletions CodeEdit/Features/Documents/WorkspaceDocument+Search.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ extension WorkspaceDocument {
}

// see if the line contains search term, obeying selectedMode
// swiftlint:disable cyclomatic_complexity
// swiftlint:disable:next cyclomatic_complexity
func lineContainsSearchTerm(line rawLine: String, term searchterm: String) -> Bool {
var line = rawLine
if line.hasSuffix(" ") { line.removeLast() }
Expand Down Expand Up @@ -170,7 +170,7 @@ extension WorkspaceDocument {
return foundMatch
} else if findMode == .RegularExpression {
guard let regex = try? NSRegularExpression(pattern: searchterm) else { return false }
// swiftlint:disable legacy_constructor
// swiftlint:disable:next legacy_constructor
return regex.firstMatch(in: String(line), range: NSMakeRange(0, line.utf16.count)) != nil
}

Expand Down
2 changes: 1 addition & 1 deletion CodeEdit/Features/Feedback/FeedbackView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,12 @@ struct FeedbackView: View {
}
.padding(.top)

// swiftlint:disable line_length
VStack(alignment: .leading) {
Text("What actually happened?")
TextEditor(text: $feedbackModel.whatHappenedDescription)
.frame(minHeight: 60, alignment: .leading)
.border(Color(NSColor.separatorColor))
// swiftlint:disable:next line_length
Text("Example: The autocomplete window flickered on screen and CodeEdit crashed. See attached crashlog.")
.font(.system(size: 10))
.foregroundColor(.secondary)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class GitHubRepositories: Codable {
}
}

// swiftlint:disable line_length
extension GitHubAccount {

/**
Expand All @@ -68,7 +67,11 @@ extension GitHubAccount {
? GitHubRepositoryRouter.readRepositories(configuration, owner!, page, perPage)
: GitHubRepositoryRouter.readAuthenticatedRepositories(configuration, page, perPage)

return router.load(session, dateDecodingStrategy: .formatted(GitTime.rfc3339DateFormatter), expectedResultType: [GitHubRepositories].self) { repos, error in
return router.load(
session,
dateDecodingStrategy: .formatted(GitTime.rfc3339DateFormatter),
expectedResultType: [GitHubRepositories].self
) { repos, error in
if let error {
completion(.failure(error))
}
Expand All @@ -95,7 +98,11 @@ extension GitHubAccount {
) -> GitURLSessionDataTaskProtocol? {
let router = GitHubRepositoryRouter.readRepository(configuration, owner, name)

return router.load(session, dateDecodingStrategy: .formatted(GitTime.rfc3339DateFormatter), expectedResultType: GitHubRepositories.self) { repo, error in
return router.load(
session,
dateDecodingStrategy: .formatted(GitTime.rfc3339DateFormatter),
expectedResultType: GitHubRepositories.self
) { repo, error in
if let error {
completion(.failure(error))
} else {
Expand Down
3 changes: 2 additions & 1 deletion CodeEdit/Features/Git/Clone/GitCloneView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ extension GitCloneView {
}
}
}
// swiftlint:disable function_body_length cyclomatic_complexity

// swiftlint:disable:next function_body_length cyclomatic_complexity
private func cloneRepository() {
do {
if repoUrlStr == "" {
Expand Down
2 changes: 1 addition & 1 deletion CodeEdit/Features/SplitView/Variadic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import SwiftUI

// swiftlint:disable identifier_name
struct Helper<Result: View>: _VariadicView_UnaryViewRoot {
// swiftlint:disable:next identifier_name
var _body: (_VariadicView.Children) -> Result

func body(children: _VariadicView.Children) -> some View {
Expand Down
1 change: 0 additions & 1 deletion CodeEdit/Utils/WorkspaceClient/Interface.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ struct WorkspaceClient {
self.getFiles = getFiles
self.getFileItem = getFileItem
}
// swiftlint:enable vertical_parameter_alignment

enum WorkspaceClientError: Error {
case fileNotExist
Expand Down
6 changes: 3 additions & 3 deletions CodeEdit/Utils/WorkspaceClient/Model/FileIcon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import SwiftUI

// TODO: DOCS (Nanashi Li)
// swiftlint:disable cyclomatic_complexity
enum FileIcon {

// swiftlint:disable identifier_name
Expand Down Expand Up @@ -45,10 +44,11 @@ enum FileIcon {
case Makefile
case ts
}
// swiftlint:enable identifier_name

/// Returns a string describing a SFSymbol for files
/// If not specified otherwise this will return `"doc"`
static func fileIcon(fileType: FileType) -> String {
static func fileIcon(fileType: FileType) -> String { // swiftlint:disable:this cyclomatic_complexity
switch fileType {
case .json, .js:
return "curlybraces"
Expand Down Expand Up @@ -99,7 +99,7 @@ enum FileIcon {

/// Returns a `Color` for a specific `fileType`
/// If not specified otherwise this will return `Color.accentColor`
static func iconColor(fileType: FileType) -> Color {
static func iconColor(fileType: FileType) -> Color { // swiftlint:disable:this cyclomatic_complexity
switch fileType {
case .swift, .html:
return .orange
Expand Down