mirror of
https://github.com/mas-cli/mas
synced 2025-03-06 23:57:21 +00:00
Derive all types from assigned values instead of vice versa for consistency.
swiftlint 0.57.1. Resolve #696 Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
This commit is contained in:
parent
0831534307
commit
a536c7a00d
9 changed files with 19 additions and 19 deletions
|
@ -21,6 +21,7 @@ disabled_rules:
|
|||
- inert_defer
|
||||
- no_extension_access_modifier
|
||||
- no_grouping_extension
|
||||
- no_magic_numbers
|
||||
- prefixed_toplevel_constant
|
||||
- sorted_enum_cases
|
||||
- unused_capture_list
|
||||
|
|
|
@ -10,9 +10,9 @@ import CommerceKit
|
|||
import PromiseKit
|
||||
import StoreFoundation
|
||||
|
||||
private let downloadingPhase: Int64 = 0
|
||||
private let installingPhase: Int64 = 1
|
||||
private let downloadedPhase: Int64 = 5
|
||||
private let downloadingPhase = 0 as Int64
|
||||
private let installingPhase = 1 as Int64
|
||||
private let downloadedPhase = 5 as Int64
|
||||
|
||||
class PurchaseDownloadObserver: CKDownloadQueueObserver {
|
||||
private let purchase: SSPurchase
|
||||
|
@ -91,7 +91,6 @@ private struct ProgressState {
|
|||
let phase: String
|
||||
|
||||
var percentage: String {
|
||||
// swiftlint:disable:next no_magic_numbers
|
||||
String(format: "%.1f%%", floor(percentComplete * 1000) / 10)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,13 +12,14 @@ import StoreFoundation
|
|||
|
||||
extension SSPurchase {
|
||||
func perform(appID: AppID, purchasing: Bool) -> Promise<Void> {
|
||||
var parameters: [String: Any] = [
|
||||
"productType": "C",
|
||||
"price": 0,
|
||||
"salableAdamId": appID,
|
||||
"pg": "default",
|
||||
"appExtVrsId": 0,
|
||||
]
|
||||
var parameters =
|
||||
[
|
||||
"productType": "C",
|
||||
"price": 0,
|
||||
"salableAdamId": appID,
|
||||
"pg": "default",
|
||||
"appExtVrsId": 0,
|
||||
] as [String: Any]
|
||||
|
||||
if purchasing {
|
||||
parameters["macappinstalledconfirmed"] = 1
|
||||
|
|
|
@ -18,7 +18,7 @@ extension MAS {
|
|||
)
|
||||
|
||||
@Argument(help: ArgumentHelp("App ID/app name", valueName: "app-id-or-name"))
|
||||
var appIDOrNames: [String] = []
|
||||
var appIDOrNames = [String]()
|
||||
|
||||
/// Runs the command.
|
||||
func run() throws {
|
||||
|
|
|
@ -65,7 +65,7 @@ private func chown(paths: [String]) throws -> [String: (uid_t, gid_t)] {
|
|||
dict[path] = try getOwnerAndGroupOfItem(atPath: path)
|
||||
}
|
||||
|
||||
var chownedIDsByPath: [String: (uid_t, gid_t)] = [:]
|
||||
var chownedIDsByPath = [String: (uid_t, gid_t)]()
|
||||
for (path, ownerIDs) in ownerIDsByPath {
|
||||
guard chown(path, sudoUID, sudoGID) == 0 else {
|
||||
for (chownedPath, chownedIDs) in chownedIDsByPath
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
struct SearchResult: Decodable {
|
||||
var currentVersionReleaseDate = ""
|
||||
var fileSizeBytes = "0"
|
||||
var formattedPrice: String? = "0"
|
||||
var formattedPrice = "0" as String?
|
||||
var minimumOsVersion = ""
|
||||
var sellerName = ""
|
||||
var sellerUrl: String? = ""
|
||||
var trackId: AppID = 0
|
||||
var sellerUrl = "" as String?
|
||||
var trackId = 0 as AppID
|
||||
var trackName = ""
|
||||
var trackViewUrl = ""
|
||||
var version = ""
|
||||
|
|
|
@ -13,7 +13,6 @@ disabled_rules:
|
|||
- implicitly_unwrapped_optional
|
||||
- large_tuple
|
||||
- legacy_objc_type
|
||||
- no_magic_numbers
|
||||
- quick_discouraged_call
|
||||
- quick_discouraged_pending_test
|
||||
- required_deinit
|
||||
|
|
|
@ -14,7 +14,7 @@ import Quick
|
|||
|
||||
public final class UninstallSpec: QuickSpec {
|
||||
override public func spec() {
|
||||
let appID: AppID = 12345
|
||||
let appID = 12345 as AppID
|
||||
let app = MockSoftwareProduct(
|
||||
appName: "Some App",
|
||||
bundleIdentifier: "com.some.app",
|
||||
|
|
|
@ -71,7 +71,7 @@ public final class ITunesSearchAppStoreSearcherSpec: QuickSpec {
|
|||
|
||||
context("when lookup used") {
|
||||
it("can find slack") {
|
||||
let appID: AppID = 803_453_959
|
||||
let appID = 803_453_959 as AppID
|
||||
let networkSession = MockFromFileNetworkSession(responseFile: "lookup/slack.json")
|
||||
let searcher = ITunesSearchAppStoreSearcher(networkManager: NetworkManager(session: networkSession))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue