mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-28 16:26:04 +00:00
Fix various SwiftLint warnings.
This commit is contained in:
1 parent
9180ec3ecd
commit
d0d7d0c823
25 files changed
-155
No files matched your search
@@ -59,4 +59,3 @@ final class CrashReportWindowController: NSWindowController {
|
||||
close()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,4 +89,3 @@ private extension DetailWebView {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,4 +30,3 @@ import RSCore
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1421,6 +1421,4 @@ private extension MainWindowController {
|
||||
articleThemeMenuToolbarItem.menu = articleThemeMenu
|
||||
articleThemePopUpButton?.menu = articleThemeMenu
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -141,4 +141,3 @@ extension NNW3Feed: OPMLRepresentable {
|
||||
return s
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,4 +32,3 @@ struct SidebarCellAppearance: Equatable {
|
||||
self.textFieldFont = NSFont.systemFont(ofSize: textFieldFontSize)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,4 +39,3 @@ import RSCore
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -365,4 +365,3 @@ private extension SidebarViewController {
|
||||
return articles
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,4 +108,3 @@ final class UnreadCountView: NSView {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,4 +185,3 @@ private extension ArticlePasteboardWriter {
|
||||
return authors.map{ authorDictionary($0) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,4 +233,3 @@ private extension Array where Element == NSRect {
|
||||
return y
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
import AppKit
|
||||
|
||||
final class TimelineContainerView: NSView {
|
||||
|
||||
private var contentViewConstraints: [NSLayoutConstraint]?
|
||||
|
||||
var contentView: NSView? {
|
||||
@@ -34,4 +33,3 @@ final class TimelineContainerView: NSView {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,4 +202,3 @@ final class NetNewsWireExistsCommand: NSExistsCommand {
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,4 +36,3 @@ extension ScriptingObjectContainer {
|
||||
return specifier
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,123 +0,0 @@
|
||||
import UIKit
|
||||
import Articles
|
||||
|
||||
final class ModernTimelineCustomizerTableViewController: UITableViewController {
|
||||
private var previewArticle: Article {
|
||||
var components = DateComponents()
|
||||
components.year = 1925
|
||||
components.month = 4
|
||||
components.day = 10
|
||||
|
||||
let calendar = Calendar.current
|
||||
let date = calendar.date(from: components)!
|
||||
|
||||
return Article(accountID: "_testID",
|
||||
articleID: "_testArticleID",
|
||||
feedID: "_testFeedID",
|
||||
uniqueID: UUID().uuidString,
|
||||
title: "Chapter 1",
|
||||
contentHTML: nil,
|
||||
contentText: "In my younger and more vulnerable years my father gave me some advice that I’ve been turning over in my mind ever since. “Whenever you feel like criticizing any one,” he told me, “just remember that all the people in this world haven’t had the advantages that you’ve had.”",
|
||||
markdown: nil,
|
||||
url: nil,
|
||||
externalURL: nil,
|
||||
summary: nil,
|
||||
imageURL: nil,
|
||||
datePublished: date,
|
||||
dateModified: nil,
|
||||
authors: Set([Author(authorID: "_testAuthorID", name: "F. Scott Fitzgerald", url: nil, avatarURL: nil, emailAddress: nil)!]),
|
||||
status: ArticleStatus(articleID: "_testArticleID", read: false, starred: false, dateArrived: .now))
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
title = NSLocalizedString("Timeline Customizer", comment: "Timeline Customizer")
|
||||
|
||||
NotificationCenter.default.addObserver(forName: UserDefaults.didChangeNotification, object: nil, queue: .main) { [weak self] _ in
|
||||
Task { @MainActor in
|
||||
self?.userDefaultsDidChange()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
|
||||
tableView.reloadSections(IndexSet(integer: 2), with: .fade)
|
||||
}
|
||||
|
||||
// MARK: - Table view data source
|
||||
|
||||
override func numberOfSections(in tableView: UITableView) -> Int {
|
||||
return 4
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
|
||||
if section == 0 { return NSLocalizedString("Icon Size", comment: "Icon Size")}
|
||||
if section == 1 { return NSLocalizedString("Number of Lines", comment: "Number of Lines")}
|
||||
if section == 2 { return NSLocalizedString("Preview with Icon", comment: "Previews") }
|
||||
if section == 3 { return NSLocalizedString("Preview without Icon", comment: "Previews") }
|
||||
return nil
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
if indexPath.section == 0 {
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: "IconSizeCell") as! ModernTimelineSliderCell
|
||||
cell.sliderConfiguration = .iconSize
|
||||
return cell
|
||||
}
|
||||
|
||||
if indexPath.section == 1 {
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: "NumberOfLinesCell") as! ModernTimelineSliderCell
|
||||
cell.sliderConfiguration = .numberOfLines
|
||||
return cell
|
||||
}
|
||||
|
||||
if indexPath.section == 2 {
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: "MainTimelineIconFeedCell") as? MainTimelineIconFeedCell ?? MainTimelineIconFeedCell()
|
||||
cell.cellData = MainTimelineCellData(article: previewArticle,
|
||||
showFeedName: .byline,
|
||||
feedName: "The Great Gatsby",
|
||||
byline: "F. Scott Fitzgerald",
|
||||
iconImage: IconImage(Assets.Images.nnwFeedIcon),
|
||||
showIcon: true,
|
||||
numberOfLines: AppDefaults.shared.timelineNumberOfLines,
|
||||
iconSize: AppDefaults.shared.timelineIconSize)
|
||||
cell.isPreview = true
|
||||
return cell
|
||||
}
|
||||
|
||||
if indexPath.section == 3 {
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: "MainTimelineFeedCell") as? MainTimelineFeedCell ?? MainTimelineFeedCell()
|
||||
cell.cellData = MainTimelineCellData(article: previewArticle,
|
||||
showFeedName: .byline,
|
||||
feedName: "The Great Gatsby",
|
||||
byline: "F. Scott Fitzgerald",
|
||||
iconImage: nil,
|
||||
showIcon: false,
|
||||
numberOfLines: AppDefaults.shared.timelineNumberOfLines,
|
||||
iconSize: AppDefaults.shared.timelineIconSize)
|
||||
cell.isPreview = true
|
||||
return cell
|
||||
}
|
||||
|
||||
return UITableViewCell()
|
||||
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, willSelectRowAt indexPath: IndexPath) -> IndexPath? {
|
||||
return nil
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, shouldHighlightRowAt indexPath: IndexPath) -> Bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// MARK: - Notifications
|
||||
|
||||
func userDefaultsDidChange() {
|
||||
tableView.reloadSections(IndexSet(integersIn: 2...3), with: .none)
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,6 @@ import os
|
||||
}
|
||||
|
||||
@MainActor final class LocalAccountRefresher {
|
||||
|
||||
var delegate: LocalAccountRefresherDelegate?
|
||||
var downloadProgress: DownloadProgress {
|
||||
downloadSession.downloadProgress
|
||||
@@ -292,4 +291,3 @@ private extension Data {
|
||||
return self.isImage
|
||||
}
|
||||
}
|
||||
|
||||
-3
@@ -19,11 +19,9 @@ extension ArticleStatus {
|
||||
|
||||
self.init(articleID: articleID, read: read, starred: starred, dateArrived: dateArrived)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension ArticleStatus: @retroactive DatabaseObject {
|
||||
|
||||
public var databaseID: String {
|
||||
return articleID
|
||||
}
|
||||
@@ -32,4 +30,3 @@ extension ArticleStatus: @retroactive DatabaseObject {
|
||||
return [DatabaseKey.articleID: articleID, DatabaseKey.read: read, DatabaseKey.starred: starred, DatabaseKey.dateArrived: dateArrived]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,4 +179,3 @@ public extension NSOutlineView {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -137,4 +137,3 @@ public final class UserApp {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -45,4 +45,3 @@ import UIKit
|
||||
/// - selectedText: The currently selected text.
|
||||
func sendObject(_ object: Any?, selectedText: String?)
|
||||
}
|
||||
|
||||
@@ -36,4 +36,3 @@ public extension FMResultSet {
|
||||
return Set(compactMap(completion))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,4 +244,3 @@ private extension DatabaseLookupTable {
|
||||
objectIDsWithNoRelatedObjects.withLock { $0.subtract(objectIDs) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,4 +134,3 @@ typealias ArticleArray = [Article]
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import WebKit
|
||||
import Articles
|
||||
|
||||
final class ArticleIconSchemeHandler: NSObject, WKURLSchemeHandler {
|
||||
|
||||
weak var coordinator: SceneCoordinator?
|
||||
|
||||
init(coordinator: SceneCoordinator) {
|
||||
@@ -49,12 +48,9 @@ final class ArticleIconSchemeHandler: NSObject, WKURLSchemeHandler {
|
||||
urlSchemeTask.didReceive(data)
|
||||
urlSchemeTask.didFinish()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func webView(_ webView: WKWebView, stop urlSchemeTask: WKURLSchemeTask) {
|
||||
urlSchemeTask.didFailWithError(URLError(.unknown))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -115,4 +115,3 @@ final class MainFeedCollectionViewCell: UICollectionViewCell {
|
||||
self.backgroundConfiguration = backgroundConfig
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user