~ Basics of Swift 6 conformance

This commit is contained in:
David Bureš 2024-09-18 23:10:08 +02:00
parent edab27b7cb
commit 0466611cea
11 changed files with 30 additions and 29 deletions

View File

@ -522,7 +522,7 @@ struct ContentView: View, Sendable
Text("action.use-without-notifications")
}
case .couldNotRemoveTapDueToPackagesFromItStillBeingInstalled(let offendingTapProhibitingRemovalOfTap):
case .couldNotRemoveTapDueToPackagesFromItStillBeingInstalled(_):
EmptyView()
case .couldNotParseTopPackages:
@ -564,7 +564,7 @@ struct ContentView: View, Sendable
case .couldNotGetWorkingDirectory:
EmptyView()
case .couldNotDumpBrewfile(error: let error):
case .couldNotDumpBrewfile(error: _):
EmptyView()
case .couldNotReadBrewfile:

View File

@ -25,7 +25,7 @@ enum PackageType: String, CustomStringConvertible, Plottable, AppEntity, Codable
}
}
static var typeDisplayRepresentation: TypeDisplayRepresentation = .init(name: "package-details.type")
static let typeDisplayRepresentation: TypeDisplayRepresentation = .init(name: "package-details.type")
var displayRepresentation: DisplayRepresentation
{

View File

@ -29138,25 +29138,25 @@
"few" : {
"stringUnit" : {
"state" : "translated",
"value" : "%ld службы"
"value" : "%lld службы"
}
},
"many" : {
"stringUnit" : {
"state" : "translated",
"value" : "%ld служб"
"value" : "%lld служб"
}
},
"one" : {
"stringUnit" : {
"state" : "translated",
"value" : "%ld служба"
"value" : "%lld служба"
}
},
"other" : {
"stringUnit" : {
"state" : "translated",
"value" : "%ld служб"
"value" : "%lld служб"
}
}
}

View File

@ -11,11 +11,11 @@ import CorkShared
struct GetInstalledCasksIntent: AppIntent
{
static var title: LocalizedStringResource = "intent.get-installed-casks.title"
static var description: LocalizedStringResource = "intent.get-installed-casks.description"
static let title: LocalizedStringResource = "intent.get-installed-casks.title"
static let description: LocalizedStringResource = "intent.get-installed-casks.description"
static var isDiscoverable: Bool = true
static var openAppWhenRun: Bool = false
static let isDiscoverable: Bool = true
static let openAppWhenRun: Bool = false
func perform() async throws -> some ReturnsValue<[MinimalHomebrewPackage]>
{

View File

@ -28,11 +28,11 @@ struct GetInstalledFormulaeIntent: AppIntent
@Parameter(title: "intent.get-installed-packages.limit-to-manually-installed-packages")
var getOnlyManuallyInstalledPackages: Bool
static var title: LocalizedStringResource = "intent.get-installed-formulae.title"
static var description: LocalizedStringResource = "intent.get-installed-formulae.description"
static let title: LocalizedStringResource = "intent.get-installed-formulae.title"
static let description: LocalizedStringResource = "intent.get-installed-formulae.description"
static var isDiscoverable: Bool = true
static var openAppWhenRun: Bool = false
static let isDiscoverable: Bool = true
static let openAppWhenRun: Bool = false
func perform() async throws -> some ReturnsValue<[MinimalHomebrewPackage]>
{

View File

@ -13,11 +13,11 @@ struct GetInstalledPackagesIntent: AppIntent
@Parameter(title: "intent.get-installed-packages.limit-to-manually-installed-packages")
var getOnlyManuallyInstalledPackages: Bool
static var title: LocalizedStringResource = "intent.get-installed-packages.title"
static var description: LocalizedStringResource = "intent.get-installed-packages.description"
static let title: LocalizedStringResource = "intent.get-installed-packages.title"
static let description: LocalizedStringResource = "intent.get-installed-packages.description"
static var isDiscoverable: Bool = true
static var openAppWhenRun: Bool = false
static let isDiscoverable: Bool = true
static let openAppWhenRun: Bool = false
func perform() async throws -> some ReturnsValue<[MinimalHomebrewPackage]>
{

View File

@ -15,9 +15,9 @@ enum RefreshIntentResult: String, AppEnum
case refreshedWithErrors
case failed
static var typeDisplayRepresentation: TypeDisplayRepresentation = .init(name: "intent.refresh.result.display-representation")
static let typeDisplayRepresentation: TypeDisplayRepresentation = .init(name: "intent.refresh.result.display-representation")
static var caseDisplayRepresentations: [RefreshIntentResult: DisplayRepresentation] = [
static let caseDisplayRepresentations: [RefreshIntentResult: DisplayRepresentation] = [
.refreshed: DisplayRepresentation(title: "intent.refresh.result.refreshed"),
.refreshedWithErrors: DisplayRepresentation(title: "intent.refresh.result.refreshed-with-errors"),
.failed: DisplayRepresentation(title: "intent.refresh.result.failed")
@ -26,11 +26,11 @@ enum RefreshIntentResult: String, AppEnum
struct RefreshPackagesIntent: AppIntent
{
static var title: LocalizedStringResource = "intent.refresh.title"
static var description: LocalizedStringResource = "intent.refresh.description"
static let title: LocalizedStringResource = "intent.refresh.title"
static let description: LocalizedStringResource = "intent.refresh.description"
static var isDiscoverable: Bool = true
static var openAppWhenRun: Bool = false
static let isDiscoverable: Bool = true
static let openAppWhenRun: Bool = false
func perform() async throws -> some ReturnsValue<RefreshIntentResult>
{

View File

@ -8,6 +8,7 @@
import AppKit
import Foundation
@MainActor
func switchCorkToForeground()
{
if #available(macOS 14.0, *)

View File

@ -78,7 +78,7 @@ extension BrewDataStorage
do
{
var dependencyName: String = try uninstallCommandOutput.standardError.regexMatch("(?<=required by ).*?(?=, which)")
let dependencyName: String = try uninstallCommandOutput.standardError.regexMatch("(?<=required by ).*?(?=, which)")
appState.showAlert(errorToShow: .uninstallationNotPossibleDueToDependency(packageThatTheUserIsTryingToUninstall: package, offendingDependencyProhibitingUninstallation: dependencyName))

View File

@ -20,7 +20,7 @@ struct MinimalHomebrewPackage: Identifiable, Hashable, AppEntity
var installedIntentionally: Bool
static var typeDisplayRepresentation: TypeDisplayRepresentation = .init(name: "intents.type.minimal-homebrew-package")
static let typeDisplayRepresentation: TypeDisplayRepresentation = .init(name: "intents.type.minimal-homebrew-package")
var displayRepresentation: DisplayRepresentation
{
@ -30,7 +30,7 @@ struct MinimalHomebrewPackage: Identifiable, Hashable, AppEntity
)
}
static var defaultQuery: MinimalHomebrewPackageIntentQuery = .init()
static let defaultQuery: MinimalHomebrewPackageIntentQuery = .init()
}
struct MinimalHomebrewPackageIntentQuery: EntityQuery

View File

@ -7,7 +7,7 @@
import Foundation
import OSLog
import UserNotifications
@preconcurrency import UserNotifications
public struct AppConstants
{