Fix coding style
Some checks failed
openium/resgen.swift/pipeline/pr-master There was a failure building this commit
Some checks failed
openium/resgen.swift/pipeline/pr-master There was a failure building this commit
This commit is contained in:
@@ -145,7 +145,7 @@ enum AnalyticsGenerator {
|
||||
) -> String {
|
||||
"""
|
||||
private var isDebugMode: Bool = false
|
||||
|
||||
|
||||
private var isEnabled: Bool {
|
||||
if ProcessInfo.processInfo.environment["XCODE_RUNNING_FOR_PREVIEWS"] == "1" {
|
||||
false
|
||||
@@ -153,7 +153,7 @@ enum AnalyticsGenerator {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private let logger = Logger(subsystem: "resgen", category: "analytics")
|
||||
|
||||
// MARK: - Enable Methods
|
||||
@@ -199,10 +199,10 @@ enum AnalyticsGenerator {
|
||||
private static func getPrivateLogFunction() -> String {
|
||||
"""
|
||||
// MARK: - Private Log Methods
|
||||
|
||||
|
||||
private func formattedParams(_ params: [String: Any]?) -> String {
|
||||
guard let params = params, !params.isEmpty else { return "-" }
|
||||
|
||||
|
||||
let formattedParams = params.map { key, value in
|
||||
" \\(key): \\(value)"
|
||||
}
|
||||
@@ -210,7 +210,7 @@ enum AnalyticsGenerator {
|
||||
|
||||
return "\\n" + formattedParams
|
||||
}
|
||||
|
||||
|
||||
private func logScreen(
|
||||
name: String,
|
||||
path: String,
|
||||
@@ -220,11 +220,11 @@ enum AnalyticsGenerator {
|
||||
if isDebugMode {
|
||||
logger.log("Analytics disabled")
|
||||
}
|
||||
return
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
managers.values.forEach { manager in
|
||||
|
||||
|
||||
if isDebugMode {
|
||||
logger.debug(\"""
|
||||
🖥️ Screen:
|
||||
@@ -233,7 +233,7 @@ enum AnalyticsGenerator {
|
||||
Params: \\(self.formattedParams(params), privacy: .public)
|
||||
\""")
|
||||
}
|
||||
|
||||
|
||||
manager.logScreen(
|
||||
name: name,
|
||||
path: path,
|
||||
@@ -241,7 +241,7 @@ enum AnalyticsGenerator {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private func logEvent(
|
||||
name: String,
|
||||
action: String,
|
||||
@@ -254,7 +254,7 @@ enum AnalyticsGenerator {
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
managers.values.forEach { manager in
|
||||
|
||||
if isDebugMode {
|
||||
@@ -266,7 +266,7 @@ enum AnalyticsGenerator {
|
||||
Params: \\(self.formattedParams(params), privacy: .public)
|
||||
\""")
|
||||
}
|
||||
|
||||
|
||||
manager.logEvent(
|
||||
name: name,
|
||||
action: action,
|
||||
|
||||
@@ -16,12 +16,14 @@ struct GenerateOptions: ParsableArguments {
|
||||
@Argument(help: "Configuration file.", transform: { $0.replaceTiltWithHomeDirectoryPath() })
|
||||
var configurationFile: String
|
||||
|
||||
@Option(help: "Project directory. It will be added to every relative path (path that does not start with `/`",
|
||||
transform: {
|
||||
if $0.last == "/" {
|
||||
return $0
|
||||
@Option(
|
||||
help: "Project directory. It will be added to every relative path (path that does not start with `/`",
|
||||
transform: {
|
||||
if $0.last == "/" {
|
||||
return $0
|
||||
}
|
||||
return $0 + "/"
|
||||
}
|
||||
return $0 + "/"
|
||||
})
|
||||
)
|
||||
var projectDirectory: String
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user