Fix various SwiftLint warnings.

This commit is contained in:
Brent Simmons committed 2026-01-01 15:38:51 -08:00
1 parent ccf81a15d4
commit 36cb48bae3
11 files changed
+15 -27

No files matched your search

+3 -3
View File
@@ -31,7 +31,7 @@ extension Notification.Name {
private var remainingFaviconURLs = [String: ArraySlice<String>]() // homePageURL: array of faviconURLs that haven't been checked yet
private var currentHomePageHasOnlyFaviconICO = false
private var homePageToFaviconURLCache = [String: String]() //homePageURL: faviconURL
private var homePageToFaviconURLCache = [String: String]() // homePageURL: faviconURL
private var homePageToFaviconURLCachePath: String
private var homePageToFaviconURLCacheDirty = false {
didSet {
@@ -143,7 +143,7 @@ extension Notification.Name {
self.currentHomePageHasOnlyFaviconICO = faviconURLs.count == 1
if let firstIconURL = faviconURLs.first {
let _ = self.favicon(with: firstIconURL, homePageURL: url)
_ = self.favicon(with: firstIconURL, homePageURL: url)
self.remainingFaviconURLs[url] = faviconURLs.dropFirst()
}
}
@@ -164,7 +164,7 @@ extension Notification.Name {
guard let _ = singleFaviconDownloader.iconImage else {
if let faviconURLs = remainingFaviconURLs[homePageURL] {
if let nextIconURL = faviconURLs.first {
let _ = favicon(with: nextIconURL, homePageURL: singleFaviconDownloader.homePageURL)
_ = favicon(with: nextIconURL, homePageURL: singleFaviconDownloader.homePageURL)
remainingFaviconURLs[homePageURL] = faviconURLs.dropFirst()
} else {
remainingFaviconURLs[homePageURL] = nil
@@ -121,8 +121,7 @@ private extension SingleFaviconDownloader {
Task { @MainActor in
self.diskStatus = .onDisk
}
}
catch {}
} catch {}
}
}
+1 -3
View File
@@ -15,7 +15,6 @@ import UIKit
#endif
enum AddCloudKitAccountError: LocalizedError, RecoverableError, Sendable {
case iCloudDriveMissing
var errorDescription: String? {
@@ -46,13 +45,12 @@ enum AddCloudKitAccountError: LocalizedError, RecoverableError, Sendable {
Task { @MainActor in
AddCloudKitAccountUtilities.openiCloudSettings()
}
return true
}
}
struct AddCloudKitAccountUtilities {
static var isiCloudDriveEnabled: Bool {
FileManager.default.ubiquityIdentityToken != nil
}
@@ -173,7 +173,7 @@ final class ExtensionFeedAddRequestFile: NSObject, NSFilePresenter, Sendable {
return
}
var destinationContainer: Container? = nil
var destinationContainer: Container?
if account.containerID == request.destinationContainerID {
destinationContainer = account
} else {
@@ -11,23 +11,19 @@ import Account
import RSCore
@MainActor @objc final class SmartFeedPasteboardWriter: NSObject, @MainActor NSPasteboardWriting {
private let smartFeed: PseudoFeed
init(smartFeed: PseudoFeed) {
self.smartFeed = smartFeed
}
// MARK: - NSPasteboardWriting
func writableTypes(for pasteboard: NSPasteboard) -> [NSPasteboard.PasteboardType] {
return [.string]
[.string]
}
func pasteboardPropertyList(forType type: NSPasteboard.PasteboardType) -> Any? {
let plist: Any?
switch type {
@@ -40,4 +36,3 @@ import RSCore
return plist
}
}
@@ -12,7 +12,6 @@ import Articles
import Account
@MainActor final class SidebarTreeControllerDelegate: TreeControllerDelegate {
private var filterExceptions = Set<SidebarItemIdentifier>()
var isReadFiltered = false
@@ -36,7 +35,7 @@ import Account
}
return nil
}
}
}
private extension SidebarTreeControllerDelegate {
@@ -35,7 +35,7 @@ class AppleScriptXCTestCase: XCTestCase {
}
let scriptResult = testScript.executeAndReturnError(&errorDict)
if (errorDict != nil) {
if errorDict != nil {
print ("error is \(String(describing: errorDict))")
XCTFail("Failed executing script")
return nil
@@ -27,13 +27,13 @@ extension NSAppleEventDescriptor {
return [:]
}
let listCount = usrfList.numberOfItems
guard (listCount%2 == 0) else {
guard listCount % 2 == 0 else {
print ("error: usrfDictionary() expected even number of items in usrf")
return [:]
}
var usrfDictionary:[String:NSAppleEventDescriptor] = [:]
var usrfDictionary: [String: NSAppleEventDescriptor] = [:]
var processedItems = 0
while (processedItems < listCount) {
while processedItems < listCount {
processedItems = processedItems + 2
guard let nthlabel = usrfList.atIndex(processedItems-1) else {
print("usrfDictionary() couldn't get item \(processedItems+1) in usrf list")
+1 -2
View File
@@ -20,8 +20,7 @@ struct StarredWidgetView: View {
if entry.widgetData.starredArticles.count == 0 {
inboxZero
.widgetURL(WidgetDeepLink.starred.url)
}
else {
} else {
GeometryReader { metrics in
starredImage
.frame(width: WidgetLayout.titleImageSize, alignment: .leading)
+1 -2
View File
@@ -20,8 +20,7 @@ struct TodayWidgetView: View {
if entry.widgetData.todayArticles.count == 0 {
inboxZero
.widgetURL(WidgetDeepLink.today.url)
}
else {
} else {
GeometryReader { metrics in
todayImage
.frame(width: WidgetLayout.titleImageSize, alignment: .leading)
+1 -2
View File
@@ -20,8 +20,7 @@ struct UnreadWidgetView: View {
if entry.widgetData.currentUnreadCount == 0 {
inboxZero
.widgetURL(WidgetDeepLink.unread.url)
}
else {
} else {
GeometryReader { metrics in
unreadImage
.frame(width: WidgetLayout.titleImageSize, alignment: .leading)