From ca274bd206332708d44c8c31051feb3bad95f384 Mon Sep 17 00:00:00 2001 From: Ethan Pippin Date: Mon, 10 Jan 2022 13:41:42 -0700 Subject: [PATCH 1/7] deliberate linting mistakes --- .../VideoPlayerViewModel/VideoPlayerViewModel.swift | 6 ++---- Swiftfin/App/AppDelegate.swift | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Shared/ViewModels/VideoPlayerViewModel/VideoPlayerViewModel.swift b/Shared/ViewModels/VideoPlayerViewModel/VideoPlayerViewModel.swift index 0bba10b5..8cac939e 100644 --- a/Shared/ViewModels/VideoPlayerViewModel/VideoPlayerViewModel.swift +++ b/Shared/ViewModels/VideoPlayerViewModel/VideoPlayerViewModel.swift @@ -24,10 +24,8 @@ final class VideoPlayerViewModel: ViewModel { // Manually kept state because VLCKit doesn't properly set "played" // on the VLCMediaPlayer object - @Published - var playerState: VLCMediaPlayerState = .buffering - @Published - var leftLabelText: String = "--:--" + @Published var playerState: VLCMediaPlayerState = .buffering + @Published var leftLabelText: String = "--:--" @Published var rightLabelText: String = "--:--" @Published diff --git a/Swiftfin/App/AppDelegate.swift b/Swiftfin/App/AppDelegate.swift index aacfa0b9..03af3ce7 100644 --- a/Swiftfin/App/AppDelegate.swift +++ b/Swiftfin/App/AppDelegate.swift @@ -13,9 +13,7 @@ import UIKit class AppDelegate: NSObject, UIApplicationDelegate { static var orientationLock = UIInterfaceOrientationMask.all - func application(_ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool - { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool { // Lazily initialize datastack _ = SwiftfinStore.dataStack From e7f38491876b458068c901894a4d2c5280f0895e Mon Sep 17 00:00:00 2001 From: Ethan Pippin Date: Mon, 10 Jan 2022 13:43:20 -0700 Subject: [PATCH 2/7] step 2 - fix linting mistakes --- .../VideoPlayerViewModel/VideoPlayerViewModel.swift | 6 ++++-- Swiftfin/App/AppDelegate.swift | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Shared/ViewModels/VideoPlayerViewModel/VideoPlayerViewModel.swift b/Shared/ViewModels/VideoPlayerViewModel/VideoPlayerViewModel.swift index 8cac939e..0bba10b5 100644 --- a/Shared/ViewModels/VideoPlayerViewModel/VideoPlayerViewModel.swift +++ b/Shared/ViewModels/VideoPlayerViewModel/VideoPlayerViewModel.swift @@ -24,8 +24,10 @@ final class VideoPlayerViewModel: ViewModel { // Manually kept state because VLCKit doesn't properly set "played" // on the VLCMediaPlayer object - @Published var playerState: VLCMediaPlayerState = .buffering - @Published var leftLabelText: String = "--:--" + @Published + var playerState: VLCMediaPlayerState = .buffering + @Published + var leftLabelText: String = "--:--" @Published var rightLabelText: String = "--:--" @Published diff --git a/Swiftfin/App/AppDelegate.swift b/Swiftfin/App/AppDelegate.swift index 03af3ce7..aacfa0b9 100644 --- a/Swiftfin/App/AppDelegate.swift +++ b/Swiftfin/App/AppDelegate.swift @@ -13,7 +13,9 @@ import UIKit class AppDelegate: NSObject, UIApplicationDelegate { static var orientationLock = UIInterfaceOrientationMask.all - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool { + func application(_ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool + { // Lazily initialize datastack _ = SwiftfinStore.dataStack From 494cfed75e6c85809ebf7bf479cb33b953ff1cc1 Mon Sep 17 00:00:00 2001 From: Ethan Pippin Date: Mon, 10 Jan 2022 13:49:13 -0700 Subject: [PATCH 3/7] try fixing path to config file --- .github/workflows/lint-pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-pr.yaml b/.github/workflows/lint-pr.yaml index 74f339c4..44d4babd 100644 --- a/.github/workflows/lint-pr.yaml +++ b/.github/workflows/lint-pr.yaml @@ -14,4 +14,4 @@ jobs: uses: actions/checkout@v2.3.4 - name: Run Swiftformat - run: swiftformat . --lint + run: swiftformat . --lint "../.swiftformat" From 6735fa1c66bf06611b4c838f52060784980cb44b Mon Sep 17 00:00:00 2001 From: Ethan Pippin Date: Mon, 10 Jan 2022 13:50:04 -0700 Subject: [PATCH 4/7] Update lint-pr.yaml --- .github/workflows/lint-pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-pr.yaml b/.github/workflows/lint-pr.yaml index 44d4babd..74f339c4 100644 --- a/.github/workflows/lint-pr.yaml +++ b/.github/workflows/lint-pr.yaml @@ -14,4 +14,4 @@ jobs: uses: actions/checkout@v2.3.4 - name: Run Swiftformat - run: swiftformat . --lint "../.swiftformat" + run: swiftformat . --lint From b2a39d934d3556b1779d0d8aac5b9d93f85e69b6 Mon Sep 17 00:00:00 2001 From: Ethan Pippin Date: Mon, 10 Jan 2022 13:54:12 -0700 Subject: [PATCH 5/7] Update lint-pr.yaml --- .github/workflows/lint-pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-pr.yaml b/.github/workflows/lint-pr.yaml index 74f339c4..38f3971d 100644 --- a/.github/workflows/lint-pr.yaml +++ b/.github/workflows/lint-pr.yaml @@ -14,4 +14,4 @@ jobs: uses: actions/checkout@v2.3.4 - name: Run Swiftformat - run: swiftformat . --lint + run: swiftformat . --lint --config ".swiftformat" From eb71e8b8d0efc11e165bec5b985556b4501a5401 Mon Sep 17 00:00:00 2001 From: Ethan Pippin Date: Mon, 10 Jan 2022 13:59:10 -0700 Subject: [PATCH 6/7] fix for updated swiftformat --- .swiftformat | 5 +++-- Shared/Views/SearchBarView.swift | 2 +- .../Components/LandscapeItemElement.swift | 4 ++-- Swiftfin tvOS/Views/LibraryListView.swift | 18 +++++++++--------- .../VideoPlayer/VLCPlayerOverlayView.swift | 2 +- WidgetExtension/NextUpWidget.swift | 6 +++--- 6 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.swiftformat b/.swiftformat index 7b35d0a4..e6953b07 100644 --- a/.swiftformat +++ b/.swiftformat @@ -40,9 +40,10 @@ blankLinesAtStartOfScope,\ andOperator, \ redundantFileprivate, \ - redundantSelf + redundantSelf, \ + redundantClosure, \ + redundantType --exclude Pods --header "\nSwiftfin is subject to the terms of the Mozilla Public\nLicense, v2.0. If a copy of the MPL was not distributed with this\nfile, you can obtain one at https://mozilla.org/MPL/2.0/.\n\nCopyright (c) {year} Jellyfin & Jellyfin Contributors\n" - diff --git a/Shared/Views/SearchBarView.swift b/Shared/Views/SearchBarView.swift index 137489ac..f33391c9 100644 --- a/Shared/Views/SearchBarView.swift +++ b/Shared/Views/SearchBarView.swift @@ -23,7 +23,7 @@ struct SearchBar: View { #if os(iOS) .background(Color(.systemGray6)) #endif - .cornerRadius(8) + .cornerRadius(8) if !text.isEmpty { Button(action: { self.text = "" diff --git a/Swiftfin tvOS/Components/LandscapeItemElement.swift b/Swiftfin tvOS/Components/LandscapeItemElement.swift index 350e8a93..efae06e9 100644 --- a/Swiftfin tvOS/Components/LandscapeItemElement.swift +++ b/Swiftfin tvOS/Components/LandscapeItemElement.swift @@ -67,8 +67,8 @@ struct LandscapeItemElement: View { .fill(LinearGradient(gradient: Gradient(colors: [.black, .clear]), startPoint: .bottom, endPoint: .top)) - .frame(width: 445, height: 90) - .mask(CutOffShadow()) + .frame(width: 445, height: 90) + .mask(CutOffShadow()) VStack(alignment: .leading) { Text("CONTINUE • \(item.getItemProgressString() ?? "")") .font(.caption) diff --git a/Swiftfin tvOS/Views/LibraryListView.swift b/Swiftfin tvOS/Views/LibraryListView.swift index 1ba40a08..d4e5436d 100644 --- a/Swiftfin tvOS/Views/LibraryListView.swift +++ b/Swiftfin tvOS/Views/LibraryListView.swift @@ -48,9 +48,9 @@ struct LibraryListView: View { .frame(minWidth: 100, maxWidth: .infinity) .frame(height: 100) } - .cornerRadius(10) - .shadow(radius: 5) - .padding(.bottom, 5) + .cornerRadius(10) + .shadow(radius: 5) + .padding(.bottom, 5) } ForEach(viewModel.libraries.filter { $0.collectionType != "boxsets" }, id: \.id) { library in @@ -75,9 +75,9 @@ struct LibraryListView: View { .frame(minWidth: 100, maxWidth: .infinity) .frame(height: 100) } - .cornerRadius(10) - .shadow(radius: 5) - .padding(.bottom, 5) + .cornerRadius(10) + .shadow(radius: 5) + .padding(.bottom, 5) } } else { Button { @@ -99,9 +99,9 @@ struct LibraryListView: View { .frame(minWidth: 100, maxWidth: .infinity) .frame(height: 100) } - .cornerRadius(10) - .shadow(radius: 5) - .padding(.bottom, 5) + .cornerRadius(10) + .shadow(radius: 5) + .padding(.bottom, 5) } } } else { diff --git a/Swiftfin/Views/VideoPlayer/VLCPlayerOverlayView.swift b/Swiftfin/Views/VideoPlayer/VLCPlayerOverlayView.swift index 0928adc7..6b19fe5d 100644 --- a/Swiftfin/Views/VideoPlayer/VLCPlayerOverlayView.swift +++ b/Swiftfin/Views/VideoPlayer/VLCPlayerOverlayView.swift @@ -344,7 +344,7 @@ struct VLCPlayerOverlayView: View { thumbSize: CGSize.Circle(radius: viewModel.sliderIsScrubbing ? 20 : 15), thumbInteractiveSize: CGSize.Circle(radius: 40), options: .defaultOptions)) - .frame(maxHeight: 50) + .frame(maxHeight: 50) Text(viewModel.rightLabelText) .font(.system(size: 18, weight: .semibold, design: .default)) diff --git a/WidgetExtension/NextUpWidget.swift b/WidgetExtension/NextUpWidget.swift index 22d34316..91ef20a2 100644 --- a/WidgetExtension/NextUpWidget.swift +++ b/WidgetExtension/NextUpWidget.swift @@ -458,9 +458,9 @@ private struct InnerShadow: ViewModifier { .overlay(LinearGradient(gradient: Gradient(colors: self.colors), startPoint: .top, endPoint: .bottom) .frame(height: self.radius * self.minSide(geo)), alignment: .top) - .overlay(LinearGradient(gradient: Gradient(colors: self.colors), startPoint: .bottom, endPoint: .top) - .frame(height: self.radius * self.minSide(geo)), - alignment: .bottom) + .overlay(LinearGradient(gradient: Gradient(colors: self.colors), startPoint: .bottom, endPoint: .top) + .frame(height: self.radius * self.minSide(geo)), + alignment: .bottom) } } From a02d9a225c1fc8dca6b7dc09fb63351309bfcf87 Mon Sep 17 00:00:00 2001 From: Ethan Pippin Date: Mon, 10 Jan 2022 14:01:57 -0700 Subject: [PATCH 7/7] fix contributing link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4f4f3b5c..3d51fc32 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Check out our [Weblate instance](https://translate.jellyfin.org/projects/swiftfi ## ⚙️ Development -Thank you for your interest in Swiftfin, please check out the [Contribution Guidelines](https://github.com/jellyfin/Swiftfin/contributing.md) to get started. +Thank you for your interest in Swiftfin, please check out the [Contribution Guidelines](https://github.com/jellyfin/Swiftfin/blob/main/contributing.md) to get started. -----