mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-29 00:31:14 +00:00
Fix various SwiftLint warnings.
This commit is contained in:
1 parent
ccf81a15d4
commit
36cb48bae3
11 files changed
+15
-27
No files matched your search
@@ -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 {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user