Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update swift lint and format + appy fixes #2585

Merged
merged 5 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ jobs:
- name: SwiftLint
run: |
docker run --rm -v `pwd`:`pwd` -w `pwd` \
ghcr.io/realm/swiftlint:0.49.1 \
ghcr.io/realm/swiftlint:0.54.0 \
swiftlint lint --strict --config .swiftlint.yml --reporter github-actions-logging
- name: SwiftFormat
run: |
docker run --rm -v `pwd`:`pwd` -w `pwd` \
ghcr.io/nicklockwood/swiftformat:0.50.3 \
ghcr.io/nicklockwood/swiftformat:0.53.1 \
--lint --config .swiftformat .

test:
Expand Down
2 changes: 1 addition & 1 deletion .swiftformat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
--swiftversion 5.3
--swiftversion 5.8

--exclude vendor,Pods,**/Swiftgen/**,**/Resources/**,fastlane,**/Assets/**

Expand Down
2 changes: 1 addition & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ excluded:
- Tests
- Pods
- vendor
- "*/**/.build"
- "**/**/.build"
4 changes: 2 additions & 2 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ project 'HomeAssistant', 'Debug' => :debug, 'Release' => :release, 'Beta' => :re

def support_modules
pod 'SwiftGen', '~> 6.5.0'
pod 'SwiftLint', '0.49.1' # also update ci.yml GHA
pod 'SwiftFormat/CLI', '0.50.3' # also update ci.yml GHA
pod 'SwiftLint', '0.54.0' # also update ci.yml GHA
pod 'SwiftFormat/CLI', '0.53.1' # also update ci.yml GHA
end

if ENV['ONLY_SUPPORT_MODULES']
Expand Down
14 changes: 7 additions & 7 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ PODS:
- Realm (= 10.35.0)
- Sodium (0.9.1)
- Starscream (4.0.4)
- SwiftFormat/CLI (0.50.3)
- SwiftFormat/CLI (0.53.1)
- SwiftGen (6.5.1)
- SwiftLint (0.49.1)
- SwiftLint (0.54.0)
- SwiftMessages (9.0.6):
- SwiftMessages/App (= 9.0.6)
- SwiftMessages/App (9.0.6)
Expand Down Expand Up @@ -141,9 +141,9 @@ DEPENDENCIES:
- RealmSwift
- Sodium (from `https://github.com/zacwest/swift-sodium.git`, branch `xcode-14.0.1`)
- Starscream (from `https://github.com/zacwest/starscream`, branch `ha-swift-api`)
- SwiftFormat/CLI (= 0.50.3)
- SwiftFormat/CLI (= 0.53.1)
- SwiftGen (~> 6.5.0)
- SwiftLint (= 0.49.1)
- SwiftLint (= 0.54.0)
- SwiftMessages
- UIColor_Hex_Swift
- Version
Expand Down Expand Up @@ -274,16 +274,16 @@ SPEC CHECKSUMS:
RealmSwift: b358779c10ba6d2648d541f8a1bcd671f73485c1
Sodium: a7d42cb46e789d2630fa552d35870b416ed055ae
Starscream: 5178aed56b316f13fa3bc55694e583d35dd414d9
SwiftFormat: 61cda3819dc3a7d69795ce0430e1e1d53c4a4fb2
SwiftFormat: a8623113c7adcbeb4289a013cac68ec801e1ed24
SwiftGen: a6d22010845f08fe18fbdf3a07a8e380fd22e0ea
SwiftLint: 32ee33ded0636d0905ef6911b2b67bbaeeedafa5
SwiftLint: c1de071d9d08c8aba837545f6254315bc900e211
SwiftMessages: f0c7ef4705a570ad6c5e208b611f4333e660ed92
UIColor_Hex_Swift: 31cd3e47440f07a20d2503a36bb0437a445b3c29
Version: de5907f2c5d0f3cf21708db7801d1d5401139486
ViewRow: 8da541e9c019f3be63f4e28f311a62cac2045ecf
XCGLogger: 1943831ef907df55108b0b18657953f868de973b
ZIPFoundation: d170fa8e270b2a32bef9dcdcabff5b8f1a5deced

