Skip to content

Commit

Permalink
Merge pull request #549 from nimblehq/chore/548-fix-lints-after-gener…
Browse files Browse the repository at this point in the history
…ating-project

[#548] [Chore] Fix lints after generating project
  • Loading branch information
blyscuit authored Dec 15, 2023
2 parents a9b5099 + 8de90be commit c3d8ddc
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .swiftformat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# file options
--exclude Pods, Generated, **/*.generated.swift, fastlane/swift
--exclude Pods, Generated, **/*.generated.swift, fastlane/swift, ArkanaKeys

# rules
--disable fileHeader
Expand Down
2 changes: 1 addition & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ excluded:
- Pods
- Derived
- DerivedData
- ArkanaKeys

opt_in_rules:
- anyobject_protocol
- array_init
- attributes
- closure_body_length
Expand Down
14 changes: 7 additions & 7 deletions fastlane/Constants/Constant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ extension Constant {
let outputDirectoryURL = URL(fileURLWithPath: Constant.outputPath)
return outputDirectoryURL.appendingPathComponent(productName + ".app" + Constant.dSYMSuffix).relativePath
}

var appleUsername: String {
switch self {
case .staging: return Constant.appleStagingUserName
case .production: return Constant.appleProductionUserName
}
}

var appleTeamId: String {
switch self {
case .staging: return Constant.appleStagingTeamId
Expand All @@ -148,29 +148,29 @@ extension Constant {
case appStore = "app-store"

var value: String { return rawValue }

var match: String {
switch self {
case .development: return "development"
case .adHoc: return "adhoc"
case .appStore: return "appstore"
}
}

var configuration: String {
switch self {
case .development: return "Debug"
case .adHoc, .appStore: return "Release"
}
}

var codeSignIdentity: String {
switch self {
case .development: return "iPhone Developer"
case .adHoc, . appStore: return "iPhone Distribution"
case .adHoc, .appStore: return "iPhone Distribution"
}
}

var method: String {
switch self {
case .development: return "Development"
Expand Down
4 changes: 2 additions & 2 deletions fastlane/Fastfile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Fastfile: LaneFile {
environment: .staging
)
}

func syncDevelopmentProductionCodeSigningLane() {
desc("Sync the Development match signing for the Production build")
Match.syncCodeSigning(
Expand Down Expand Up @@ -51,7 +51,7 @@ class Fastfile: LaneFile {
environment: .production
)
}

func removeKeychainLane() {
desc("Delete keychain")
Keychain.remove()
Expand Down
4 changes: 2 additions & 2 deletions fastlane/Helpers/Keychain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

import Foundation

enum Keychain {

static func create() {
Expand All @@ -19,7 +19,7 @@ enum Keychain {
timeout: 115_200
)
}

static func remove() {
deleteKeychain(
name: .userDefined(Constant.keychainName)
Expand Down
10 changes: 5 additions & 5 deletions fastlane/Helpers/Match.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,24 @@ enum Match {
}
updateCodeSigning(type: type, environment: environment)
}

static func updateCodeSigning(type: Constant.BuildType, environment: Constant.Environment) {
// Update Code signing from automatic to manual
updateCodeSigningSettings(
path: Constant.projectPath,
useAutomaticSigning: .userDefined(false),
teamId: .userDefined(environment.appleTeamId),
targets: .userDefined([Constant.projectName]),
buildConfigurations: .userDefined([Self.createBuildConfiguration(type: type, environment: environment)]),
buildConfigurations: .userDefined([createBuildConfiguration(type: type, environment: environment)]),
codeSignIdentity: .userDefined(type.codeSignIdentity),
profileName: .userDefined(Self.createProfileName(type: type, environment: environment))
profileName: .userDefined(createProfileName(type: type, environment: environment))
)
}

static func createBuildConfiguration(type: Constant.BuildType, environment: Constant.Environment) -> String {
"\(type.configuration) \(environment.rawValue)"
}

static func createProfileName(type: Constant.BuildType, environment: Constant.Environment) -> String {
"match \(type.method) \(environment.bundleId)"
}
Expand Down
4 changes: 2 additions & 2 deletions {PROJECT_NAME}KIFUITests/Sources/Utilities/KIF+Swift.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import KIF
extension KIFSpec {

static func tester(file: String = #file, _ line: Int = #line) -> KIFUITestActor {
return KIFUITestActor(inFile: file, atLine: line, delegate: kifDelegate)
KIFUITestActor(inFile: file, atLine: line, delegate: kifDelegate)
}

static func system(file: String = #file, _ line: Int = #line) -> KIFSystemTestActor {
return KIFSystemTestActor(inFile: file, atLine: line, delegate: kifDelegate)
KIFSystemTestActor(inFile: file, atLine: line, delegate: kifDelegate)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ final class NetworkAPISpec: AsyncSpec {

override class func spec() {

// swiftlint:disable closure_body_length
describe("a NetworkAPI") {

var networkAPI: NetworkAPI!
Expand Down Expand Up @@ -60,5 +61,6 @@ final class NetworkAPISpec: AsyncSpec {
}
}
}
// swiftlint:enable closure_body_length
}
}

0 comments on commit c3d8ddc

Please sign in to comment.