Fix lint issues.

This commit is contained in:
Brent Simmons 2025-01-24 23:02:17 -08:00
parent cc34209738
commit 4a1df03375
17 changed files with 40 additions and 44 deletions

View File

@ -65,7 +65,7 @@ class ScriptableFolder: NSObject, UniqueIdScriptingObject, ScriptingObjectContai
or
tell account X to make new folder at end with properties {name:"new folder name"}
*/
class func handleCreateElement(command: NSCreateCommand) -> Any? {
static func handleCreateElement(command: NSCreateCommand) -> Any? {
guard command.isCreateCommand(forClass: "fold") else { return nil }
let name = command.property(forKey: "name") as? String ?? ""

View File

@ -59,7 +59,7 @@ class ScriptableFeed: NSObject, UniqueIdScriptingObject, ScriptingObjectContaine
// MARK: --- handle NSCreateCommand ---
class func urlForNewFeed(arguments: [String: Any]) -> String? {
static func urlForNewFeed(arguments: [String: Any]) -> String? {
var url: String?
if let withDataParam = arguments["ObjectData"] {
if let objectDataDescriptor = withDataParam as? NSAppleEventDescriptor {
@ -71,7 +71,7 @@ class ScriptableFeed: NSObject, UniqueIdScriptingObject, ScriptingObjectContaine
return url
}
class func scriptableFeed(_ feed: Feed, account: Account, folder: Folder?) -> ScriptableFeed {
static func scriptableFeed(_ feed: Feed, account: Account, folder: Folder?) -> ScriptableFeed {
let scriptableAccount = ScriptableAccount(account)
if let folder = folder {
let scriptableFolder = ScriptableFolder(folder, container: scriptableAccount)
@ -81,7 +81,7 @@ class ScriptableFeed: NSObject, UniqueIdScriptingObject, ScriptingObjectContaine
}
}
class func handleCreateElement(command: NSCreateCommand) -> Any? {
static func handleCreateElement(command: NSCreateCommand) -> Any? {
guard command.isCreateCommand(forClass: "Feed") else { return nil }
guard let arguments = command.arguments else {return nil}
let titleFromArgs = command.property(forKey: "name") as? String

View File

@ -327,7 +327,7 @@ public final class AccountManager: UnreadCountProvider {
public func anyAccountHasFeedWithURL(_ urlString: String) -> Bool {
for account in activeAccounts {
if let _ = account.existingFeed(withURL: urlString) {
if account.existingFeed(withURL: urlString) != nil {
return true
}
}

View File

@ -42,8 +42,8 @@ struct FeedbinSubscriptionJSONFeed: Codable {
let favicon: String?
let icon: String?
enum CodingKeys: String, CodingKey {
case favicon = "favicon"
case icon = "icon"
case favicon
case icon
}
}

View File

@ -53,9 +53,7 @@ final class ReaderAPIAccountDelegate: AccountDelegate {
}
var server: String? {
get {
return caller.server
}
caller.server
}
var isOPMLImportInProgress = false

View File

@ -58,9 +58,7 @@ final class ReaderAPICaller: NSObject {
var credentials: Credentials?
var server: String? {
get {
return apiBaseURL?.host
}
return apiBaseURL?.host
}
private var apiBaseURL: URL? {

View File

@ -63,15 +63,15 @@ struct ReaderAPIEntry: Codable {
enum CodingKeys: String, CodingKey {
case articleID = "id"
case title = "title"
case author = "author"
case summary = "summary"
case title
case author
case summary
case alternates = "alternate"
case categories = "categories"
case categories
case publishedTimestamp = "published"
case crawledTimestamp = "crawlTimeMsec"
case origin = "origin"
case timestampUsec = "timestampUsec"
case origin
case timestampUsec
}
func parseDatePublished() -> Date? {
@ -107,7 +107,7 @@ struct ReaderAPIArticleSummary: Codable {
let content: String?
enum CodingKeys: String, CodingKey {
case content = "content"
case content
}
}
@ -124,7 +124,7 @@ struct ReaderAPIEntryOrigin: Codable {
let title: String?
enum CodingKeys: String, CodingKey {
case streamId = "streamId"
case title = "title"
case streamId
case title
}
}

View File

@ -25,9 +25,9 @@ struct ReaderAPIQuickAddResult: Codable {
let streamId: String?
enum CodingKeys: String, CodingKey {
case numResults = "numResults"
case error = "error"
case streamId = "streamId"
case numResults
case error
case streamId
}
}
@ -35,7 +35,7 @@ struct ReaderAPISubscriptionContainer: Codable {
let subscriptions: [ReaderAPISubscription]
enum CodingKeys: String, CodingKey {
case subscriptions = "subscriptions"
case subscriptions
}
}

View File

@ -12,7 +12,7 @@ struct ReaderAPITagContainer: Codable {
let tags: [ReaderAPITag]
enum CodingKeys: String, CodingKey {
case tags = "tags"
case tags
}
}
@ -23,7 +23,7 @@ struct ReaderAPITag: Codable {
enum CodingKeys: String, CodingKey {
case tagID = "id"
case type = "type"
case type
}
var folderName: String? {

View File

@ -13,8 +13,8 @@ struct ReaderAPIReferenceWrapper: Codable {
let continuation: String?
enum CodingKeys: String, CodingKey {
case itemRefs = "itemRefs"
case continuation = "continuation"
case itemRefs
case continuation
}
}

File diff suppressed because one or more lines are too long

View File

@ -19,7 +19,7 @@ import AppKit
self.urlString = urlString
}
public class func write(urlString: String, to pasteboard: NSPasteboard) {
public static func write(urlString: String, to pasteboard: NSPasteboard) {
pasteboard.clearContents()
let writer = URLPasteboardWriter(urlString: urlString)

View File

@ -64,7 +64,7 @@ public final class Node: Hashable {
Node.incrementingID += 1
}
public class func genericRootNode() -> Node {
public static func genericRootNode() -> Node {
let node = Node(representedObject: TopLevelRepresentedObject(), parent: nil)
node.canHaveChildNodes = true
@ -140,13 +140,13 @@ public final class Node: Hashable {
}
}
public class func nodesOrganizedByParent(_ nodes: [Node]) -> [Node: [Node]] {
public static func nodesOrganizedByParent(_ nodes: [Node]) -> [Node: [Node]] {
let nodesWithParents = nodes.filter { $0.parent != nil }
return Dictionary(grouping: nodesWithParents, by: { $0.parent! })
}
public class func indexSetsGroupedByParent(_ nodes: [Node]) -> [Node: IndexSet] {
public static func indexSetsGroupedByParent(_ nodes: [Node]) -> [Node: IndexSet] {
let d = nodesOrganizedByParent(nodes)
let indexSetDictionary = d.mapValues { (nodes) -> IndexSet in
@ -177,7 +177,7 @@ public final class Node: Hashable {
// MARK: - Equatable
public class func ==(lhs: Node, rhs: Node) -> Bool {
public static func ==(lhs: Node, rhs: Node) -> Bool {
return lhs === rhs
}
}

View File

@ -13,7 +13,7 @@ import UniformTypeIdentifiers
public class MacWebBrowser {
/// Opens a URL in the default browser.
@discardableResult public class func openURL(_ url: URL, inBackground: Bool = false) -> Bool {
@discardableResult public static func openURL(_ url: URL, inBackground: Bool = false) -> Bool {
// TODO: make this function async
@ -36,7 +36,7 @@ public class MacWebBrowser {
/// Returns an array of the browsers installed on the system, sorted by name.
///
/// "Browsers" are applications that can both handle `https` URLs and display HTML documents.
public class func sortedBrowsers() -> [MacWebBrowser] {
public static func sortedBrowsers() -> [MacWebBrowser] {
let httpsAppURLs = NSWorkspace.shared.urlsForApplications(toOpen: URL(string: "https://apple.com/")!)
let htmlAppURLs = NSWorkspace.shared.urlsForApplications(toOpen: UTType.html)
@ -52,12 +52,12 @@ public class MacWebBrowser {
}
/// The filesystem URL of the default web browser.
private class var defaultBrowserURL: URL? {
private static var defaultBrowserURL: URL? {
return NSWorkspace.shared.urlForApplication(toOpen: URL(string: "https:///")!)
}
/// The user's default web browser.
public class var `default`: MacWebBrowser {
public static var `default`: MacWebBrowser {
return MacWebBrowser(url: defaultBrowserURL!)
}

View File

@ -26,7 +26,7 @@ extension Array where Element == Node {
private extension Node {
class func nodesSortedAlphabetically(_ nodes: [Node]) -> [Node] {
static func nodesSortedAlphabetically(_ nodes: [Node]) -> [Node] {
return nodes.sorted { (node1, node2) -> Bool in
@ -41,7 +41,7 @@ private extension Node {
}
}
class func nodesSortedAlphabeticallyWithFoldersAtEnd(_ nodes: [Node]) -> [Node] {
static func nodesSortedAlphabeticallyWithFoldersAtEnd(_ nodes: [Node]) -> [Node] {
return nodes.sorted { (node1, node2) -> Bool in

View File

@ -21,7 +21,7 @@ class FindInArticleActivity: UIActivity {
UIImage(systemName: "magnifyingglass", withConfiguration: UIImage.SymbolConfiguration(pointSize: 20, weight: .regular))
}
override class var activityCategory: UIActivity.Category {
override static var activityCategory: UIActivity.Category {
.action
}

View File

@ -24,7 +24,7 @@ class OpenInBrowserActivity: UIActivity {
return UIActivity.ActivityType(rawValue: "com.rancharo.NetNewsWire-Evergreen.safari")
}
override class var activityCategory: UIActivity.Category {
override static var activityCategory: UIActivity.Category {
return .action
}