mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Fix lint issues.
This commit is contained in:
@@ -10,6 +10,8 @@ line_length:
|
||||
|
||||
disabled_rules:
|
||||
- todo
|
||||
- for_where
|
||||
- file_length
|
||||
|
||||
excluded:
|
||||
- Modules/Secrets/Sources/Secrets/SecretKey.swift
|
||||
|
||||
@@ -51,23 +51,23 @@ public class ColorHash {
|
||||
|
||||
public var HSB: (CGFloat, CGFloat, CGFloat) {
|
||||
var hash = CGFloat(bkdrHash)
|
||||
let H = hash.truncatingRemainder(dividingBy: (full - 1.0)) / full
|
||||
let h = hash.truncatingRemainder(dividingBy: (full - 1.0)) / full
|
||||
hash /= full
|
||||
let S = saturation[Int((full * hash).truncatingRemainder(dividingBy: CGFloat(saturation.count)))]
|
||||
let s = saturation[Int((full * hash).truncatingRemainder(dividingBy: CGFloat(saturation.count)))]
|
||||
hash /= CGFloat(saturation.count)
|
||||
let B = brightness[Int((full * hash).truncatingRemainder(dividingBy: CGFloat(brightness.count)))]
|
||||
return (H, S, B)
|
||||
let b = brightness[Int((full * hash).truncatingRemainder(dividingBy: CGFloat(brightness.count)))]
|
||||
return (h, s, b)
|
||||
}
|
||||
|
||||
#if os(iOS) || os(tvOS) || os(watchOS)
|
||||
public var color: UIColor {
|
||||
let (H, S, B) = HSB
|
||||
return UIColor(hue: H, saturation: S, brightness: B, alpha: 1.0)
|
||||
let (h, s, b) = HSB
|
||||
return UIColor(hue: h, saturation: s, brightness: b, alpha: 1.0)
|
||||
}
|
||||
#elseif os(OSX)
|
||||
public var color: NSColor {
|
||||
let (H, S, B) = HSB
|
||||
return NSColor(hue: H, saturation: S, brightness: B, alpha: 1.0)
|
||||
let (h, s, b) = HSB
|
||||
return NSColor(hue: h, saturation: s, brightness: b, alpha: 1.0)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ final class SingleFaviconDownloader {
|
||||
|
||||
// If we don’t have an image, and lastDownloadAttemptDate is a while ago, try again.
|
||||
|
||||
if let _ = iconImage {
|
||||
if iconImage != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import Articles
|
||||
import ArticlesDatabase
|
||||
import RSCore
|
||||
|
||||
// swiftlint:disable:next class_delegate_protocol
|
||||
protocol SmartFeedDelegate: SidebarItemIdentifiable, DisplayNameProvider, ArticleFetcher, SmallIconProvider {
|
||||
var fetchType: FetchType { get }
|
||||
func fetchUnreadCount(for: Account, completion: @escaping SingleUnreadCountCompletionBlock)
|
||||
|
||||
@@ -62,6 +62,7 @@ private extension FeedTreeControllerDelegate {
|
||||
}
|
||||
|
||||
func childNodesForContainerNode(_ containerNode: Node) -> [Node]? {
|
||||
// swiftlint:disable:next force_cast
|
||||
let container = containerNode.representedObject as! Container
|
||||
|
||||
var children = [AnyObject]()
|
||||
|
||||
@@ -11,6 +11,7 @@ import Foundation
|
||||
struct WidgetDataDecoder {
|
||||
|
||||
static func decodeWidgetData() throws -> WidgetData {
|
||||
// swiftlint:disable:next force_cast
|
||||
let appGroup = Bundle.main.object(forInfoDictionaryKey: "AppGroup") as! String
|
||||
let containerURL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: appGroup)
|
||||
let dataURL = containerURL?.appendingPathComponent("widget-data.json")
|
||||
|
||||
Reference in New Issue
Block a user