Skip to content

Commit 00c9c7e

Browse files
authored
Merge branch 'main' into dependabot/github_actions/actions/checkout-4
2 parents c509e01 + 85a31ed commit 00c9c7e

File tree

16 files changed

+34
-30
lines changed

16 files changed

+34
-30
lines changed

.github/workflows/build-test.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,10 @@ jobs:
2828

2929
name: Build, Test, and Lint
3030

31-
# GitHub provided runners (in case we need to switch back)
31+
# https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source
3232
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
33-
# runs-on: macos-latest
34-
35-
# https://docs.github.com/en/actions/hosting-your-own-runners/using-self-hosted-runners-in-a-workflow
36-
# https://github.com/mas-cli/mas/settings/actions/runners
37-
runs-on: [self-hosted, macOS]
33+
# https://github.com/mas-cli/mas/actions/runners
34+
runs-on: macos-14
3835

3936
steps:
4037
# https://github.com/actions/checkout#usage

Package.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ let package = Package(
7171
)
7272

7373
// https://github.com/apple/swift-format#matching-swift-format-to-your-swift-version-swift-57-and-earlier
74-
#if compiler(>=5.7)
74+
#if compiler(>=5.8)
75+
package.dependencies += [
76+
.package(url: "https://github.com/apple/swift-format", .branch("release/5.9"))
77+
]
78+
#elseif compiler(>=5.7)
7579
package.dependencies += [
7680
.package(url: "https://github.com/apple/swift-format", .branch("release/5.7"))
7781
]

