Skip to content

Commit e84c065

Browse files
authored
Merge pull request #1203 from rgoldberg/5.2.0/1202-parallelize
2 parents 1e662f0 + 8c097a1 commit e84c065

28 files changed

+123
-178
lines changed

.markdownlint-cli2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# .markdownlint-cli2.yaml
55
# mas
66
#
7-
# markdownlint-cli2 0.20.0 / markdownlint 0.40.0
7+
# markdownlint-cli2 0.21.0 / markdownlint 0.40.0
88
#
99
---
1010
gitignore: true

Brewfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ brew "actionlint" # 1.7.11
22
brew "gh" # 2.86.0
33
brew "git" # 2.53.0
44
brew "ipsw" # 3.1.651
5-
brew "markdownlint-cli2" # 0.20.0
5+
brew "markdownlint-cli2" # 0.21.0
66
brew "periphery" if MacOS.version >= :sequoia && `/usr/bin/arch` == "arm64" # 3.5.1
77
brew "shellcheck" # 0.11.0
88
brew "swiftformat" # 0.59.1

Package.resolved

Lines changed: 1 addition & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ _ = Package(
2020
dependencies: [
2121
.package(url: "https://github.com/KittyMac/Sextant.git", from: "0.4.38"),
2222
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.7.0"),
23-
.package(url: "https://github.com/apple/swift-async-algorithms.git", from: "1.1.2"),
2423
.package(url: "https://github.com/apple/swift-atomics.git", from: "1.3.0"),
2524
.package(url: "https://github.com/apple/swift-collections.git", from: "1.3.0"),
2625
.package(url: "https://github.com/attaswift/BigInt.git", from: "5.7.0"),
@@ -33,7 +32,6 @@ _ = Package(
3332
name: "mas",
3433
dependencies: [
3534
.product(name: "ArgumentParser", package: "swift-argument-parser"),
36-
.product(name: "AsyncAlgorithms", package: "swift-async-algorithms"),
3735
.product(name: "Atomics", package: "swift-atomics"),
3836
.product(name: "OrderedCollections", package: "swift-collections"),
3937
"BigInt",

Scripts/format

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ print_notice '🧹 Formatting' "${@}"
1616

1717
ensure_command_available markdownlint-cli2 swiftformat swiftlint
1818

19-
zmodload zsh/zutil
20-
zparseopts -D -A received_flag A
21-
2219
export -r MAS_DISTRIBUTION=format
2320

2421
printf -- $'--> 🕊​ SwiftFormat\n'
@@ -28,15 +25,8 @@ script -q /dev/null swiftformat --strict --markdown-files format-strict . |
2825
printf -- $'--> 🦅 SwiftLint\n'
2926
swiftlint --fix --quiet --reporter relative-path
3027

31-
# shellcheck disable=SC1046,SC1047,SC1072,SC1073
32-
if ! [[ -v 'received_flag[-A]' ]]; then
33-
printf -- $'--> 🔬 SwiftLint Analyze\n'
34-
# shellcheck disable=SC1036
35-
swiftlint analyze --fix --quiet --reporter relative-path --compiler-log-path\
36-
=(xcodebuild -scheme mas -destination "platform=macOS,arch=$(arch),variant=macos" 2>&1)
37-
fi
38-
3928
printf -- $'--> 〽️ Markdown\n'
29+
# shellcheck disable=SC1036
4030
markdownlint-cli2 --fix -- ***/*.md(.)
4131

4232
printf -- $'--> 🚷 Non-Executables\n'

Scripts/lint

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,19 @@
1010
# Please keep in sync with Scripts/format.
1111
#
1212

13+
# shellcheck disable=SC1036,SC1056,SC1072
1314
. "${0:A:h}/_setup_script"
1415

1516
print_notice '🚨 Linting' "${@}"
1617

1718
ensure_command_available actionlint git markdownlint-cli2 shellcheck swiftformat swiftlint yamllint || exit
1819
[[ "$(/usr/bin/arch)" = arm64 && "${$(sw_vers -productVersion)%%.*}" -ge 15 ]]
1920
integer -r can_use_periphery="$((! ?))"
20-
# shellcheck disable=SC1083
21+
# shellcheck disable=SC1073,SC1083
2122
((can_use_periphery)) && { ensure_command_available periphery || exit }
2223

2324
zmodload zsh/zutil
24-
zparseopts -D -A received_flag A P
25+
zparseopts -D -A received_flag P
2526

2627
export -r MAS_DISTRIBUTION=lint
2728

@@ -36,15 +37,6 @@ printf -- $'--> 🦅 SwiftLint\n'
3637
swiftlint --strict --quiet --reporter relative-path
3738
((exit_status |= ${?}))
3839

39-
# shellcheck disable=SC1046,SC1047,SC1072,SC1073
40-
if ! [[ -v 'received_flag[-A]' ]]; then
41-
printf -- $'--> 🔬 SwiftLint Analyze\n'
42-
# shellcheck disable=SC1036
43-
swiftlint analyze --strict --quiet --reporter relative-path --compiler-log-path\
44-
=(xcodebuild -scheme mas -destination "platform=macOS,arch=$(arch),variant=macos" 2>&1)
45-
((exit_status |= ${?}))
46-
fi
47-
4840
if ((can_use_periphery)) && ! [[ -v 'received_flag[-P]' ]]; then
4941
printf -- $'--> 🌀 Periphery\n'
5042
periphery scan --exclude-tests |

Sources/mas/AppStore/AppStoreAction+download.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,16 +356,16 @@ private actor DownloadQueueObserver: CKDownloadQueueObserver {
356356

357357
guard
358358
let appFolderURLSubstring = standardErrorString
359-
.matches(of: unsafe appFolderURLRegex) // swiftformat:disable:next preferKeyPath
360-
.compactMap({ $0.1 }) // swiftlint:disable:this prefer_key_path
359+
.matches(of: unsafe appFolderURLRegex)
360+
.compactMap(\.1)
361361
.min(by: { $0.count < $1.count })
362362
else {
363363
throw MASError.error(
364364
"Failed to find app folder URL in installer output for \(appNameAndVersion)",
365365
error: standardErrorString,
366366
)
367367
}
368-
guard let appFolderURL = URL(string: String(appFolderURLSubstring)) else {
368+
guard let appFolderURL = URL(string: .init(appFolderURLSubstring)) else {
369369
throw MASError.error(
370370
"Failed to parse app folder URL for \(appNameAndVersion) from \(appFolderURLSubstring)",
371371
error: standardErrorString,

Sources/mas/AppStore/AppStoreAction.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ enum AppStoreAction: Sendable {
4141
withAppIDs appIDs: [AppID],
4242
force: Bool,
4343
installedApps: [InstalledApp],
44-
lookupAppFromAppID: (AppID) async throws -> CatalogApp,
44+
lookupAppFromAppID: @escaping @Sendable (AppID) async throws -> CatalogApp,
4545
) async throws {
4646
try await apps(
4747
withADAMIDs: await appIDs.lookupCatalogApps(using: lookupAppFromAppID).map(\.adamID),

Sources/mas/Commands/Home.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ extension MAS {
2626
await run(lookupAppFromAppID: lookup(appID:))
2727
}
2828

29-
private func run(lookupAppFromAppID: (AppID) async throws -> CatalogApp) async {
29+
private func run(lookupAppFromAppID: @escaping @Sendable (AppID) async throws -> CatalogApp) async {
3030
await run(catalogApps: await catalogAppIDsOptionGroup.appIDs.lookupCatalogApps(using: lookupAppFromAppID))
3131
}
3232

Sources/mas/Commands/Lookup.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extension MAS {
2727
await run(lookupAppFromAppID: lookup(appID:))
2828
}
2929

30-
private func run(lookupAppFromAppID: (AppID) async throws -> CatalogApp) async {
30+
private func run(lookupAppFromAppID: @escaping @Sendable (AppID) async throws -> CatalogApp) async {
3131
run(catalogApps: await catalogAppIDsOptionGroup.appIDs.lookupCatalogApps(using: lookupAppFromAppID))
3232
}
3333

0 commit comments

Comments
 (0)