Skip to content

Commit fd45a89

Browse files
authored
Fix 15 SwiftLint errors blocking release workflow (#10)
- opening_brace: move opening braces to same line in computed properties - redundant_string_enum_value: remove explicit raw values matching case names - pattern_matching_keywords: move let/var outside tuples in case patterns - trailing_comma: remove trailing commas from dictionary literals
1 parent 97dfc05 commit fd45a89

File tree

6 files changed

+13
-17
lines changed

6 files changed

+13
-17
lines changed

AudioType/App/TranscriptionManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ enum TranscriptionState: Equatable {
1111
switch (lhs, rhs) {
1212
case (.idle, .idle), (.recording, .recording), (.processing, .processing):
1313
return true
14-
case (.error(let a), .error(let b)):
14+
case let (.error(a), .error(b)):
1515
return a == b
1616
default:
1717
return false

AudioType/Core/GroqEngine.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ enum GroqModel: String, CaseIterable {
1616
static var current: GroqModel {
1717
get {
1818
if let saved = UserDefaults.standard.string(forKey: "groqModel"),
19-
let model = GroqModel(rawValue: saved)
20-
{
19+
let model = GroqModel(rawValue: saved) {
2120
return model
2221
}
2322
return .whisperLargeV3
@@ -102,8 +101,7 @@ enum TranscriptionLanguage: String, CaseIterable, Identifiable {
102101
get {
103102
if let saved = UserDefaults.standard.string(
104103
forKey: "transcriptionLanguage"),
105-
let lang = TranscriptionLanguage(rawValue: saved)
106-
{
104+
let lang = TranscriptionLanguage(rawValue: saved) {
107105
return lang
108106
}
109107
return .auto

AudioType/Core/OpenAIEngine.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ enum OpenAIModel: String, CaseIterable {
1919
get {
2020
if let saved = UserDefaults.standard.string(
2121
forKey: "openaiModel"),
22-
let model = OpenAIModel(rawValue: saved)
23-
{
22+
let model = OpenAIModel(rawValue: saved) {
2423
return model
2524
}
2625
return .gpt4oMiniTranscribe

AudioType/Core/TranscriptionEngine.swift

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import Foundation
44

55
/// User-facing choice for which transcription backend to use.
66
enum TranscriptionEngineType: String, CaseIterable, Identifiable {
7-
case auto = "auto"
8-
case groq = "groq"
9-
case openAI = "openAI"
10-
case appleSpeech = "appleSpeech"
7+
case auto
8+
case groq
9+
case openAI
10+
case appleSpeech
1111

1212
var id: String { rawValue }
1313

@@ -24,8 +24,7 @@ enum TranscriptionEngineType: String, CaseIterable, Identifiable {
2424
get {
2525
if let saved = UserDefaults.standard.string(
2626
forKey: "transcriptionEngine"),
27-
let engine = TranscriptionEngineType(rawValue: saved)
28-
{
27+
let engine = TranscriptionEngineType(rawValue: saved) {
2928
return engine
3029
}
3130
return .auto

AudioType/Core/WAVEncoder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ enum WhisperAPIError: Error, LocalizedError {
160160
return "Invalid API endpoint URL."
161161
case .networkError(let message):
162162
return "Network error: \(message)"
163-
case .httpError(let code, let message):
163+
case let .httpError(code, message):
164164
return "API error (HTTP \(code)): \(message)"
165165
case .invalidResponse:
166166
return "Invalid response from API."

AudioType/Utilities/KeychainHelper.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ enum KeychainHelper {
2828
kSecAttrService as String: service,
2929
kSecAttrAccount as String: key,
3030
kSecValueData as String: data,
31-
kSecAttrAccessible as String: kSecAttrAccessibleAfterFirstUnlock,
31+
kSecAttrAccessible as String: kSecAttrAccessibleAfterFirstUnlock
3232
]
3333

3434
let status = SecItemAdd(query as CFDictionary, nil)
@@ -46,7 +46,7 @@ enum KeychainHelper {
4646
kSecAttrService as String: service,
4747
kSecAttrAccount as String: key,
4848
kSecReturnData as String: true,
49-
kSecMatchLimit as String: kSecMatchLimitOne,
49+
kSecMatchLimit as String: kSecMatchLimitOne
5050
]
5151

5252
var result: AnyObject?
@@ -68,7 +68,7 @@ enum KeychainHelper {
6868
let query: [String: Any] = [
6969
kSecClass as String: kSecClassGenericPassword,
7070
kSecAttrService as String: service,
71-
kSecAttrAccount as String: key,
71+
kSecAttrAccount as String: key
7272
]
7373

7474
let status = SecItemDelete(query as CFDictionary)

0 commit comments

Comments
 (0)