Fix lint issues.
This commit is contained in:
parent
9bf4fea962
commit
f1640d8d09
@ -23,6 +23,8 @@ disabled_rules:
|
||||
- generic_type_name
|
||||
- function_body_length
|
||||
- type_body_length
|
||||
- function_parameter_count
|
||||
- line_length
|
||||
|
||||
excluded:
|
||||
- Modules/Secrets/Sources/Secrets/SecretKey.swift
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
import AppKit
|
||||
|
||||
protocol RenameWindowControllerDelegate {
|
||||
protocol RenameWindowControllerDelegate: AnyObject {
|
||||
|
||||
func renameWindowController(_ windowController: RenameWindowController, didRenameObject: Any, withNewName: String)
|
||||
}
|
||||
@ -21,7 +21,7 @@ final class RenameWindowController: NSWindowController {
|
||||
|
||||
private var originalTitle: String?
|
||||
private var representedObject: Any?
|
||||
private var delegate: RenameWindowControllerDelegate?
|
||||
private weak var delegate: RenameWindowControllerDelegate?
|
||||
|
||||
convenience init(originalTitle: String, representedObject: Any, delegate: RenameWindowControllerDelegate) {
|
||||
|
||||
|
@ -215,7 +215,7 @@ private extension SidebarViewController {
|
||||
menu.addItem(NSMenuItem.separator())
|
||||
}
|
||||
|
||||
if let homePageURL = feed.homePageURL, let _ = URL(string: homePageURL) {
|
||||
if let homePageURL = feed.homePageURL, URL(string: homePageURL) != nil {
|
||||
let item = menuItem(NSLocalizedString("Open Home Page", comment: "Command"), #selector(openHomePageFromContextualMenu(_:)), homePageURL)
|
||||
menu.addItem(item)
|
||||
menu.addItem(NSMenuItem.separator())
|
||||
|
@ -231,7 +231,7 @@ class ReaderAPIAccountViewController: UITableViewController {
|
||||
showError(NSLocalizedString("Username, password, and API URL are required.", comment: "Credentials Error"))
|
||||
return false
|
||||
}
|
||||
guard let _ = URL(string: apiURLTextField.text!) else {
|
||||
guard URL(string: apiURLTextField.text!) != nil else {
|
||||
showError(NSLocalizedString("Invalid API URL.", comment: "Invalid API URL"))
|
||||
return false
|
||||
}
|
||||
|
@ -14,10 +14,12 @@ import SafariServices
|
||||
|
||||
class ArticleViewController: UIViewController {
|
||||
|
||||
typealias State = (extractedArticle: ExtractedArticle?,
|
||||
isShowingExtractedArticle: Bool,
|
||||
articleExtractorButtonState: ArticleExtractorButtonState,
|
||||
windowScrollY: Int)
|
||||
struct State {
|
||||
let extractedArticle: ExtractedArticle?
|
||||
let isShowingExtractedArticle: Bool
|
||||
let articleExtractorButtonState: ArticleExtractorButtonState
|
||||
let windowScrollY: Int
|
||||
}
|
||||
|
||||
@IBOutlet private weak var nextUnreadBarButtonItem: UIBarButtonItem!
|
||||
@IBOutlet private weak var prevArticleBarButtonItem: UIBarButtonItem!
|
||||
@ -360,8 +362,7 @@ public extension Notification.Name {
|
||||
extension ArticleViewController: SearchBarDelegate {
|
||||
|
||||
func searchBar(_ searchBar: ArticleSearchBar, textDidChange searchText: String) {
|
||||
currentWebViewController?.searchText(searchText) {
|
||||
found in
|
||||
currentWebViewController?.searchText(searchText) { found in
|
||||
searchBar.resultsCount = found.count
|
||||
|
||||
if let index = found.index {
|
||||
|
@ -835,8 +835,7 @@ extension WebViewController {
|
||||
}
|
||||
let encoded = json.base64EncodedString()
|
||||
|
||||
webView?.evaluateJavaScript("updateFind(\"\(encoded)\")") {
|
||||
(result, error) in
|
||||
webView?.evaluateJavaScript("updateFind(\"\(encoded)\")") { (result, error) in
|
||||
guard error == nil,
|
||||
let b64 = result as? String,
|
||||
let rawData = Data(base64Encoded: b64),
|
||||
|
@ -43,7 +43,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(userDefaultsDidChange), name: UserDefaults.didChangeNotification, object: nil)
|
||||
|
||||
if let _ = connectionOptions.urlContexts.first?.url {
|
||||
if connectionOptions.urlContexts.first?.url != nil {
|
||||
self.scene(scene, openURLContexts: connectionOptions.urlContexts)
|
||||
return
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user