fix some linter warnings on deliberate code

This commit is contained in:
Sixten Otto
2023-02-20 11:52:03 -07:00
parent 374d7104be
commit 8156328cf6
14 changed files with 14 additions and 9 deletions

View File

@ -4,7 +4,7 @@ import SwiftUI
import Utils
import Views
// swiftlint:disable:next type_body_length
// swiftlint:disable file_length type_body_length
public struct ShareExtensionView: View {
let extensionContext: NSExtensionContext?
@StateObject var labelsViewModel = LabelsViewModel()

View File

@ -2,7 +2,7 @@ import Combine
import SwiftUI
import Utils
// swiftlint:disable file_length
// swiftlint:disable file_length type_body_length
#if os(iOS)
import PSPDFKit
import PSPDFKitUI

View File

@ -17,6 +17,7 @@ final class PDFViewerViewModel: ObservableObject {
onComplete(pdfItem.highlights.map { $0.patch ?? "" })
}
// swiftlint:disable:next function_parameter_count
func createHighlight(
dataService: DataService,
shortId: String,

View File

@ -1,11 +1,11 @@
#if os(iOS)
import Foundation
import Models
import Services
import SwiftUI
import Views
// swiftlint:disable file_length type_body_length
public struct ExpandedPlayer: View {
@EnvironmentObject var audioController: AudioController
@Environment(\.colorScheme) private var colorScheme: ColorScheme

View File

@ -1,4 +1,3 @@
import Introspect
import Models
import Services

View File

@ -1,4 +1,3 @@
import Models
import Services
import SwiftUI

View File

@ -1,4 +1,3 @@
import Models
import Services
import SwiftUI

View File

@ -6,7 +6,7 @@ import Utils
import Views
import WebKit
// swiftlint:disable:next type_body_length
// swiftlint:disable file_length type_body_length
struct WebReaderContainerView: View {
let item: LinkedItem

View File

@ -101,7 +101,7 @@ struct WebReaderContent {
"""
}
// swiftlint:disable line_length
// swiftlint:disable line_length function_body_length
static func emptyContent(isDark: Bool) -> String {
let themeKey = isDark ? "Gray" : "LightGray"
// let savedAt = "new Date(\(item.unwrappedSavedAt.timeIntervalSince1970 * 1000)).toISOString()"

View File

@ -203,6 +203,7 @@ public extension LinkedItem {
return item
}
// swiftlint:disable:next cyclomatic_complexity
func update(
inContext context: NSManagedObjectContext,
newReadingProgress: Double? = nil,

View File

@ -12,7 +12,7 @@ import Models
// Somewhat based on: https://github.com/neekeetab/CachingPlayerItem/blob/master/CachingPlayerItem.swift
class SpeechPlayerItem: AVPlayerItem {
let resourceLoaderDelegate = ResourceLoaderDelegate()
let resourceLoaderDelegate = ResourceLoaderDelegate() // swiftlint:disable:this weak_delegate
let session: AudioController
let speechItem: SpeechItem
var speechMarks: [SpeechMark]?

View File

@ -4,6 +4,7 @@ import Models
import SwiftGraphQL
extension DataService {
// swiftlint:disable:next function_parameter_count
public func createHighlight(
shortId: String,
highlightID: String,

View File

@ -1,5 +1,6 @@
import Foundation
// swiftlint:disable identifier_name
public enum UserDefaultKey: String {
case preferredWebFont
case preferredWebFontSize

View File

@ -1,6 +1,7 @@
import Models
import Utils
import WebKit
// swiftlint:disable file_length
/// Describes actions that can be sent from the WebView back to native views.
/// The names on the javascript side must match for an action to be handled.
@ -273,6 +274,7 @@ public final class OmnivoreWebView: WKWebView {
true
}
// swiftlint:disable:next cyclomatic_complexity
override public func canPerformAction(_ action: Selector, withSender _: Any?) -> Bool {
switch action {
case #selector(annotateSelection): return true
@ -418,6 +420,7 @@ public enum WebViewDispatchEvent {
case saveReadPosition
var script: String {
// swiftlint:disable:next implicit_getter
get throws {
let propertyLine = try scriptPropertyLine
return "var event = new Event('\(eventName)');\(propertyLine)document.dispatchEvent(event);"
@ -470,6 +473,7 @@ public enum WebViewDispatchEvent {
}
private var scriptPropertyLine: String {
// swiftlint:disable:next implicit_getter
get throws {
switch self {
case let .handleFontContrastChange(isHighContrast: isHighContrast):