PODFILE CHECKSUM: 22fc24cfd665bd31532e7b68cf2aee22abb132b2
PODFILE CHECKSUM: a1fb8b74054208eb193f5366db79acab04a209b0

COCOAPODS: 1.15.2
12 changes: 6 additions & 6 deletions Sources/App/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
}
}

@UIApplicationMain
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
@available(iOS, deprecated: 13.0)
var window: UIWindow? {
Expand Down Expand Up @@ -144,12 +144,12 @@
}
}

@objc internal func openAbout() {
@objc func openAbout() {

Check warning on line 147 in Sources/App/AppDelegate.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/AppDelegate.swift#L147

Added line #L147 was not covered by tests
precondition(Current.sceneManager.supportsMultipleScenes)
sceneManager.activateAnyScene(for: .about)
}

@objc internal func openMenuUrl(_ command: AnyObject) {
@objc func openMenuUrl(_ command: AnyObject) {

Check warning on line 152 in Sources/App/AppDelegate.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/AppDelegate.swift#L152

Added line #L152 was not covered by tests
guard let command = command as? UICommand, let url = MenuManager.url(from: command) else {
return
}
Expand All @@ -160,18 +160,18 @@
}
}

@objc internal func openPreferences() {
@objc func openPreferences() {

Check warning on line 163 in Sources/App/AppDelegate.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/AppDelegate.swift#L163

Added line #L163 was not covered by tests
precondition(Current.sceneManager.supportsMultipleScenes)
sceneManager.activateAnyScene(for: .settings)
}

@objc internal func openActionsPreferences() {
@objc func openActionsPreferences() {

Check warning on line 168 in Sources/App/AppDelegate.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/AppDelegate.swift#L168

Added line #L168 was not covered by tests
precondition(Current.sceneManager.supportsMultipleScenes)
let delegate: Guarantee<SettingsSceneDelegate> = sceneManager.scene(for: .init(activity: .settings))
delegate.done { $0.pushActions(animated: true) }
}

@objc internal func openHelp() {
@objc func openHelp() {

Check warning on line 174 in Sources/App/AppDelegate.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/AppDelegate.swift#L174

Added line #L174 was not covered by tests
openURLInBrowser(
URL(string: "https://companion.home-assistant.io")!,
nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
}

extension UITableView {
func applyChanges<T>(changes: RealmCollectionChange<T>) {
func applyChanges(changes: RealmCollectionChange<some Any>) {

Check warning on line 115 in Sources/App/ClientEvents/ClientEventTableViewController.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/ClientEvents/ClientEventTableViewController.swift#L115

Added line #L115 was not covered by tests
switch changes {
case .initial: reloadData()
case let .update(_, deletions, insertions, updates):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
from row: RowOf<LocationHistoryDetailViewController>,
in direction: LocationHistoryDetailViewController.MoveDirection
) -> ButtonRowWithPresent<LocationHistoryDetailViewController>? {
guard let indexPath = row.indexPath, let section = section else {
guard let indexPath = row.indexPath, let section else {

Check warning on line 85 in Sources/App/ClientEvents/LocationHistoryListViewController.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/ClientEvents/LocationHistoryListViewController.swift#L85

Added line #L85 was not covered by tests
return nil
}

Expand All @@ -94,7 +94,7 @@
default: nextIndex = nil
}

if let nextIndex = nextIndex {
if let nextIndex {

Check warning on line 97 in Sources/App/ClientEvents/LocationHistoryListViewController.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/ClientEvents/LocationHistoryListViewController.swift#L97

Added line #L97 was not covered by tests
return section[nextIndex] as? ButtonRowWithPresent<LocationHistoryDetailViewController>
} else {
return nil
Expand All @@ -112,7 +112,7 @@
_ controller: LocationHistoryDetailViewController,
move direction: LocationHistoryDetailViewController.MoveDirection
) {
guard let navigationController = navigationController,
guard let navigationController,

Check warning on line 115 in Sources/App/ClientEvents/LocationHistoryListViewController.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/ClientEvents/LocationHistoryListViewController.swift#L115

Added line #L115 was not covered by tests
let nextRow = row(from: controller.row, in: direction),
let nextController = nextRow.presentationMode?.makeController() else {
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

override init() {
super.init()
syncStates = PerServerContainer<LocalPushStateSync>(constructor: { server in
self.syncStates = PerServerContainer<LocalPushStateSync>(constructor: { server in

Check warning on line 65 in Sources/App/Notifications/NotificationManagerLocalPushInterfaceExtension.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/Notifications/NotificationManagerLocalPushInterfaceExtension.swift#L65

Added line #L65 was not covered by tests
let sync = LocalPushStateSync(settingsKey: PushProviderConfiguration.defaultSettingsKey(for: server))
let token = sync.observe { [weak self] _ in
self?.notifyObservers(for: [server])
Expand Down Expand Up @@ -93,7 +93,7 @@
Current.Log.info("configuring push for \(ssid): \(servers)")

let existing = managers?.first(where: { $0.matchSSIDs == [ssid] })
if let existing = existing {
if let existing {

Check warning on line 96 in Sources/App/Notifications/NotificationManagerLocalPushInterfaceExtension.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/Notifications/NotificationManagerLocalPushInterfaceExtension.swift#L96

Added line #L96 was not covered by tests
usedManagers.insert(existing)
}
updatedManagers.append(updateManager(
Expand Down
4 changes: 2 additions & 2 deletions Sources/App/Onboarding/API/OnboardingAuthError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
extraInfo = nil
}

if let extraInfo = extraInfo {
if let extraInfo {

Check warning on line 95 in Sources/App/Onboarding/API/OnboardingAuthError.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/Onboarding/API/OnboardingAuthError.swift#L95

Added line #L95 was not covered by tests
return extraInfo + "\n\n" + underlying.localizedDescription
} else {
return underlying.localizedDescription
Expand All @@ -101,7 +101,7 @@
}

var responseString: String? {
guard let data = data, let dataString = String(data: data, encoding: .utf8) else {
guard let data, let dataString = String(data: data, encoding: .utf8) else {

Check warning on line 104 in Sources/App/Onboarding/API/OnboardingAuthError.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/Onboarding/API/OnboardingAuthError.swift#L104

Added line #L104 was not covered by tests
return nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class OnboardingAuthStepConnectivity: NSObject, OnboardingAuthPreStep, URLSessio
let (requestPromise, requestResolver) = Promise<(data: Data, response: URLResponse)>.pending()

let task = session.dataTask(with: authDetails.url) { data, response, error in
if let data = data, let response = response {
if let data, let response {
requestResolver.fulfill((data, response))
} else {
requestResolver.resolve(nil, error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ struct OnboardingAuthStepDuplicate: OnboardingAuthPostStep {
handler: { [self] _ in
let name = alert.textFields?.first?.text?.trimmingCharacters(in: .whitespaces)

guard let name = name, name.isEmpty == false,
guard let name, name.isEmpty == false,
!registeredDevices.contains(where: { $0.matches(name: name) }) else {
promptForDeviceName(
deviceName: deviceName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@

let alert = UIAlertController(
title: L10n.Onboarding.ManualSetup.CouldntMakeUrl.title,
message: L10n.Onboarding.ManualSetup.CouldntMakeUrl.message(self.urlField.text ?? ""),
message: L10n.Onboarding.ManualSetup.CouldntMakeUrl.message(urlField.text ?? ""),

Check warning on line 178 in Sources/App/Onboarding/Screens/OnboardingManualURLViewController.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/Onboarding/Screens/OnboardingManualURLViewController.swift#L178

Added line #L178 was not covered by tests
preferredStyle: .alert
)
alert.addAction(UIAlertAction(title: L10n.okLabel, style: UIAlertAction.Style.default, handler: nil))
Expand Down Expand Up @@ -266,7 +266,7 @@
}

@objc private func keyboardWillChangeFrame(_ note: Notification) {
guard let scrollView = scrollView,
guard let scrollView,

Check warning on line 269 in Sources/App/Onboarding/Screens/OnboardingManualURLViewController.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/Onboarding/Screens/OnboardingManualURLViewController.swift#L269

Added line #L269 was not covered by tests
let frameValue = note.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue else {
return
}
Expand Down
8 changes: 4 additions & 4 deletions Sources/App/QRCodeScanner/Camera/BarcodeScannerCamera.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

private var captureDevice: AVCaptureDevice? {
didSet {
guard let captureDevice = captureDevice else { return }
guard let captureDevice else { return }

Check warning on line 36 in Sources/App/QRCodeScanner/Camera/BarcodeScannerCamera.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/QRCodeScanner/Camera/BarcodeScannerCamera.swift#L36

Added line #L36 was not covered by tests
Current.Log.info("Using capture device: \(captureDevice.localizedName)")
sessionQueue.async {
self.updateSessionForCaptureDevice(captureDevice)
Expand Down Expand Up @@ -79,7 +79,7 @@
}

guard
let captureDevice = captureDevice,
let captureDevice,

Check warning on line 82 in Sources/App/QRCodeScanner/Camera/BarcodeScannerCamera.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/QRCodeScanner/Camera/BarcodeScannerCamera.swift#L82

Added line #L82 was not covered by tests
let deviceInput = try? AVCaptureDeviceInput(device: captureDevice) else {
Current.Log.error("Failed to obtain video input.")
return
Expand Down Expand Up @@ -199,14 +199,14 @@
if isCaptureSessionConfigured {
if !captureSession.isRunning {
sessionQueue.async { [self] in
self.captureSession.startRunning()
captureSession.startRunning()

Check warning on line 202 in Sources/App/QRCodeScanner/Camera/BarcodeScannerCamera.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/QRCodeScanner/Camera/BarcodeScannerCamera.swift#L202

Added line #L202 was not covered by tests
}
}
return
}

sessionQueue.async { [self] in
self.configureCaptureSession { success in
configureCaptureSession { success in

Check warning on line 209 in Sources/App/QRCodeScanner/Camera/BarcodeScannerCamera.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/QRCodeScanner/Camera/BarcodeScannerCamera.swift#L209

Added line #L209 was not covered by tests
guard success else { return }
self.captureSession.startRunning()
}
Expand Down
6 changes: 3 additions & 3 deletions Sources/App/Scenes/SceneManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
}
}

func resolve<T>(with possible: T) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this done by SwiftLint/swiftformat?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it was done by swiftformat. I can create a rule that does not do this change.

func resolve(with possible: some Any) {

Check warning on line 60 in Sources/App/Scenes/SceneManager.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/Scenes/SceneManager.swift#L60

Added line #L60 was not covered by tests
handleBlock(possible)
}
}
Expand All @@ -77,13 +77,13 @@

init() {
Current.realmFatalPresentation = { [weak self] viewController in
guard let self = self else { return }
guard let self else { return }

Check warning on line 80 in Sources/App/Scenes/SceneManager.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/Scenes/SceneManager.swift#L80

Added line #L80 was not covered by tests

let under = UIViewController()
under.view.backgroundColor = .black
under.modalPresentationStyle = .fullScreen

self.webViewWindowControllerPromise.done { parent in
webViewWindowControllerPromise.done { parent in

Check warning on line 86 in Sources/App/Scenes/SceneManager.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/Scenes/SceneManager.swift#L86

Added line #L86 was not covered by tests
parent.present(under, animated: false, completion: {
under.present(viewController, animated: true, completion: nil)
})
Expand Down
4 changes: 2 additions & 2 deletions Sources/App/Scenes/SettingsSceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@objc class SettingsSceneDelegate: BasicSceneDelegate {
private var navigationController: UINavigationController? {
didSet {
if let navigationController = navigationController {
if let navigationController {

Check warning on line 9 in Sources/App/Scenes/SettingsSceneDelegate.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/Scenes/SettingsSceneDelegate.swift#L9

Added line #L9 was not covered by tests
navigationController.delegate = self
update(navigationController: navigationController)
}
Expand Down Expand Up @@ -155,7 +155,7 @@
}

fileprivate func selectItemForIdentifier(_ identifier: NSToolbarItem.Identifier) {
if let viewController = viewController(for: identifier), let navigationController = navigationController {
if let viewController = viewController(for: identifier), let navigationController {
scene?.title = SettingsRootDataSource.buttonRows.first(where: { $0.tag == identifier.rawValue })?.title

// before, so it can be reset by the controller
Expand Down
2 changes: 1 addition & 1 deletion Sources/App/Scenes/WindowScenesManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ final class WindowScenesManager {
}

// Create cascade effect so windows don't overlap
internal func adjustedSystemFrame(
func adjustedSystemFrame(
_ systemFrame: CGRect,
for screenSize: CGSize,
numberOfConnectedScenes: Int
Expand Down
2 changes: 1 addition & 1 deletion Sources/App/Servers/ServerSelectViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
private func setupForm() {
form.removeAll()

if let prompt = prompt, !prompt.isEmpty {
if let prompt, !prompt.isEmpty {

Check warning on line 80 in Sources/App/Servers/ServerSelectViewController.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/Servers/ServerSelectViewController.swift#L80

Added line #L80 was not covered by tests
form +++ InfoLabelRow {
$0.title = prompt
}
Expand Down
8 changes: 4 additions & 4 deletions Sources/App/Settings/ActionConfigurator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

self.isModalInPresentation = true

if let action = action {
if let action {

Check warning on line 31 in Sources/App/Settings/ActionConfigurator.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/Settings/ActionConfigurator.swift#L31

Added line #L31 was not covered by tests
self.action = Action(value: action)
self.newAction = false
} else if let firstServer = Current.servers.all.first {
Expand Down Expand Up @@ -61,8 +61,8 @@
guard let self else { return }
cell.backgroundColor = UIColor.clear
cell.preservesSuperviewLayoutMargins = false
self.updatePreviews()
cell.view = self.preview
updatePreviews()
cell.view = preview

Check warning on line 65 in Sources/App/Settings/ActionConfigurator.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/Settings/ActionConfigurator.swift#L64-L65

Added lines #L64 - L65 were not covered by tests
}

let firstSection = Section()
Expand Down Expand Up @@ -369,7 +369,7 @@
}

@objc func handleGesture(gesture: UITapGestureRecognizer) {
guard let action = action,
guard let action,

Check warning on line 372 in Sources/App/Settings/ActionConfigurator.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/Settings/ActionConfigurator.swift#L372

Added line #L372 was not covered by tests
let server = Current.servers.server(forServerIdentifier: action.serverIdentifier) else {
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@

return ComplicationEditViewController(config: complication)
}, onDismiss: { [weak self] vc in
guard let self = self, let vc = vc as? ComplicationEditViewController else { return }
guard let self, let vc = vc as? ComplicationEditViewController else { return }

Check warning on line 77 in Sources/App/Settings/AppleWatch/ComplicationFamilySelectViewController.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/Settings/AppleWatch/ComplicationFamilySelectViewController.swift#L77

Added line #L77 was not covered by tests

if vc.config.realm == nil {
// not saved
self.navigationController?.popViewController(animated: true)
navigationController?.popViewController(animated: true)

Check warning on line 81 in Sources/App/Settings/AppleWatch/ComplicationFamilySelectViewController.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/Settings/AppleWatch/ComplicationFamilySelectViewController.swift#L81

Added line #L81 was not covered by tests
} else {
// saved
self.onDismissCallback?(self)
onDismissCallback?(self)

Check warning on line 84 in Sources/App/Settings/AppleWatch/ComplicationFamilySelectViewController.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/Settings/AppleWatch/ComplicationFamilySelectViewController.swift#L84

Added line #L84 was not covered by tests
}
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
let manager = Current.notificationManager.localPushManager

let updateValue = { [weak row, server] in
guard let row = row else { return }
guard let row else { return }

Check warning on line 77 in Sources/App/Settings/Connection/ConnectionSettingsViewController.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/Settings/Connection/ConnectionSettingsViewController.swift#L77

Added line #L77 was not covered by tests
switch manager.status(for: server) {
case .disabled:
row.value = L10n.SettingsDetails.Notifications.LocalPush.Status.disabled
Expand Down Expand Up @@ -124,7 +124,7 @@
var timer: Timer?

$0.onChange { [server] row in
if let timer = timer, timer.isValid {
if let timer, timer.isValid {

Check warning on line 127 in Sources/App/Settings/Connection/ConnectionSettingsViewController.swift

View check run for this annotation

Codecov / codecov/patch

Sources/App/Settings/Connection/ConnectionSettingsViewController.swift#L127

Added line #L127 was not covered by tests
timer.fireDate = Current.date().addingTimeInterval(1.0)
} else {
timer = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: false, block: { _ in
Expand Down
Loading
Loading