Fix lint issues.

This commit is contained in:
Brent Simmons
2025-01-23 21:49:14 -08:00
parent 492bdbdf51
commit 1c2467e14a
6 changed files with 14 additions and 9 deletions

View File

@@ -10,6 +10,8 @@ line_length:
disabled_rules:
- todo
- for_where
- file_length
excluded:
- Modules/Secrets/Sources/Secrets/SecretKey.swift

View File

@@ -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

View File

@@ -55,7 +55,7 @@ final class SingleFaviconDownloader {
// If we dont have an image, and lastDownloadAttemptDate is a while ago, try again.
if let _ = iconImage {
if iconImage != nil {
return false
}

View File

@@ -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)

View File

@@ -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]()

View File

@@ -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")