Sources/MasKit/AppStore/Downloader.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ private func download(_ appID: UInt64, purchase: Bool = false) -> Promise<Void>
8181
return Promise<SSPurchase> { seal in
8282
let purchase = SSPurchase(adamId: appID, account: storeAccount, purchase: purchase)
8383
purchase.perform { purchase, _, error, response in
84-
if let error = error {
84+
if let error {
8585
seal.reject(MASError.purchaseFailed(error: error as NSError?))
8686
return
8787
}
8888

89-
guard response?.downloads.isEmpty == false, let purchase = purchase else {
89+
guard response?.downloads.isEmpty == false, let purchase else {
9090
print("No downloads")
9191
seal.reject(MASError.noDownloads)
9292
return

Sources/MasKit/AppStore/SSPurchase.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ extension SSPurchase {
4141

4242
itemIdentifier = adamId
4343

44-
if let account = account {
44+
if let account {
4545
accountIdentifier = account.dsID
4646
appleID = account.identifier
4747
}

Sources/MasKit/Commands/Outdated.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public struct OutdatedCommand: CommandProtocol {
4141
firstly {
4242
storeSearch.lookup(app: installedApp.itemIdentifier.intValue)
4343
}.done { storeApp in
44-
guard let storeApp = storeApp else {
44+
guard let storeApp else {
4545
if options.verbose {
4646
printWarning(
4747
"""

Sources/MasKit/Commands/Uninstall.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Upgrade.swift
2+
// Uninstall.swift
33
// mas-cli
44
//
55
// Created by Ben Chatelain on 2018-12-27.

Sources/MasKit/Controllers/MasStoreSearch.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class MasStoreSearch: StoreSearch {
7676
return firstly {
7777
self.scrapeVersionFromPage(pageUrl)
7878
}.done { pageVersion in
79-
if let pageVersion = pageVersion, pageVersion > searchVersion {
79+
if let pageVersion, pageVersion > searchVersion {
8080
results[index].version = pageVersion.description
8181
}
8282
}

Sources/MasKit/Controllers/StoreSearch.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ extension StoreSearch {
3232
URLQueryItem(name: "term", value: appName),
3333
]
3434

35-
if let country = country {
35+
if let country {
3636
components.queryItems!.append(country)
3737
}
3838

@@ -48,9 +48,12 @@ extension StoreSearch {
4848
return nil
4949
}
5050

51-
components.queryItems = [URLQueryItem(name: "id", value: "\(appId)")]
51+
components.queryItems = [
52+
URLQueryItem(name: "id", value: "\(appId)"),
53+
URLQueryItem(name: "entity", value: "desktopSoftware"),
54+
]
5255

53-
if let country = country {
56+
if let country {
5457
components.queryItems!.append(country)
5558
}
5659

Sources/MasKit/Errors/MASError.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// MAError.swift
2+
// MASError.swift
33
// mas-cli
44
//
55
// Created by Andrew Naylor on 21/08/2015.
@@ -47,7 +47,7 @@ extension MASError: CustomStringConvertible {
4747
"""
4848

4949
case .signInFailed(let error):
50-
if let error = error {
50+
if let error {
5151
return "Sign in failed: \(error.localizedDescription)"
5252
} else {
5353
return "Sign in failed"
@@ -57,14 +57,14 @@ extension MASError: CustomStringConvertible {
5757
return "Already signed in"
5858

5959
case .purchaseFailed(let error):
60-
if let error = error {
60+
if let error {
6161
return "Download request failed: \(error.localizedDescription)"
6262
} else {
6363
return "Download request failed"
6464
}
6565

6666
case .downloadFailed(let error):
67-
if let error = error {
67+
if let error {
6868
return "Download failed: \(error.localizedDescription)"
6969
} else {
7070
return "Download failed"

Sources/MasKit/Formatters/AppInfoFormatter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import Foundation
1010

1111
/// Formats text output for the info command.
12-
struct AppInfoFormatter {
12+
enum AppInfoFormatter {
1313
/// Formats text output with app info.
1414
///
1515
/// - Parameter app: Search result with app data.

Sources/MasKit/Formatters/AppListFormatter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import Foundation
1010

1111
/// Formats text output for the search command.
12-
struct AppListFormatter {
12+
enum AppListFormatter {
1313
static let idColumnMinWidth = 10
1414
static let nameColumnMinWidth = 50
1515

Sources/MasKit/Formatters/SearchResultFormatter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import Foundation
1010

1111
/// Formats text output for the search command.
12-
struct SearchResultFormatter {
12+
enum SearchResultFormatter {
1313
/// Formats text output with search results.
1414
///
1515
/// - Parameter results: Search results with app data

Sources/MasKit/Formatters/Utilities.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ let csi = "\u{001B}["
4343
Swift.print(terminator, terminator: "")
4444
}
4545

46-
func print<Target>(
46+
func print(
4747
_ items: Any...,
4848
separator: String = " ",
4949
terminator: String = "\n",
50-
to output: inout Target
51-
) where Target: TextOutputStream {
50+
to output: inout some TextOutputStream
51+
) {
5252
if let observer = printObserver {
5353
let output =
5454
items

Sources/MasKit/Network/URLSession+NetworkSession.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ extension URLSession: NetworkSession {
1313
public func loadData(from url: URL) -> Promise<Data> {
1414
Promise { seal in
1515
dataTask(with: url) { data, _, error in
16-
if let data = data {
16+
if let data {
1717
seal.fulfill(data)
18-
} else if let error = error {
18+
} else if let error {
1919
seal.reject(error)
2020
} else {
2121
seal.reject(MASError.noData)

Tests/MasKitTests/Network/NetworkSessionMock.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class NetworkSessionMock: NetworkSession {
2424
/// - url: unused
2525
/// - completionHandler: Closure which is delivered either data or an error.
2626
func loadData(from _: URL) -> Promise<Data> {
27-
guard let data = data else {
27+
guard let data else {
2828
return Promise(error: error ?? MASError.noData)
2929
}
3030

Tests/MasKitTests/Nimble/ResultPredicates.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// ResultPreticates.swift
2+
// ResultPredicates.swift
33
// MasKitTests
44
//
55
// Created by Ben Chatelain on 12/27/18.

0 commit comments

Comments
 (0)