Run SwiftFormat in GH Action (#28)

This commit is contained in:
Marc Rousavy
2021-03-09 10:53:29 +01:00
committed by GitHub
parent 168ba054d1
commit 64bb6f6a2a
22 changed files with 383 additions and 234 deletions

View File

@@ -8,10 +8,14 @@
import Foundation
// MARK: - PermissionError
enum PermissionError: String {
case microphone = "microphone-permission-denied"
case camera = "camera-permission-denied"
// MARK: Internal
var code: String {
return rawValue
}
@@ -26,6 +30,8 @@ enum PermissionError: String {
}
}
// MARK: - ParameterError
enum ParameterError {
case invalid(unionName: String, receivedValue: String)
case unsupportedOS(unionName: String, receivedValue: String, supportedOnOs: String)
@@ -33,6 +39,8 @@ enum ParameterError {
case unsupportedInput(inputDescriptor: String)
case invalidCombination(provided: String, missing: String)
// MARK: Internal
var code: String {
switch self {
case .invalid:
@@ -64,6 +72,8 @@ enum ParameterError {
}
}
// MARK: - DeviceError
enum DeviceError: String {
case configureError = "configuration-error"
case noDevice = "no-device"
@@ -74,6 +84,8 @@ enum DeviceError: String {
case focusNotSupported = "focus-not-supported"
case notAvailableOnSimulator = "camera-not-available-on-simulator"
// MARK: Internal
var code: String {
return rawValue
}
@@ -100,12 +112,16 @@ enum DeviceError: String {
}
}
// MARK: - FormatError
enum FormatError {
case invalidFps(fps: Int)
case invalidHdr
case invalidFormat
case invalidPreset(preset: String)
// MARK: Internal
var code: String {
switch self {
case .invalidFormat:
@@ -133,10 +149,14 @@ enum FormatError {
}
}
// MARK: - SessionError
enum SessionError {
case cameraNotReady
case audioSessionSetupFailed(reason: String)
// MARK: Internal
var code: String {
switch self {
case .cameraNotReady:
@@ -156,6 +176,8 @@ enum SessionError {
}
}
// MARK: - CaptureError
enum CaptureError {
case invalidPhotoFormat
case recordingInProgress
@@ -165,6 +187,8 @@ enum CaptureError {
case invalidPhotoCodec
case unknown(message: String? = nil)
// MARK: Internal
var code: String {
switch self {
case .invalidPhotoFormat:
@@ -204,9 +228,13 @@ enum CaptureError {
}
}
// MARK: - SystemError
enum SystemError: String {
case noManager = "no-camera-manager"
// MARK: Internal
var code: String {
return rawValue
}
@@ -219,6 +247,8 @@ enum SystemError: String {
}
}
// MARK: - CameraError
enum CameraError: Error {
case permission(_ id: PermissionError)
case parameter(_ id: ParameterError)
@@ -229,6 +259,8 @@ enum CameraError: Error {
case system(_ id: SystemError)
case unknown(message: String? = nil)
// MARK: Internal
var code: String {
switch self {
case let .permission(id: id):