Mark classes as final when they can be, to communicate intent (don’t subclass these). Fix #4751.

This commit is contained in:
Brent Simmons committed 2025-09-16 10:21:29 -07:00
1 parent c6585994fb
commit 4b7ea6d920
170 files changed
+188 -188

No files matched your search

+1 -1
View File
@@ -30,7 +30,7 @@ import Sparkle
var appDelegate: AppDelegate!
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, UNUserNotificationCenterDelegate, UnreadCountProvider, SPUStandardUserDriverDelegate, SPUUpdaterDelegate
final class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, UNUserNotificationCenterDelegate, UnreadCountProvider, SPUStandardUserDriverDelegate, SPUUpdaterDelegate
{
private struct WindowRestorationIdentifiers {
@@ -22,7 +22,7 @@ import RSParser
// Else,
// display error sheet.
class AddFeedController: AddFeedWindowControllerDelegate {
final class AddFeedController: AddFeedWindowControllerDelegate {
private let hostWindow: NSWindow
private var addFeedWindowController: AddFeedWindowController?
@@ -12,7 +12,7 @@ import RSTree
import Articles
import Account
class AddWebFeedWindowController : NSWindowController, AddFeedWindowController {
final class AddWebFeedWindowController : NSWindowController, AddFeedWindowController {
@IBOutlet var urlTextField: NSTextField!
@IBOutlet var nameTextField: NSTextField!
+1 -1
View File
@@ -11,7 +11,7 @@ import RSCore
import RSTree
import Account
class FolderTreeMenu {
final class FolderTreeMenu {
static func createFolderPopupMenu(with rootNode: Node, restrictToSpecialAccounts: Bool = false) -> NSMenu {
@@ -10,7 +10,7 @@ import AppKit
import Articles
import Account
class AddFolderWindowController : NSWindowController {
final class AddFolderWindowController : NSWindowController {
@IBOutlet var folderNameTextField: NSTextField!
@IBOutlet var accountPopupButton: NSPopUpButton!
+1 -1
View File
@@ -15,7 +15,7 @@ enum ArticleExtractorButtonState {
case off
}
class ArticleExtractorButton: NSButton {
final class ArticleExtractorButton: NSButton {
private var animatedLayer: CALayer?
@@ -10,7 +10,7 @@ import Foundation
import WebKit
import Articles
class DetailIconSchemeHandler: NSObject, WKURLSchemeHandler {
final class DetailIconSchemeHandler: NSObject, WKURLSchemeHandler {
var currentArticle: Article?
@@ -8,7 +8,7 @@
import Foundation
class LegacyArticleExtractorButton: NSButton {
final class LegacyArticleExtractorButton: NSButton {
var isError = false {
didSet {
+1 -1
View File
@@ -16,7 +16,7 @@ enum TimelineSourceMode {
case regular, search
}
class MainWindowController : NSWindowController, NSUserInterfaceValidations {
final class MainWindowController : NSWindowController, NSUserInterfaceValidations {
@IBOutlet weak var articleThemePopUpButton: NSPopUpButton?
@@ -10,7 +10,7 @@ import AppKit
import Account
import UniformTypeIdentifiers
class ExportOPMLWindowController: NSWindowController {
final class ExportOPMLWindowController: NSWindowController {
@IBOutlet weak var accountPopUpButton: NSPopUpButton!
private weak var hostWindow: NSWindow?
@@ -10,7 +10,7 @@ import AppKit
import Account
import UniformTypeIdentifiers
class ImportOPMLWindowController: NSWindowController {
final class ImportOPMLWindowController: NSWindowController {
@IBOutlet weak var accountPopUpButton: NSPopUpButton!
private weak var hostWindow: NSWindow?
@@ -11,7 +11,7 @@ import RSCore
import Account
import RSTree
class SidebarCell : NSTableCellView {
final class SidebarCell : NSTableCellView {
var iconImage: IconImage? {
didSet {
@@ -10,7 +10,7 @@ import AppKit
import RSCore
import RSTree
class SidebarOutlineView : NSOutlineView {
final class SidebarOutlineView : NSOutlineView {
@IBOutlet var keyboardDelegate: KeyboardDelegate!
@@ -22,7 +22,7 @@ protocol SidebarDelegate: AnyObject {
func sidebarInvalidatedRestorationState(_: SidebarViewController)
}
@objc class SidebarViewController: NSViewController, NSOutlineViewDelegate, NSMenuDelegate, UndoableCommandRunner {
@objc final class SidebarViewController: NSViewController, NSOutlineViewDelegate, NSMenuDelegate, UndoableCommandRunner {
@IBOutlet weak var outlineView: NSOutlineView!
+1 -1
View File
@@ -8,7 +8,7 @@
import AppKit
class UnreadCountView : NSView {
final class UnreadCountView : NSView {
struct Appearance {
static let padding = NSEdgeInsets(top: 1.0, left: 7.0, bottom: 1.0, right: 7.0)
@@ -9,7 +9,7 @@
import AppKit
import RSCore
class TimelineTableCellView: NSTableCellView {
final class TimelineTableCellView: NSTableCellView {
private let titleView = TimelineTableCellView.multiLineTextField()
private let summaryView = TimelineTableCellView.multiLineTextField()
@@ -8,7 +8,7 @@
import AppKit
class UnreadIndicatorView: NSView {
final class UnreadIndicatorView: NSView {
static let unreadCircleDimension: CGFloat = 8.0
@@ -8,7 +8,7 @@
import AppKit
class TimelineTableRowView : NSTableRowView {
final class TimelineTableRowView : NSTableRowView {
private var separator: NSView?
@@ -9,7 +9,7 @@
import AppKit
import RSCore
class TimelineTableView: NSTableView {
final class TimelineTableView: NSTableView {
weak var keyboardDelegate: KeyboardDelegate?
+1 -1
View File
@@ -8,7 +8,7 @@
import AppKit
class AccountCell: NSTableCellView {
final class AccountCell: NSTableCellView {
private var originalImage: NSImage?
@@ -17,7 +17,7 @@ enum AccountsAddCloudKitWindowControllerError: LocalizedError {
}
}
class AccountsAddCloudKitWindowController: NSWindowController {
final class AccountsAddCloudKitWindowController: NSWindowController {
private weak var hostWindow: NSWindow?
@@ -9,7 +9,7 @@
import AppKit
import Account
class AccountsAddLocalWindowController: NSWindowController {
final class AccountsAddLocalWindowController: NSWindowController {
@IBOutlet private weak var nameTextField: NSTextField!
@IBOutlet private weak var localAccountNameTextField: NSTextField!
@@ -11,7 +11,7 @@ import Account
import RSWeb
import Secrets
class AccountsFeedbinWindowController: NSWindowController {
final class AccountsFeedbinWindowController: NSWindowController {
@IBOutlet weak var signInTextField: NSTextField!
@IBOutlet weak var noAccountTextField: NSTextField!
@@ -11,7 +11,7 @@ import Account
import RSWeb
import Secrets
class AccountsNewsBlurWindowController: NSWindowController {
final class AccountsNewsBlurWindowController: NSWindowController {
@IBOutlet weak var signInTextField: NSTextField!
@IBOutlet weak var noAccountTextField: NSTextField!
@@ -11,7 +11,7 @@ import Account
import RSWeb
import Secrets
class AccountsReaderAPIWindowController: NSWindowController {
final class AccountsReaderAPIWindowController: NSWindowController {
@IBOutlet weak var titleImageView: NSImageView!
@IBOutlet weak var titleLabel: NSTextField!
@@ -27,7 +27,7 @@ private struct ToolbarItemIdentifier {
static let Advanced = "Advanced"
}
class PreferencesWindowController : NSWindowController, NSToolbarDelegate {
final class PreferencesWindowController : NSWindowController, NSToolbarDelegate {
private let windowWidth = CGFloat(512.0) // Width is constant for all views; only the height changes
private var viewControllers = [String: NSViewController]()
@@ -8,7 +8,7 @@
import SafariServices
class SafariExtensionHandler: SFSafariExtensionHandler {
final class SafariExtensionHandler: SFSafariExtensionHandler {
// Safari App Extensions don't support any reasonable means of detecting whether a
// specific Safari page was loaded with the benefit of the extension's injected
@@ -20,7 +20,7 @@ class SafariExtensionHandler: SFSafariExtensionHandler {
// I tried to use a NSMapTable from String to the closure directly, but Swift
// complains that the object has to be a class type.
typealias ValidationHandler = (Bool, String) -> Void
class ValidationWrapper {
final class ValidationWrapper {
let validationHandler: ValidationHandler
init(validationHandler: @escaping ValidationHandler) {
@@ -8,7 +8,7 @@
import SafariServices
class SafariExtensionViewController: SFSafariExtensionViewController {
final class SafariExtensionViewController: SFSafariExtensionViewController {
// This would be the place to handle a popover that could, for example, list the possibly multiple feeds offered by a site.
static let shared: SafariExtensionViewController = {
@@ -12,7 +12,7 @@ import Articles
import RSCore
@objc(ScriptableAccount)
class ScriptableAccount: NSObject, UniqueIdScriptingObject, ScriptingObjectContainer {
final class ScriptableAccount: NSObject, UniqueIdScriptingObject, ScriptingObjectContainer {
let account:Account
init (_ account:Account) {
@@ -91,7 +91,7 @@ extension AppDelegate : AppDelegateAppleEvents {
}
}
class NetNewsWireCreateElementCommand : NSCreateCommand {
final class NetNewsWireCreateElementCommand : NSCreateCommand {
override func performDefaultImplementation() -> Any? {
let classDescription = self.createClassDescription
if (classDescription.className == "webFeed") {
@@ -111,7 +111,7 @@ class NetNewsWireCreateElementCommand : NSCreateCommand {
is ambiguity about whether specifiers are lists or single objects, the code switches
based on which it is.
*/
class NetNewsWireDeleteCommand : NSDeleteCommand {
final class NetNewsWireDeleteCommand : NSDeleteCommand {
/*
delete(objectToDelete:, from container:)
@@ -166,7 +166,7 @@ class NetNewsWireDeleteCommand : NSDeleteCommand {
}
}
class NetNewsWireExistsCommand : NSExistsCommand {
final class NetNewsWireExistsCommand : NSExistsCommand {
// cocoa default behavior doesn't work here, because of cases where we define an object's property
// to be another object type. e.g., 'permalink of the current article' parses as
@@ -11,7 +11,7 @@ import Account
import Articles
@objc(ScriptableArticle)
class ScriptableArticle: NSObject, UniqueIdScriptingObject, ScriptingObjectContainer {
final class ScriptableArticle: NSObject, UniqueIdScriptingObject, ScriptingObjectContainer {
let article:Article
let container:ScriptingObjectContainer
+1 -1
View File
@@ -11,7 +11,7 @@ import Account
import Articles
@objc(ScriptableAuthor)
class ScriptableAuthor: NSObject, UniqueIdScriptingObject {
final class ScriptableAuthor: NSObject, UniqueIdScriptingObject {
let author:Author
let container:ScriptingObjectContainer
+1 -1
View File
@@ -12,7 +12,7 @@ import Articles
import RSCore
@objc(ScriptableFolder)
class ScriptableFolder: NSObject, UniqueIdScriptingObject, ScriptingObjectContainer {
final class ScriptableFolder: NSObject, UniqueIdScriptingObject, ScriptingObjectContainer {
let folder:Folder
let container:ScriptingObjectContainer
@@ -12,7 +12,7 @@ import Account
import Articles
@objc(ScriptableWebFeed)
class ScriptableWebFeed: NSObject, UniqueIdScriptingObject, ScriptingObjectContainer {
final class ScriptableWebFeed: NSObject, UniqueIdScriptingObject, ScriptingObjectContainer {
let webFeed:WebFeed
let container:ScriptingObjectContainer
+1 -1
View File
@@ -10,7 +10,7 @@ import Cocoa
import os.log
import UniformTypeIdentifiers
class ShareViewController: NSViewController {
final class ShareViewController: NSViewController {
@IBOutlet weak var nameTextField: NSTextField!
@IBOutlet weak var folderPopUpButton: NSPopUpButton!
@@ -13,7 +13,7 @@ import CloudKit
import RSCore
import Articles
class CloudKitAcountZoneDelegate: CloudKitZoneDelegate {
final class CloudKitAcountZoneDelegate: CloudKitZoneDelegate {
private typealias UnclaimedWebFeed = (url: URL, name: String?, editedName: String?, homePageURL: String?, webFeedExternalID: String)
private var newUnclaimedWebFeeds = [String: [UnclaimedWebFeed]]()
@@ -16,7 +16,7 @@ import SyncDatabase
import Articles
import ArticlesDatabase
class CloudKitArticlesZoneDelegate: CloudKitZoneDelegate {
final class CloudKitArticlesZoneDelegate: CloudKitZoneDelegate {
private var log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "CloudKit")
@@ -10,7 +10,7 @@ import Foundation
import os.log
import RSCore
class CloudKitReceiveStatusOperation: MainThreadOperation {
final class CloudKitReceiveStatusOperation: MainThreadOperation {
private var log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "CloudKit")
@@ -11,7 +11,7 @@ import Foundation
import os.log
import RSCore
class CloudKitRemoteNotificationOperation: MainThreadOperation {
final class CloudKitRemoteNotificationOperation: MainThreadOperation {
private var log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "CloudKit")
@@ -13,7 +13,7 @@ import RSCore
import RSWeb
import SyncDatabase
class CloudKitSendStatusOperation: MainThreadOperation {
final class CloudKitSendStatusOperation: MainThreadOperation {
private var log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "CloudKit")
private let blockSize = 150
@@ -11,7 +11,7 @@ import RSParser
import RSWeb
import RSCore
class FeedFinder {
final class FeedFinder {
static func find(url: URL, completion: @escaping (Result<Set<FeedSpecifier>, Error>) -> Void) {
Task { @MainActor in
@@ -11,7 +11,7 @@ import RSParser
private let feedURLWordsToMatch = ["feed", "xml", "rss", "atom", "json"]
class HTMLFeedFinder {
final class HTMLFeedFinder {
var feedSpecifiers: Set<FeedSpecifier> {
return Set(feedSpecifiersDictionary.values)
@@ -12,7 +12,7 @@ import RSWeb
import RSCore
import Secrets
class FeedlyAddExistingFeedOperation: FeedlyOperation, FeedlyOperationDelegate, FeedlyCheckpointOperationDelegate {
final class FeedlyAddExistingFeedOperation: FeedlyOperation, FeedlyOperationDelegate, FeedlyCheckpointOperationDelegate {
private let operationQueue = MainThreadOperationQueue()
var addCompletionHandler: ((Result<Void, Error>) -> ())?
@@ -13,7 +13,7 @@ import RSWeb
import RSCore
import Secrets
class FeedlyAddNewFeedOperation: FeedlyOperation, FeedlyOperationDelegate, FeedlySearchOperationDelegate, FeedlyCheckpointOperationDelegate {
final class FeedlyAddNewFeedOperation: FeedlyOperation, FeedlyOperationDelegate, FeedlySearchOperationDelegate, FeedlyCheckpointOperationDelegate {
private let operationQueue = MainThreadOperationQueue()
private let folder: Folder
@@ -11,7 +11,7 @@ import os.log
import RSCore
import RSWeb
class FeedlyDownloadArticlesOperation: FeedlyOperation {
final class FeedlyDownloadArticlesOperation: FeedlyOperation {
private let account: Account
private let log: OSLog
@@ -14,7 +14,7 @@ import Secrets
///
/// Typically, it pages through the article ids of the global.all stream.
/// When all the article ids are collected, it is the responsibility of another operation to download them when appropriate.
class FeedlyGetUpdatedArticleIdsOperation: FeedlyOperation, FeedlyEntryIdentifierProviding {
final class FeedlyGetUpdatedArticleIdsOperation: FeedlyOperation, FeedlyEntryIdentifierProviding {
private let account: Account
private let resource: FeedlyResourceId
@@ -15,7 +15,7 @@ import Secrets
/// Typically, it pages through the article ids of the global.all stream.
/// As the article ids are collected, a default read status is created for each.
/// So this operation has side effects *for the entire account* it operates on.
class FeedlyIngestStreamArticleIdsOperation: FeedlyOperation {
final class FeedlyIngestStreamArticleIdsOperation: FeedlyOperation {
private let account: Account
private let resource: FeedlyResourceId
@@ -18,7 +18,7 @@ protocol FeedlySearchOperationDelegate: AnyObject {
/// Find one and only one feed for a given query (usually, a URL).
/// What happens when a feed is found for the URL is delegated to the `searchDelegate`.
class FeedlySearchOperation: FeedlyOperation {
final class FeedlySearchOperation: FeedlyOperation {
let query: String
let locale: Locale
@@ -11,7 +11,7 @@ import RSWeb
@testable import Account
import Secrets
class AccountCredentialsTest: XCTestCase {
final class AccountCredentialsTest: XCTestCase {
private var account: Account!
@@ -9,7 +9,7 @@
import XCTest
@testable import Account
class AccountFeedbinFolderContentsSyncTest: XCTestCase {
final class AccountFeedbinFolderContentsSyncTest: XCTestCase {
override func setUp() {
}
@@ -9,7 +9,7 @@
import XCTest
@testable import Account
class AccountFeedbinFolderSyncTest: XCTestCase {
final class AccountFeedbinFolderSyncTest: XCTestCase {
override func setUp() {
}
@@ -9,7 +9,7 @@
import XCTest
@testable import Account
class AccountFeedbinSyncTest: XCTestCase {
final class AccountFeedbinSyncTest: XCTestCase {
override func setUp() {
}
@@ -10,9 +10,9 @@ import XCTest
@testable import Account
import RSCore
class FeedlyCheckpointOperationTests: XCTestCase {
final class FeedlyCheckpointOperationTests: XCTestCase {
class TestDelegate: FeedlyCheckpointOperationDelegate {
final class TestDelegate: FeedlyCheckpointOperationDelegate {
var didReachCheckpointExpectation: XCTestExpectation?
@@ -9,7 +9,7 @@
import XCTest
@testable import Account
class FeedlyCollectionParserTests: XCTestCase {
final class FeedlyCollectionParserTests: XCTestCase {
func testParsing() {
let collection = FeedlyCollection(feeds: [], label: "Test Collection", id: "test/collection/1")
@@ -10,7 +10,7 @@ import XCTest
@testable import Account
import RSCore
class FeedlyCreateFeedsForCollectionFoldersOperationTests: XCTestCase {
final class FeedlyCreateFeedsForCollectionFoldersOperationTests: XCTestCase {
private var account: Account!
private let support = FeedlyTestSupport()
@@ -27,7 +27,7 @@ class FeedlyCreateFeedsForCollectionFoldersOperationTests: XCTestCase {
super.tearDown()
}
class FeedsAndFoldersProvider: FeedlyFeedsAndFoldersProviding {
final class FeedsAndFoldersProvider: FeedlyFeedsAndFoldersProviding {
var feedsAndFolders = [([FeedlyFeed], Folder)]()
}
@@ -9,7 +9,7 @@
import XCTest
@testable import Account
class FeedlyEntryParserTests: XCTestCase {
final class FeedlyEntryParserTests: XCTestCase {
func testParsing() {
let content = FeedlyEntry.Content(content: "Test Content", direction: .leftToRight)
@@ -9,7 +9,7 @@
import XCTest
@testable import Account
class FeedlyFeedParserTests: XCTestCase {
final class FeedlyFeedParserTests: XCTestCase {
func testParsing() {
let name = "Test Feed"
@@ -11,7 +11,7 @@ import XCTest
import os.log
import RSCore
class FeedlyGetCollectionsOperationTests: XCTestCase {
final class FeedlyGetCollectionsOperationTests: XCTestCase {
func testGetCollections() {
let support = FeedlyTestSupport()
@@ -58,7 +58,7 @@ class FeedlyGetCollectionsOperationTests: XCTestCase {
func testGetCollectionsError() {
class TestDelegate: FeedlyOperationDelegate {
final class TestDelegate: FeedlyOperationDelegate {
var errorExpectation: XCTestExpectation?
var error: Error?
@@ -10,7 +10,7 @@ import XCTest
@testable import Account
import RSCore
class FeedlyGetStreamContentsOperationTests: XCTestCase {
final class FeedlyGetStreamContentsOperationTests: XCTestCase {
private var account: Account!
private let support = FeedlyTestSupport()
@@ -10,7 +10,7 @@ import XCTest
@testable import Account
import RSCore
class FeedlyGetStreamIdsOperationTests: XCTestCase {
final class FeedlyGetStreamIdsOperationTests: XCTestCase {
private var account: Account!
private let support = FeedlyTestSupport()
@@ -11,7 +11,7 @@ import XCTest
import RSCore
import Secrets
class FeedlyLogoutOperationTests: XCTestCase {
final class FeedlyLogoutOperationTests: XCTestCase {
private var account: Account!
private let support = FeedlyTestSupport()
@@ -36,7 +36,7 @@ class FeedlyLogoutOperationTests: XCTestCase {
return (accessToken, refreshToken)
}
class TestFeedlyLogoutService: FeedlyLogoutService {
final class TestFeedlyLogoutService: FeedlyLogoutService {
var mockResult: Result<Void, Error>?
var logoutExpectation: XCTestExpectation?
@@ -123,7 +123,7 @@ class FeedlyLogoutOperationTests: XCTestCase {
}
}
class TestLogoutDelegate: FeedlyOperationDelegate {
final class TestLogoutDelegate: FeedlyOperationDelegate {
var error: Error?
var didFailExpectation: XCTestExpectation?
@@ -10,7 +10,7 @@ import XCTest
@testable import Account
import RSCore
class FeedlyMirrorCollectionsAsFoldersOperationTests: XCTestCase {
final class FeedlyMirrorCollectionsAsFoldersOperationTests: XCTestCase {
private var account: Account!
private let support = FeedlyTestSupport()
@@ -27,7 +27,7 @@ class FeedlyMirrorCollectionsAsFoldersOperationTests: XCTestCase {
super.tearDown()
}
class CollectionsProvider: FeedlyCollectionProviding {
final class CollectionsProvider: FeedlyCollectionProviding {
var collections = [
FeedlyCollection(feeds: [], label: "One", id: "collections/1"),
FeedlyCollection(feeds: [], label: "Two", id: "collections/2")
@@ -105,7 +105,7 @@ class FeedlyMirrorCollectionsAsFoldersOperationTests: XCTestCase {
XCTAssertTrue(removeFolders.feedsAndFolders.isEmpty)
}
class CollectionsAndFeedsProvider: FeedlyCollectionProviding {
final class CollectionsAndFeedsProvider: FeedlyCollectionProviding {
var feedsForCollectionOne = [
FeedlyFeed(id: "feed/1", title: "Feed One", updated: nil, website: nil),
FeedlyFeed(id: "feed/2", title: "Feed Two", updated: nil, website: nil)
@@ -11,7 +11,7 @@ import XCTest
import RSWeb
import RSCore
class FeedlyOperationTests: XCTestCase {
final class FeedlyOperationTests: XCTestCase {
enum TestOperationError: Error, Equatable {
case mockError
@@ -11,7 +11,7 @@ import XCTest
import RSParser
import RSCore
class FeedlyOrganiseParsedItemsByFeedOperationTests: XCTestCase {
final class FeedlyOrganiseParsedItemsByFeedOperationTests: XCTestCase {
private var account: Account!
private let support = FeedlyTestSupport()
@@ -12,7 +12,7 @@ import RSWeb
import RSCore
import Secrets
class FeedlyRefreshAccessTokenOperationTests: XCTestCase {
final class FeedlyRefreshAccessTokenOperationTests: XCTestCase {
private var account: Account!
private let support = FeedlyTestSupport()
@@ -29,7 +29,7 @@ class FeedlyRefreshAccessTokenOperationTests: XCTestCase {
super.tearDown()
}
class TestRefreshTokenService: OAuthAccessTokenRefreshing {
final class TestRefreshTokenService: OAuthAccessTokenRefreshing {
var mockResult: Result<OAuthAuthorizationGrant, Error>?
var refreshAccessTokenExpectation: XCTestExpectation?
var parameterTester: ((String, OAuthAuthorizationClient) -> ())?
@@ -71,7 +71,7 @@ class FeedlyRefreshAccessTokenOperationTests: XCTestCase {
XCTAssertTrue(refresh.isCanceled)
}
class TestRefreshTokenDelegate: FeedlyOperationDelegate {
final class TestRefreshTokenDelegate: FeedlyOperationDelegate {
var error: Error?
var didFailExpectation: XCTestExpectation?
@@ -9,7 +9,7 @@
import XCTest
@testable import Account
class FeedlyResourceIdTests: XCTestCase {
final class FeedlyResourceIdTests: XCTestCase {
func testFeedResourceId() {
let expectedUrl = "http://ranchero.com/blog/atom.xml"
@@ -12,7 +12,7 @@ import SyncDatabase
import Articles
import RSCore
class FeedlySendArticleStatusesOperationTests: XCTestCase {
final class FeedlySendArticleStatusesOperationTests: XCTestCase {
private var account: Account!
private let support = FeedlyTestSupport()
@@ -8,7 +8,7 @@
import Foundation
class FeedlyMockResponseProvider: TestTransportMockResponseProviding {
final class FeedlyMockResponseProvider: TestTransportMockResponseProviding {
let subdirectory: String
@@ -10,7 +10,7 @@ import XCTest
@testable import Account
import RSCore
class FeedlySyncStreamContentsOperationTests: XCTestCase {
final class FeedlySyncStreamContentsOperationTests: XCTestCase {
private var account: Account!
private let support = FeedlyTestSupport()
@@ -13,7 +13,7 @@ import Secrets
import os.log
import SyncDatabase
class FeedlyTestSupport {
final class FeedlyTestSupport {
var log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "FeedlyTests")
var accessToken = Credentials(type: .oauthAccessToken, username: "Test", secret: "t3st-access-tok3n")
var refreshToken = Credentials(type: .oauthRefreshToken, username: "Test", secret: "t3st-refresh-tok3n")
@@ -58,7 +58,7 @@ class FeedlyTestSupport {
return TestDatabaseContainer()
}
class TestDatabaseContainer {
final class TestDatabaseContainer {
private let path: String
private(set) var database: SyncDatabase!
@@ -9,7 +9,7 @@
import XCTest
@testable import Account
class FeedlyTextSanitizationTests: XCTestCase {
final class FeedlyTextSanitizationTests: XCTestCase {
func testRTLSanitization() {
@@ -9,7 +9,7 @@
import XCTest
@testable import Account
class TestMarkArticlesService: FeedlyMarkArticlesService {
final class TestMarkArticlesService: FeedlyMarkArticlesService {
var didMarkExpectation: XCTestExpectation?
var parameterTester: ((Set<String>, FeedlyMarkAction) -> ())?
@@ -11,7 +11,7 @@ import RSWeb
@testable import Account
class TestAccountManager {
final class TestAccountManager {
static let shared = TestAccountManager()
@@ -9,7 +9,7 @@
#if os(macOS)
import Cocoa
public class RSAppMovementMonitor: NSObject {
public final class RSAppMovementMonitor: NSObject {
// If provided, the handler will be consulted when the app is moved.
// Return true to indicate that the default handler should be invoked.
@@ -8,7 +8,7 @@
#if os(macOS)
import AppKit
class RSDarkModeAdaptingToolbarButton: NSButton {
final class RSDarkModeAdaptingToolbarButton: NSButton {
// Clients probably should not bother using this class unless they want
// to force the template in dark mode, but if you are using this in a more
// general context where you want to control and/or override it on a
@@ -12,7 +12,7 @@ enum MacroProcessorError: Error {
case emptyMacroDelimiter
}
public class MacroProcessor {
public final class MacroProcessor {
let template: String
let substitutions: [String: String]
@@ -9,7 +9,7 @@
#if os(macOS)
import AppKit
public class RSScreen {
public final class RSScreen {
public static var maxScreenScale: CGFloat {
NSScreen.screens.map(\.backingScaleFactor).max() ?? 2.0
@@ -21,7 +21,7 @@ public class RSScreen {
#if os(iOS)
import UIKit
public class RSScreen {
public final class RSScreen {
public static var maxScreenScale = CGFloat(3)
}
@@ -10,7 +10,7 @@ import XCTest
import Foundation
@testable import RSCore
//class Data_RSCoreTests: XCTestCase {
//final class Data_RSCoreTests: XCTestCase {
// var bigHTML: String!
//
// var pngData: Data!
@@ -9,7 +9,7 @@
import XCTest
@testable import RSCore
class MacroProcessorTests: XCTestCase {
final class MacroProcessorTests: XCTestCase {
let substitutions = ["one": "1", "two": "2"]
func testMacroProcessor() {
@@ -9,7 +9,7 @@
import XCTest
@testable import RSCore
class MainThreadOperationTests: XCTestCase {
final class MainThreadOperationTests: XCTestCase {
func testSingleOperation() {
let queue = MainThreadOperationQueue()
@@ -8,7 +8,7 @@
import XCTest
class String_RSCore: XCTestCase {
final class String_RSCore: XCTestCase {
func testCollapsingWhitespace() {
@@ -9,7 +9,7 @@
import XCTest
import RSParser
class AtomParserTests: XCTestCase {
final class AtomParserTests: XCTestCase {
func testDaringFireballPerformance() {
@@ -9,7 +9,7 @@
import XCTest
import RSParser
class EntityDecodingTests: XCTestCase {
final class EntityDecodingTests: XCTestCase {
func test39Decoding() {
@@ -10,7 +10,7 @@ import XCTest
import RSParser
import RSParserObjC
class FeedParserTypeTests: XCTestCase {
final class FeedParserTypeTests: XCTestCase {
// MARK: HTML
@@ -10,7 +10,7 @@ import XCTest
import RSParser
import RSParserObjC
class HTMLLinkTests: XCTestCase {
final class HTMLLinkTests: XCTestCase {
func testSixColorsPerformance() {
@@ -10,7 +10,7 @@ import XCTest
import RSParser
import RSParserObjC
class HTMLMetadataTests: XCTestCase {
final class HTMLMetadataTests: XCTestCase {
func testDaringFireball() {
@@ -9,7 +9,7 @@
import XCTest
import RSParser
class JSONFeedParserTests: XCTestCase {
final class JSONFeedParserTests: XCTestCase {
func testInessentialPerformance() {
@@ -10,7 +10,7 @@ import XCTest
import RSParser
import RSParserObjC
class OPMLTests: XCTestCase {
final class OPMLTests: XCTestCase {
let subsData = parserData("Subs", "opml", "http://example.org/")
@@ -9,7 +9,7 @@ import Foundation
import XCTest
import RSParser
class RSDateParserTests: XCTestCase {
final class RSDateParserTests: XCTestCase {
static func dateWithValues(_ year: Int, _ month: Int, _ day: Int, _ hour: Int, _ minute: Int, _ second: Int) -> Date {
var dateComponents = DateComponents()
@@ -9,7 +9,7 @@
import XCTest
import RSParser
class RSSInJSONParserTests: XCTestCase {
final class RSSInJSONParserTests: XCTestCase {
func testScriptingNewsPerformance() {
@@ -9,7 +9,7 @@
import XCTest
import RSParser
class RSSParserTests: XCTestCase {
final class RSSParserTests: XCTestCase {
func testScriptingNewsPerformance() {
@@ -8,7 +8,7 @@
import XCTest
class DictionaryTests: XCTestCase {
final class DictionaryTests: XCTestCase {
func testSimpleQueryString() {
@@ -8,7 +8,7 @@
import XCTest
class StringTests: XCTestCase {
final class StringTests: XCTestCase {
func testHTMLEscaping() {
@@ -7,6 +7,6 @@
import Foundation
public class SecretsManager {
public final class SecretsManager {
public static var provider: SecretsProvider!
}
+1 -1
View File
@@ -15,7 +15,7 @@ import Articles
import Intents
import UniformTypeIdentifiers
class ActivityManager {
final class ActivityManager {
private var nextUnreadActivity: NSUserActivity?
private var selectingActivity: NSUserActivity?
@@ -23,7 +23,7 @@ protocol ArticleExtractorDelegate {
func articleExtractionDidComplete(extractedArticle: ExtractedArticle)
}
class ArticleExtractor {
final class ArticleExtractor {
private var dataTask: URLSessionDataTask? = nil
+1 -1
View File
@@ -40,7 +40,7 @@ extension RSImage {
// MARK: - IconScalerQueue
private class IconScalerQueue {
private final class IconScalerQueue {
static let shared = IconScalerQueue()
+1 -1
View File
@@ -10,7 +10,7 @@ import Foundation
import Account
import Articles
class IconImageCache {
final class IconImageCache {
static var shared = IconImageCache()
+1 -1
View File
@@ -9,7 +9,7 @@
import Foundation
import Account
class ArticleStatusSyncTimer {
final class ArticleStatusSyncTimer {
private static let intervalSeconds = Double(120)
@@ -8,7 +8,7 @@
import XCTest
class NetNewsWire_iOSTests: XCTestCase {
final class NetNewsWire_iOSTests: XCTestCase {
override func setUp() {
super.setUp()
Loaded 100 of 170 files, more files were not shown because too many files have changed in this diff. Show more