Fix all SwiftLint violations across codebase

Resolves 130+ violations including deployment target checks, code style issues, and formatting inconsistencies. Adds SwiftLint disable comments for compiler-required availability checks while maintaining deployment target compliance.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Arkadiusz Fal
2025-11-09 17:56:15 +01:00
parent 4840c9a05f
commit be4e1adb9b
58 changed files with 257 additions and 303 deletions

View File

@@ -84,13 +84,14 @@ struct AdvancedSettings: View {
Text("cache-pause-initial")
#if !os(tvOS)
Image(systemName: "link")
.accessibilityAddTraits([.isButton, .isLink])
.font(.footnote)
#if os(iOS)
.accessibilityAddTraits([.isButton, .isLink])
.onTapGesture {
UIApplication.shared.open(URL(string: "https://mpv.io/manual/stable/#options-cache-pause-initial")!)
}
#elseif os(macOS)
.accessibilityAddTraits([.isButton, .isLink])
.onTapGesture {
NSWorkspace.shared.open(URL(string: "https://mpv.io/manual/stable/#options-cache-pause-initial")!)
}
@@ -104,13 +105,14 @@ struct AdvancedSettings: View {
Text("cache-secs")
#if !os(tvOS)
Image(systemName: "link")
.accessibilityAddTraits([.isButton, .isLink])
.font(.footnote)
#if os(iOS)
.accessibilityAddTraits([.isButton, .isLink])
.onTapGesture {
UIApplication.shared.open(URL(string: "https://mpv.io/manual/stable/#options-cache-secs")!)
}
#elseif os(macOS)
.accessibilityAddTraits([.isButton, .isLink])
.onTapGesture {
NSWorkspace.shared.open(URL(string: "https://mpv.io/manual/stable/#options-cache-secs")!)
}
@@ -130,13 +132,14 @@ struct AdvancedSettings: View {
Text("cache-pause-wait")
#if !os(tvOS)
Image(systemName: "link")
.accessibilityAddTraits([.isButton, .isLink])
.font(.footnote)
#if os(iOS)
.accessibilityAddTraits([.isButton, .isLink])
.onTapGesture {
UIApplication.shared.open(URL(string: "https://mpv.io/manual/stable/#options-cache-pause-wait")!)
}
#elseif os(macOS)
.accessibilityAddTraits([.isButton, .isLink])
.onTapGesture {
NSWorkspace.shared.open(URL(string: "https://mpv.io/manual/stable/#options-cache-pause-wait")!)
}
@@ -157,13 +160,14 @@ struct AdvancedSettings: View {
Text("deinterlace")
#if !os(tvOS)
Image(systemName: "link")
.accessibilityAddTraits([.isButton, .isLink])
.font(.footnote)
#if os(iOS)
.accessibilityAddTraits([.isButton, .isLink])
.onTapGesture {
UIApplication.shared.open(URL(string: "https://mpv.io/manual/stable/#options-deinterlace")!)
}
#elseif os(macOS)
.accessibilityAddTraits([.isButton, .isLink])
.onTapGesture {
NSWorkspace.shared.open(URL(string: "https://mpv.io/manual/stable/#options-deinterlace")!)
}
@@ -178,13 +182,14 @@ struct AdvancedSettings: View {
Text("initial-audio-sync")
#if !os(tvOS)
Image(systemName: "link")
.accessibilityAddTraits([.isButton, .isLink])
.font(.footnote)
#if os(iOS)
.accessibilityAddTraits([.isButton, .isLink])
.onTapGesture {
UIApplication.shared.open(URL(string: "https://mpv.io/manual/stable/#options-initial-audio-sync")!)
}
#elseif os(macOS)
.accessibilityAddTraits([.isButton, .isLink])
.onTapGesture {
NSWorkspace.shared.open(URL(string: "https://mpv.io/manual/stable/#options-initial-audio-sync")!)
}
@@ -199,13 +204,14 @@ struct AdvancedSettings: View {
#if !os(tvOS)
Image(systemName: "link")
.accessibilityAddTraits([.isButton, .isLink])
.font(.footnote)
#if os(iOS)
.accessibilityAddTraits([.isButton, .isLink])
.onTapGesture {
UIApplication.shared.open(URL(string: "https://mpv.io/manual/stable/#options-hwdec")!)
}
#elseif os(macOS)
.accessibilityAddTraits([.isButton, .isLink])
.onTapGesture {
NSWorkspace.shared.open(URL(string: "https://mpv.io/manual/stable/#options-hwdec")!)
}
@@ -228,13 +234,14 @@ struct AdvancedSettings: View {
#if !os(tvOS)
Image(systemName: "link")
.accessibilityAddTraits([.isButton, .isLink])
.font(.footnote)
#if os(iOS)
.accessibilityAddTraits([.isButton, .isLink])
.onTapGesture {
UIApplication.shared.open(URL(string: "https://mpv.io/manual/stable/#options-demuxer-lavf-probe-info")!)
}
#elseif os(macOS)
.accessibilityAddTraits([.isButton, .isLink])
.onTapGesture {
NSWorkspace.shared.open(URL(string: "https://mpv.io/manual/stable/#options-demuxer-lavf-probe-info")!)
}

View File

@@ -221,12 +221,12 @@ struct HistorySettings: View {
.labelStyle(.iconOnly)
.padding(7)
.foregroundColor(limitRecents ? .accentColor : .gray)
.accessibilityAddTraits(.isButton)
#if os(iOS)
.frame(minHeight: 35)
.background(RoundedRectangle(cornerRadius: 4).strokeBorder(lineWidth: 1).foregroundColor(.accentColor))
#endif
.contentShape(Rectangle())
.accessibilityAddTraits(.isButton)
.onTapGesture {
value.wrappedValue -= 1
}
@@ -253,11 +253,11 @@ struct HistorySettings: View {
.labelStyle(.iconOnly)
.padding(7)
.foregroundColor(limitRecents ? .accentColor : .gray)
.accessibilityAddTraits(.isButton)
#if os(iOS)
.background(RoundedRectangle(cornerRadius: 4).strokeBorder(lineWidth: 1).foregroundColor(.accentColor))
#endif
.contentShape(Rectangle())
.accessibilityAddTraits(.isButton)
.onTapGesture {
value.wrappedValue += 1
}

View File

@@ -287,11 +287,11 @@ struct FavoriteItemEditorButton<LabelView: View>: View {
.padding(7)
.frame(minWidth: 40, minHeight: 40)
.foregroundColor(color)
.accessibilityAddTraits(.isButton)
#if os(iOS)
.background(RoundedRectangle(cornerRadius: 4).strokeBorder(lineWidth: 1).foregroundColor(color))
#endif
.contentShape(Rectangle())
.accessibilityAddTraits(.isButton)
.onTapGesture(perform: onTapGesture)
#endif
}

View File

@@ -156,7 +156,7 @@ struct PlayerControlsSettings: View {
Text("System controls buttons")
.font(.headline)
.padding(.vertical, 8)
Button(action: { systemControlsCommands = .seek }) {
HStack {
Text(labelText("Seek".localized()))
@@ -170,8 +170,8 @@ struct PlayerControlsSettings: View {
}
.buttonStyle(.plain)
.padding(.vertical, 4)
Button(action: {
Button(action: {
systemControlsCommands = .restartAndAdvanceToNext
player.updateRemoteCommandCenter()
}) {
@@ -301,12 +301,12 @@ struct PlayerControlsSettings: View {
.labelStyle(.iconOnly)
.padding(7)
.foregroundColor(.accentColor)
.accessibilityAddTraits(.isButton)
#if os(iOS)
.frame(minHeight: 35)
.background(RoundedRectangle(cornerRadius: 4).strokeBorder(lineWidth: 1).foregroundColor(.accentColor))
#endif
.contentShape(Rectangle())
.accessibilityAddTraits(.isButton)
.onTapGesture {
var intValue = Int(value.wrappedValue) ?? 10
intValue -= 5
@@ -337,11 +337,11 @@ struct PlayerControlsSettings: View {
.labelStyle(.iconOnly)
.padding(7)
.foregroundColor(.accentColor)
.accessibilityAddTraits(.isButton)
#if os(iOS)
.background(RoundedRectangle(cornerRadius: 4).strokeBorder(lineWidth: 1).foregroundColor(.accentColor))
#endif
.contentShape(Rectangle())
.accessibilityAddTraits(.isButton)
.onTapGesture {
var intValue = Int(value.wrappedValue) ?? 10
intValue += 5

View File

@@ -136,19 +136,9 @@ struct QualityProfileForm: View {
var formatsFooter: some View {
VStack(alignment: .leading) {
if #available(iOS 16.0, *) {
Text("Formats can be reordered and will be selected in this order.")
.foregroundColor(.secondary)
.fixedSize(horizontal: false, vertical: true)
} else if #available(iOS 14.0, *) {
Text("Formats will be selected in the order they are listed.")
.foregroundColor(.secondary)
.fixedSize(horizontal: false, vertical: true)
} else {
Text("Formats will be selected in the order they are listed.")
.foregroundColor(.secondary)
.fixedSize(horizontal: false, vertical: true)
}
Text("Formats can be reordered and will be selected in this order.")
.foregroundColor(.secondary)
.fixedSize(horizontal: false, vertical: true)
Text("**Note:** HLS is an adaptive format where specific resolution settings don't apply.")
.foregroundColor(.secondary)
@@ -252,15 +242,8 @@ struct QualityProfileForm: View {
#if os(macOS)
let list = filteredFormatList
Group {
if #available(macOS 12.0, *) {
list
.listStyle(.inset(alternatesRowBackgrounds: true))
} else {
list
.listStyle(.inset)
}
}
list
.listStyle(.inset(alternatesRowBackgrounds: true))
Spacer()
#else
filteredFormatList

View File

@@ -182,24 +182,14 @@ struct QualitySettings: View {
}
}
if #available(macOS 12.0, *) {
#if os(macOS)
List {
list
}
.listStyle(.inset(alternatesRowBackgrounds: true))
#else
#if os(macOS)
List {
list
#endif
} else {
#if os(macOS)
List {
list
}
#else
list
#endif
}
}
.listStyle(.inset(alternatesRowBackgrounds: true))
#else
list
#endif
}
}