From ad015108976f8eb7b67ae660aca6244188ca3727 Mon Sep 17 00:00:00 2001 From: ErrorErrorError <16653389+ErrorErrorError@users.noreply.github.com> Date: Fri, 13 Oct 2023 10:08:06 -0700 Subject: [PATCH] wip: updated swiftlint and swiftformat to latest version --- .github/workflows/cd.yml | 28 -------------- .github/workflows/ci.yml | 38 ------------------- .github/workflows/lint.yml | 2 +- .swift-version | 2 +- .swiftformat.yml | 4 ++ .swiftlint.yml | 1 + App/Mochi.xcodeproj/project.pbxproj | 20 ++++++++++ App/Shared/AppDelegate.swift | 2 +- Package/Sources/Clients/AnalyticsClient.swift | 4 +- Sources/Clients/BuildClient/BuildClient.swift | 6 +-- Sources/Clients/DatabaseClient/Client.swift | 2 - .../Supporting Files/Cast.swift | 2 +- .../Supporting Files/Entity.swift | 9 ++--- .../Supporting Files/TransformableValue.swift | 2 - Sources/Clients/FileClient/Client.swift | 4 +- Sources/Clients/ModuleClient/Client.swift | 2 +- .../WASM+Bindings/Binding+Env.swift | 2 +- .../WASM+Bindings/Bindings+Core.swift | 2 + .../WASM+Bindings/Bindings+Crypto.swift | 4 +- .../WASM+Bindings/Bindings+HTML.swift | 3 +- .../WASM+Bindings/Bindings+JSON.swift | 4 +- .../WASM+Bindings/Bindings+Meta.swift | 6 ++- .../WASM+Bindings/Bindings+Request.swift | 4 +- .../WASM+Bindings/Bindings+Video.swift | 4 +- .../AVMediaSelectionGroup+Struct.swift | 2 +- .../Extension/AVPlayer+Extension.swift | 2 +- .../Extension/CMTime+Extension.swift | 2 +- .../Clients/UserSettingsClient/AppIcon.swift | 2 +- Sources/Features/App/AppDelegateFeature.swift | 4 +- Sources/Features/App/AppFeature+View.swift | 17 ++++----- Sources/Features/App/AppFeature.swift | 22 +++++------ .../Discover/DiscoverFeature+Reducer.swift | 6 +-- .../Features/Discover/DiscoverFeature.swift | 8 ++-- .../Settings/SettingsFeature+View.swift | 10 +++++ .../VideoPlayer/VideoPlayerFeature.swift | 22 +++++------ ...Dependencies+DateComponentsFormatter.swift | 2 +- .../Dependencies+DateFormater.swift | 2 +- .../Dependencies+NumberFormatter.swift | 2 +- Sources/Shared/Architecture/Exported.swift | 2 +- .../Utils/Binding+Equatable.swift | 2 +- Sources/Shared/ContentCore/ContentCore.swift | 5 --- .../ContentCore/ContentListingView.swift | 2 +- .../Shared/FoundationHelpers/Array+ID.swift | 2 +- .../Shared/FoundationHelpers/Equatable+.swift | 4 +- Sources/Shared/Styling/_Exported.swift | 2 +- .../Shared/ViewComponents/DynamicStack.swift | 2 +- .../ViewComponents/Extensions/Color+Ext.swift | 2 +- Tests/WasmInterpreterTests/CWasmTests.swift | 1 + .../Wasm Modules/ConstantModule.swift | 1 + 49 files changed, 127 insertions(+), 158 deletions(-) delete mode 100644 .github/workflows/cd.yml delete mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml deleted file mode 100644 index 543d661..0000000 --- a/.github/workflows/cd.yml +++ /dev/null @@ -1,28 +0,0 @@ -#name: cd -# -#on: -# workflow_run: -# workflows: -# - ci -# branches: -# - dev -# types: -# - completed -# -#jobs: -# build-publish: -# if: github.event.workflow_run.conclusion == 'success' -# runs-on: macos-13 -# steps: -# - name: Checkout -# uses: actions/checkout@v3 -# with: -# fetch-depth: 0 -# -# - name: Brew Install Dependencies -# run: | -# brew install cocogitto xcbeautify -# -# - run: fastlane deploy -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 3bd9ced..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,38 +0,0 @@ -#name: ci -# -#on: -# push: -# branches: -# - '*' -# pull_request: -# branches: -# - '*' -# -#jobs: -# run-tests: -# runs-on: macos-13 -# steps: -# - uses: actions/checkout@v3 -# - run: fastlane tests -# -# - name: Test Reporter -# uses: dorny/test-reporter@v1.6.0 -# if: success() || failure() # run this step even if previous step failed -# with: -# name: Test Results -# path: fastlane/test_output/*.junit -# reporter: jest-junit -# -# # - name: Export coverage test -# # run: | -# # BUILD_PATH=$(swift build --show-bin-path) -# # xcrun llvm-cov report \ -# # "$(find $(find $BUILD_PATH -name '*.xctest') -perm +111 -type f)" \ -# # --instr-profile "$BUILD_PATH/codecov/default.profdata" \ -# # --ignore-filename-regex='.*build/checkouts.*' \ -# # --ignore-filename-regex='Tests/.*' > "$BUILD_PATH/codecov/lcov.info" -# # echo "# Coverage Job Summary" >> $GITHUB_STEP_SUMMARY -# # echo "" >> $GITHUB_STEP_SUMMARY -# # echo "\`\`\`" >> $GITHUB_STEP_SUMMARY -# # echo "$(cat $BUILD_PATH/codecov/lcov.info)" >> $GITHUB_STEP_SUMMARY -# # echo "\`\`\`" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1d61aa8..142a240 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -31,4 +31,4 @@ jobs: - name: Lint code using SwiftFormat run: | swiftformat --version - swiftformat --config .swiftformat.yml --lint --quiet . + swiftformat --config .swiftformat.yml --lint --quiet --reporter github-actions-log . diff --git a/.swift-version b/.swift-version index 3659ea2..95ee81a 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -5.8 +5.9 diff --git a/.swiftformat.yml b/.swiftformat.yml index 4a45e13..ff0b113 100644 --- a/.swiftformat.yml +++ b/.swiftformat.yml @@ -57,3 +57,7 @@ # op-ins (disable) --disable wrapMultilineStatementBraces + +# exclude +--exclude "**/Package/*" +--exclude "**/Package.swift" diff --git a/.swiftlint.yml b/.swiftlint.yml index b83c772..91ee229 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -5,6 +5,7 @@ included: excluded: - "**/.build" + - "**/Package" disabled_rules: - nesting diff --git a/App/Mochi.xcodeproj/project.pbxproj b/App/Mochi.xcodeproj/project.pbxproj index 4debd14..ffbab17 100644 --- a/App/Mochi.xcodeproj/project.pbxproj +++ b/App/Mochi.xcodeproj/project.pbxproj @@ -124,6 +124,7 @@ 13C18B8E29CE6CC200C14F26 /* Frameworks */, 13C18B8F29CE6CC200C14F26 /* Resources */, 1345C12F29E079120009AB4E /* Run Swiftlint Script */, + 13BC25D22AD895AE001DAE2A /* Run SwiftFormat Script */, ); buildRules = ( ); @@ -202,6 +203,25 @@ shellPath = /bin/sh; shellScript = "export PATH=\"$PATH:/opt/homebrew/bin\"\nif which swiftlint > /dev/null; then\n swiftlint --config ../.swiftlint.yml ../\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n"; }; + 13BC25D22AD895AE001DAE2A /* Run SwiftFormat Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Run SwiftFormat Script"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# export PATH=\"$PATH:/opt/homebrew/bin\"\n# if which swiftformat >/dev/null; then\n# swiftformat --config ../.swiftformat.yml --lint ../\n# else\n# echo \"warning: SwiftFormat not installed, download from https://github.com/nicklockwood/SwiftFormat\"\n# fi\n"; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ diff --git a/App/Shared/AppDelegate.swift b/App/Shared/AppDelegate.swift index 69d0a1e..bb8417e 100644 --- a/App/Shared/AppDelegate.swift +++ b/App/Shared/AppDelegate.swift @@ -18,7 +18,7 @@ let store = Store( reducer: { AppFeature() } ) -@UIApplicationMain +@main class AppDelegate: UIResponder, UIApplicationDelegate { func application( _: UIApplication, diff --git a/Package/Sources/Clients/AnalyticsClient.swift b/Package/Sources/Clients/AnalyticsClient.swift index b7c0b54..a4a4745 100644 --- a/Package/Sources/Clients/AnalyticsClient.swift +++ b/Package/Sources/Clients/AnalyticsClient.swift @@ -1,6 +1,6 @@ // -// File.swift -// +// AnalyticsClient.swift +// // // Created by ErrorErrorError on 10/4/23. // diff --git a/Sources/Clients/BuildClient/BuildClient.swift b/Sources/Clients/BuildClient/BuildClient.swift index 34fdcb1..282597a 100644 --- a/Sources/Clients/BuildClient/BuildClient.swift +++ b/Sources/Clients/BuildClient/BuildClient.swift @@ -1,9 +1,9 @@ // -// File.swift -// +// BuildClient.swift +// // // Created by ErrorErrorError on 7/28/23. -// +// // import Dependencies diff --git a/Sources/Clients/DatabaseClient/Client.swift b/Sources/Clients/DatabaseClient/Client.swift index b8ed3f6..1562d9e 100644 --- a/Sources/Clients/DatabaseClient/Client.swift +++ b/Sources/Clients/DatabaseClient/Client.swift @@ -33,8 +33,6 @@ public extension DatabaseClient { } } -// MARK: DependencyKey - extension DatabaseClient: DependencyKey {} public extension DependencyValues { diff --git a/Sources/Clients/DatabaseClient/Supporting Files/Cast.swift b/Sources/Clients/DatabaseClient/Supporting Files/Cast.swift index 013c9ed..567bb33 100644 --- a/Sources/Clients/DatabaseClient/Supporting Files/Cast.swift +++ b/Sources/Clients/DatabaseClient/Supporting Files/Cast.swift @@ -1,5 +1,5 @@ // -// File.swift +// Case.swift // // // Created by ErrorErrorError on 5/16/23. diff --git a/Sources/Clients/DatabaseClient/Supporting Files/Entity.swift b/Sources/Clients/DatabaseClient/Supporting Files/Entity.swift index 95b21e6..6d4b9ba 100644 --- a/Sources/Clients/DatabaseClient/Supporting Files/Entity.swift +++ b/Sources/Clients/DatabaseClient/Supporting Files/Entity.swift @@ -1,9 +1,9 @@ // -// File.swift -// +// Entity.swift +// // // Created by ErrorErrorError on 9/12/23. -// +// // import CoreData @@ -21,14 +21,11 @@ public extension Entity { static var entityName: String { .init(describing: Self.self) } } -// MARK: - EntityError - public enum EntityError: Error { case managedObjectIdIsNotPermanent } extension Entity { - /// Decodes an NSManagedObject data to Entity type /// init(id: NSManagedObjectID, context: NSManagedObjectContext) throws { diff --git a/Sources/Clients/DatabaseClient/Supporting Files/TransformableValue.swift b/Sources/Clients/DatabaseClient/Supporting Files/TransformableValue.swift index 513ea34..70d1b71 100644 --- a/Sources/Clients/DatabaseClient/Supporting Files/TransformableValue.swift +++ b/Sources/Clients/DatabaseClient/Supporting Files/TransformableValue.swift @@ -168,8 +168,6 @@ extension TransformableValue { return } else if Self.Primitive.self == Int16.self { return - } else if Self.Primitive.self == Int16.self { - return } else if Self.Primitive.self == Int32.self { return } else if Self.Primitive.self == Int64.self { diff --git a/Sources/Clients/FileClient/Client.swift b/Sources/Clients/FileClient/Client.swift index d08eed6..6dbb9f2 100644 --- a/Sources/Clients/FileClient/Client.swift +++ b/Sources/Clients/FileClient/Client.swift @@ -1,9 +1,9 @@ // // Client.swift -// +// // // Created by ErrorErrorError on 10/6/23. -// +// // import ComposableArchitecture diff --git a/Sources/Clients/ModuleClient/Client.swift b/Sources/Clients/ModuleClient/Client.swift index a464609..f63f0fd 100644 --- a/Sources/Clients/ModuleClient/Client.swift +++ b/Sources/Clients/ModuleClient/Client.swift @@ -46,7 +46,7 @@ extension SwiftSoup.Exception: Equatable { public static func == (lhs: Exception, rhs: Exception) -> Bool { switch (lhs, rhs) { case let (.Error(typeOne, messageOne), .Error(typeTwo, messageTwo)): - return typeOne == typeTwo && messageOne == messageTwo + typeOne == typeTwo && messageOne == messageTwo } } } diff --git a/Sources/Clients/ModuleClient/WASM+Bindings/Binding+Env.swift b/Sources/Clients/ModuleClient/WASM+Bindings/Binding+Env.swift index ccd00f4..6bdf845 100644 --- a/Sources/Clients/ModuleClient/WASM+Bindings/Binding+Env.swift +++ b/Sources/Clients/ModuleClient/WASM+Bindings/Binding+Env.swift @@ -1,5 +1,5 @@ // -// Bindings+Env.swift +// Binding+Env.swift // // // Created by ErrorErrorError on 7/25/23. diff --git a/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+Core.swift b/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+Core.swift index ff5a9e3..f059d72 100644 --- a/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+Core.swift +++ b/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+Core.swift @@ -181,3 +181,5 @@ extension ModuleClient.Instance { } } } + +// swiftlint:enable closure_parameter_position diff --git a/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+Crypto.swift b/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+Crypto.swift index 0a28524..8cb11a3 100644 --- a/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+Crypto.swift +++ b/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+Crypto.swift @@ -1,5 +1,5 @@ // -// HostModuleInterop+Crypto.swift +// Bindings+Crypto.swift // // // Created by ErrorErrorError on 6/7/23. @@ -136,3 +136,5 @@ extension ModuleClient.Instance { } } } + +// swiftlint:enable closure_parameter_position diff --git a/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+HTML.swift b/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+HTML.swift index 7a40bb1..0601b4e 100644 --- a/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+HTML.swift +++ b/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+HTML.swift @@ -1,5 +1,5 @@ // -// HostBindings+HTML.swift +// Bindings+HTML.swift // // // Created by ErrorErrorError on 5/9/23. @@ -224,3 +224,4 @@ extension ModuleClient.Instance { } } } +// swiftlint:enable closure_parameter_position diff --git a/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+JSON.swift b/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+JSON.swift index 2ad807f..76e1068 100644 --- a/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+JSON.swift +++ b/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+JSON.swift @@ -1,5 +1,5 @@ // -// HostModuleInterop+Json.swift +// Bindings+JSON.swift // // // Created by ErrorErrorError on 5/9/23. @@ -24,3 +24,5 @@ extension ModuleClient.Instance { } } } + +// swiftlint:enable closure_parameter_position diff --git a/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+Meta.swift b/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+Meta.swift index d52f529..89ecc62 100644 --- a/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+Meta.swift +++ b/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+Meta.swift @@ -1,5 +1,5 @@ // -// HostModuleInterop+Structs.swift +// Bindings+Meta.swift // // // Created by ErrorErrorError on 5/9/23. @@ -12,7 +12,7 @@ import WasmInterpreter // MARK: Meta Structs Imports -// swiftlint:disable closure_parameter_position closure_parameter_position +// swiftlint:disable closure_parameter_position extension ModuleClient.Instance { func metaImports() -> WasmInstance.Import { WasmInstance.Import(namespace: "structs_meta") { @@ -236,3 +236,5 @@ extension ModuleClient.Instance { } } } + +// swiftlint:enable closure_parameter_position diff --git a/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+Request.swift b/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+Request.swift index 1d158c1..7d2b3e5 100644 --- a/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+Request.swift +++ b/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+Request.swift @@ -1,5 +1,5 @@ // -// HostModuleInterop+Http.swift +// Bindings+Request.swift // // // Created by ErrorErrorError on 5/9/23. @@ -116,3 +116,5 @@ extension ModuleClient.Instance { } } } + +// swiftlint:enable closure_parameter_position diff --git a/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+Video.swift b/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+Video.swift index 5d3aa15..0b8a85e 100644 --- a/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+Video.swift +++ b/Sources/Clients/ModuleClient/WASM+Bindings/Bindings+Video.swift @@ -1,5 +1,5 @@ // -// HostModuleInterop+Video.swift +// Bindings+Video.swift // // // Created by ErrorErrorError on 6/1/23. @@ -116,3 +116,5 @@ extension ModuleClient.Instance { } } } + +// swiftlint:enable closure_parameter_position diff --git a/Sources/Clients/PlayerClient/Extension/AVMediaSelectionGroup+Struct.swift b/Sources/Clients/PlayerClient/Extension/AVMediaSelectionGroup+Struct.swift index f997538..ed8d305 100644 --- a/Sources/Clients/PlayerClient/Extension/AVMediaSelectionGroup+Struct.swift +++ b/Sources/Clients/PlayerClient/Extension/AVMediaSelectionGroup+Struct.swift @@ -1,5 +1,5 @@ // -// AVClasses+Struct.swift +// AVMediaSelectionGroup+Struct.swift // // // Created by ErrorErrorError on 7/16/23. diff --git a/Sources/Clients/PlayerClient/Extension/AVPlayer+Extension.swift b/Sources/Clients/PlayerClient/Extension/AVPlayer+Extension.swift index 947e7cb..7e691ed 100644 --- a/Sources/Clients/PlayerClient/Extension/AVPlayer+Extension.swift +++ b/Sources/Clients/PlayerClient/Extension/AVPlayer+Extension.swift @@ -1,5 +1,5 @@ // -// AVPlayer+AsyncStream.swift +// AVPlayer+Extension.swift // // // Created by ErrorErrorError on 6/10/23. diff --git a/Sources/Clients/PlayerClient/Extension/CMTime+Extension.swift b/Sources/Clients/PlayerClient/Extension/CMTime+Extension.swift index aa2cfb3..edb2757 100644 --- a/Sources/Clients/PlayerClient/Extension/CMTime+Extension.swift +++ b/Sources/Clients/PlayerClient/Extension/CMTime+Extension.swift @@ -1,5 +1,5 @@ // -// File.swift +// CMTime+Extension.swift // // // Created by ErrorErrorError on 6/11/23. diff --git a/Sources/Clients/UserSettingsClient/AppIcon.swift b/Sources/Clients/UserSettingsClient/AppIcon.swift index da9d179..34b1de3 100644 --- a/Sources/Clients/UserSettingsClient/AppIcon.swift +++ b/Sources/Clients/UserSettingsClient/AppIcon.swift @@ -3,7 +3,7 @@ // // // Created by ErrorErrorError on 10/11/23. -// +// // import Foundation diff --git a/Sources/Features/App/AppDelegateFeature.swift b/Sources/Features/App/AppDelegateFeature.swift index 66d5b43..1714037 100644 --- a/Sources/Features/App/AppDelegateFeature.swift +++ b/Sources/Features/App/AppDelegateFeature.swift @@ -1,5 +1,5 @@ // -// File.swift +// AppDelegateFeature.swift // // // Created by ErrorErrorError on 5/19/23. @@ -33,7 +33,7 @@ public struct AppDelegateFeature: Reducer { Reduce { _, action in switch action { case .didFinishLaunching: - return .run { _ in + .run { _ in try? await databaseClient.initialize() try? await moduleClient.initialize() } diff --git a/Sources/Features/App/AppFeature+View.swift b/Sources/Features/App/AppFeature+View.swift index 1709e75..81d7997 100644 --- a/Sources/Features/App/AppFeature+View.swift +++ b/Sources/Features/App/AppFeature+View.swift @@ -142,15 +142,12 @@ extension AppFeature.View { } } -// MARK: - AppFeatureView_Previews - -struct AppFeatureView_Previews: PreviewProvider { - static var previews: some View { - AppFeature.View( - store: .init( - initialState: .init(), - reducer: { AppFeature() } - ) +#Preview { + AppFeature.View( + store: .init( + initialState: .init(), + reducer: { AppFeature() } ) - } + ) + } diff --git a/Sources/Features/App/AppFeature.swift b/Sources/Features/App/AppFeature.swift index 7f75a52..d2cda0a 100644 --- a/Sources/Features/App/AppFeature.swift +++ b/Sources/Features/App/AppFeature.swift @@ -51,33 +51,33 @@ public struct AppFeature: Feature { var image: String { switch self { case .discover: - return "doc.text.image" + "doc.text.image" case .repos: - return "globe" + "globe" case .settings: - return "gearshape" + "gearshape" } } var selected: String { switch self { case .discover: - return "doc.text.image.fill" + "doc.text.image.fill" case .repos: - return image + image case .settings: - return "gearshape.fill" + "gearshape.fill" } } var colorAccent: Color { switch self { case .discover: - return .init(hue: 138 / 360, saturation: 0.33, brightness: 0.63) + .init(hue: 138 / 360, saturation: 0.33, brightness: 0.63) case .repos: - return .init(hue: 178 / 360, saturation: 0.39, brightness: 0.7) + .init(hue: 178 / 360, saturation: 0.39, brightness: 0.7) case .settings: - return .init(hue: 27 / 360, saturation: 0.41, brightness: 0.69) + .init(hue: 27 / 360, saturation: 0.41, brightness: 0.69) } } } @@ -108,8 +108,8 @@ public struct AppFeature: Feature { public struct View: FeatureView { public let store: StoreOf - @Environment(\.theme) var theme -// @EnvironmentObject var theme: ThemeManager + @Environment(\.theme) + var theme public nonisolated init(store: StoreOf) { self.store = store diff --git a/Sources/Features/Discover/DiscoverFeature+Reducer.swift b/Sources/Features/Discover/DiscoverFeature+Reducer.swift index ba3e061..7080f7f 100644 --- a/Sources/Features/Discover/DiscoverFeature+Reducer.swift +++ b/Sources/Features/Discover/DiscoverFeature+Reducer.swift @@ -131,11 +131,11 @@ extension DiscoverFeature.State { value.sorted { leftElement, rightElement in switch (leftElement.type, rightElement.type) { case (.featured, .featured): - return true + true case (_, .featured): - return false + false default: - return true + true } } ) diff --git a/Sources/Features/Discover/DiscoverFeature.swift b/Sources/Features/Discover/DiscoverFeature.swift index 06d4e51..34890b9 100644 --- a/Sources/Features/Discover/DiscoverFeature.swift +++ b/Sources/Features/Discover/DiscoverFeature.swift @@ -33,13 +33,13 @@ public struct DiscoverFeature: Feature { var description: String { switch self { case .system(.moduleNotSelected): - return "There Is No Module Select" + "There Is No Module Select" case .system(.unknown): - return "Unknown System Error Has Occurred" + "Unknown System Error Has Occurred" case .module(.unknown): - return "Unknown Module Error Has Occurred" + "Unknown Module Error Has Occurred" case .module: - return "Failed to Load Module Discovery" + "Failed to Load Module Discovery" } } } diff --git a/Sources/Features/Settings/SettingsFeature+View.swift b/Sources/Features/Settings/SettingsFeature+View.swift index 581a90d..c75783f 100644 --- a/Sources/Features/Settings/SettingsFeature+View.swift +++ b/Sources/Features/Settings/SettingsFeature+View.swift @@ -21,6 +21,7 @@ extension SettingsFeature.View: View { ScrollView(.vertical) { VStack(spacing: 16) { SettingsGroup(title: "General") { + // TODO: Actually allow users to set which discover page to show on startup SettingRow(title: "Discover Page", accessory: { Toggle("", isOn: .constant(true)) .labelsHidden() @@ -39,6 +40,15 @@ extension SettingsFeature.View: View { SettingRow(title: "App Icon", accessory: EmptyView.init) { } } + + VStack { + Text("Made with ❤️") + Text("Version: \(viewStore.buildVersion.description) (\(viewStore.buildNumber))") + } + .font(.footnote.weight(.medium)) + .foregroundColor(.gray) + .frame(maxWidth: .infinity, alignment: .center) + .padding(.vertical) } } } diff --git a/Sources/Features/VideoPlayer/VideoPlayerFeature.swift b/Sources/Features/VideoPlayer/VideoPlayerFeature.swift index 1b7aae0..bd69d43 100644 --- a/Sources/Features/VideoPlayer/VideoPlayerFeature.swift +++ b/Sources/Features/VideoPlayer/VideoPlayerFeature.swift @@ -38,15 +38,15 @@ public struct VideoPlayerFeature: Feature { var image: Image { switch self { case .episodes: - return Image(systemName: "rectangle.stack.badge.play") + Image(systemName: "rectangle.stack.badge.play") case .sourcesAndServers: - return Image(systemName: "server.rack") + Image(systemName: "server.rack") case .qualityAndSubtitles: - return Image(systemName: "captions.bubble") + Image(systemName: "captions.bubble") case .speed: - return Image(systemName: "speedometer") + Image(systemName: "speedometer") case .settings: - return Image(systemName: "gearshape") + Image(systemName: "gearshape") } } } @@ -291,27 +291,27 @@ extension VideoPlayerFeature.View { var action: VideoPlayerFeature.Action { switch self { case let .next(_, group, paging, itemId): - return .view(.didTapPlayEpisode(group, paging, itemId)) + .view(.didTapPlayEpisode(group, paging, itemId)) case let .times(time): - return .view(.didSkipTo(time: time.endTime)) + .view(.didSkipTo(time: time.endTime)) } } var description: String { switch self { case let .times(time): - return time.type.description + time.type.description case let .next(number, _, _, _): - return "Play E\(number.withoutTrailingZeroes)" + "Play E\(number.withoutTrailingZeroes)" } } var image: String { switch self { case .next: - return "play.fill" + "play.fill" default: - return "forward.fill" + "forward.fill" } } diff --git a/Sources/Shared/Architecture/Dependencies/Dependencies+DateComponentsFormatter.swift b/Sources/Shared/Architecture/Dependencies/Dependencies+DateComponentsFormatter.swift index df763b4..c78376d 100644 --- a/Sources/Shared/Architecture/Dependencies/Dependencies+DateComponentsFormatter.swift +++ b/Sources/Shared/Architecture/Dependencies/Dependencies+DateComponentsFormatter.swift @@ -1,5 +1,5 @@ // -// File.swift +// Dependencies+DateComponentsFormatter.swift // // // Created by ErrorErrorError on 6/11/23. diff --git a/Sources/Shared/Architecture/Dependencies/Dependencies+DateFormater.swift b/Sources/Shared/Architecture/Dependencies/Dependencies+DateFormater.swift index 0320d7c..b19dee8 100644 --- a/Sources/Shared/Architecture/Dependencies/Dependencies+DateFormater.swift +++ b/Sources/Shared/Architecture/Dependencies/Dependencies+DateFormater.swift @@ -1,5 +1,5 @@ // -// Dependencies+DateFormatter.swift +// Dependencies+DateFormater.swift // // // Created by ErrorErrorError on 5/2/23. diff --git a/Sources/Shared/Architecture/Dependencies/Dependencies+NumberFormatter.swift b/Sources/Shared/Architecture/Dependencies/Dependencies+NumberFormatter.swift index ab90628..5947e44 100644 --- a/Sources/Shared/Architecture/Dependencies/Dependencies+NumberFormatter.swift +++ b/Sources/Shared/Architecture/Dependencies/Dependencies+NumberFormatter.swift @@ -1,5 +1,5 @@ // -// Dependencies+DateFormatter.swift +// Dependencies+NumberFormatter.swift // // // Created by ErrorErrorError on 5/2/23. diff --git a/Sources/Shared/Architecture/Exported.swift b/Sources/Shared/Architecture/Exported.swift index 50564fa..ed81178 100644 --- a/Sources/Shared/Architecture/Exported.swift +++ b/Sources/Shared/Architecture/Exported.swift @@ -1,5 +1,5 @@ // -// File.swift +// Exported.swift // // // Created by ErrorErrorError on 4/21/23. diff --git a/Sources/Shared/Architecture/Utils/Binding+Equatable.swift b/Sources/Shared/Architecture/Utils/Binding+Equatable.swift index 7467052..544dbd0 100644 --- a/Sources/Shared/Architecture/Utils/Binding+Equatable.swift +++ b/Sources/Shared/Architecture/Utils/Binding+Equatable.swift @@ -1,5 +1,5 @@ // -// File.swift +// Binding+Equatable.swift // // // Created by ErrorErrorError on 5/20/23. diff --git a/Sources/Shared/ContentCore/ContentCore.swift b/Sources/Shared/ContentCore/ContentCore.swift index c007cd2..dd974ad 100644 --- a/Sources/Shared/ContentCore/ContentCore.swift +++ b/Sources/Shared/ContentCore/ContentCore.swift @@ -150,10 +150,5 @@ private extension ContentCore.Groupings { } } -// MARK: - ContentCore.State + Sendable - extension ContentCore.State: Sendable {} - -// MARK: - OrderedDictionary + Sendable - extension OrderedDictionary: @unchecked Sendable where Key: Sendable, Value: Sendable {} diff --git a/Sources/Shared/ContentCore/ContentListingView.swift b/Sources/Shared/ContentCore/ContentListingView.swift index e5be09e..17258fe 100644 --- a/Sources/Shared/ContentCore/ContentListingView.swift +++ b/Sources/Shared/ContentCore/ContentListingView.swift @@ -1,5 +1,5 @@ // -// SwiftUIView.swift +// ContentListingView.swift // // // Created by ErrorErrorError on 7/13/23. diff --git a/Sources/Shared/FoundationHelpers/Array+ID.swift b/Sources/Shared/FoundationHelpers/Array+ID.swift index aa14a30..c54c711 100644 --- a/Sources/Shared/FoundationHelpers/Array+ID.swift +++ b/Sources/Shared/FoundationHelpers/Array+ID.swift @@ -1,5 +1,5 @@ // -// File.swift +// Array+ID.swift // // // Created by ErrorErrorError on 5/11/23. diff --git a/Sources/Shared/FoundationHelpers/Equatable+.swift b/Sources/Shared/FoundationHelpers/Equatable+.swift index bd52761..53f895f 100644 --- a/Sources/Shared/FoundationHelpers/Equatable+.swift +++ b/Sources/Shared/FoundationHelpers/Equatable+.swift @@ -1,9 +1,9 @@ // // Equatable+.swift -// +// // // Created by ErrorErrorError on 8/14/23. -// +// // import Foundation diff --git a/Sources/Shared/Styling/_Exported.swift b/Sources/Shared/Styling/_Exported.swift index a459a1a..60412e5 100644 --- a/Sources/Shared/Styling/_Exported.swift +++ b/Sources/Shared/Styling/_Exported.swift @@ -3,7 +3,7 @@ // // // Created by ErrorErrorError on 10/10/23. -// +// // import Foundation diff --git a/Sources/Shared/ViewComponents/DynamicStack.swift b/Sources/Shared/ViewComponents/DynamicStack.swift index 9607eca..b1c6a22 100644 --- a/Sources/Shared/ViewComponents/DynamicStack.swift +++ b/Sources/Shared/ViewComponents/DynamicStack.swift @@ -1,5 +1,5 @@ // -// File.swift +// DynamicStack.swift // // // Created by ErrorErrorError on 6/7/23. diff --git a/Sources/Shared/ViewComponents/Extensions/Color+Ext.swift b/Sources/Shared/ViewComponents/Extensions/Color+Ext.swift index 84695c1..6ec421b 100644 --- a/Sources/Shared/ViewComponents/Extensions/Color+Ext.swift +++ b/Sources/Shared/ViewComponents/Extensions/Color+Ext.swift @@ -1,5 +1,5 @@ // -// File.swift +// Color+Ext.swift // // // Created by ErrorErrorError on 5/21/23. diff --git a/Tests/WasmInterpreterTests/CWasmTests.swift b/Tests/WasmInterpreterTests/CWasmTests.swift index 830ce56..9d69d6b 100644 --- a/Tests/WasmInterpreterTests/CWasmTests.swift +++ b/Tests/WasmInterpreterTests/CWasmTests.swift @@ -372,6 +372,7 @@ extension CWasm3Tests { // swiftlint:disable line_length let base64 = "AGFzbQEAAAABBQFgAAF/AwIBAAeSAQsKY29uc3RhbnRfMQAACmNvbnN0YW50XzIAAApjb25zdGFudF8zAAAKY29uc3RhbnRfNAAACmNvbnN0YW50XzUAAApjb25zdGFudF82AAAKY29uc3RhbnRfNwAACmNvbnN0YW50XzgAAApjb25zdGFudF85AAALY29uc3RhbnRfMTAAAAtjb25zdGFudF8xMQAACggBBgBBgIAECw==" + // swiftlint:enable line_length guard let data = Data(base64Encoded: base64) else { throw TestError.couldNotDecodeWasm("constant.wasm") } diff --git a/Tests/WasmInterpreterTests/Wasm Modules/ConstantModule.swift b/Tests/WasmInterpreterTests/Wasm Modules/ConstantModule.swift index 9e021c8..b90fa25 100644 --- a/Tests/WasmInterpreterTests/Wasm Modules/ConstantModule.swift +++ b/Tests/WasmInterpreterTests/Wasm Modules/ConstantModule.swift @@ -18,5 +18,6 @@ public struct ConstantModule { let base64 = "AGFzbQEAAAABBQFgAAF/AwIBAAeSAQsKY29uc3RhbnRfMQAACmNvbnN0YW50XzIAAApjb25zdGFudF8zAAAKY29uc3RhbnRfNAAACmNvbnN0YW50XzUAAApjb25zdGFudF82AAAKY29uc3RhbnRfNwAACmNvbnN0YW50XzgAAApjb25zdGFudF85AAALY29uc3RhbnRfMTAAAAtjb25zdGFudF8xMQAACggBBgBBgIAECw==" return [UInt8](Data(base64Encoded: base64) ?? .init()) + // swiftlint:enable line_length } }