From 9e119017dbba27bc05fd022b593f70f895d18710 Mon Sep 17 00:00:00 2001 From: Daniel Chick Date: Thu, 31 Oct 2024 14:18:19 -0500 Subject: [PATCH] Project Settings Changes (#1297) * Add compiler flag for long type checking warning * duplicate file references. * Reduce expression complexity * Replace deprecated SwiftLint rule * Bump SwiftFormat version * Bump Swift version of SwiftLint --- .swiftformat | 7 ++++--- Shared/Extensions/JellyfinAPI/ServerTicks.swift | 4 +++- Swiftfin.xcodeproj/project.pbxproj | 8 +++----- .../xcshareddata/swiftpm/Package.resolved | 4 ++-- .../xcshareddata/xcschemes/Swiftfin tvOS.xcscheme | 2 +- .../xcshareddata/xcschemes/Swiftfin.xcscheme | 2 +- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.swiftformat b/.swiftformat index da68bd49..4e159b64 100644 --- a/.swiftformat +++ b/.swiftformat @@ -1,6 +1,6 @@ -# version: 0.49.11 +# version: 0.54.6 ---swiftversion 5.5 +--swiftversion 5.6 --tabwidth 4 --xcodeindentation enabled @@ -14,7 +14,8 @@ --wrapconditions after-first --funcattributes prev-line --typeattributes prev-line ---varattributes prev-line +--computedvarattrs prev-line +--storedvarattrs prev-line --trailingclosures --shortoptionals "always" --ifdef no-indent diff --git a/Shared/Extensions/JellyfinAPI/ServerTicks.swift b/Shared/Extensions/JellyfinAPI/ServerTicks.swift index c23eefe2..22aecfa7 100644 --- a/Shared/Extensions/JellyfinAPI/ServerTicks.swift +++ b/Shared/Extensions/JellyfinAPI/ServerTicks.swift @@ -49,7 +49,9 @@ extension ServerTicks { init(date: Date) { let components = Calendar.current.dateComponents([.hour, .minute], from: date) - let totalSeconds = TimeInterval((components.hour ?? 0) * 3600 + (components.minute ?? 0) * 60) + let hour = components.hour ?? 0 + let minute = components.minute ?? 0 + let totalSeconds = TimeInterval(hour * 3600 + minute * 60) self = Int(totalSeconds * 10_000_000) } diff --git a/Swiftfin.xcodeproj/project.pbxproj b/Swiftfin.xcodeproj/project.pbxproj index ab4ebe63..6285d36e 100644 --- a/Swiftfin.xcodeproj/project.pbxproj +++ b/Swiftfin.xcodeproj/project.pbxproj @@ -108,8 +108,6 @@ 4EC6C16B2C92999800FC904B /* TranscodeSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC6C16A2C92999800FC904B /* TranscodeSection.swift */; }; 4ECDAA9E2C920A8E0030F2F5 /* TranscodeReason.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4ECDAA9D2C920A8E0030F2F5 /* TranscodeReason.swift */; }; 4ECDAA9F2C920A8E0030F2F5 /* TranscodeReason.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4ECDAA9D2C920A8E0030F2F5 /* TranscodeReason.swift */; }; - 4EDBDCD12CBDD6590033D347 /* SessionInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EDBDCD02CBDD6510033D347 /* SessionInfo.swift */; }; - 4EDBDCD22CBDD6590033D347 /* SessionInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EDBDCD02CBDD6510033D347 /* SessionInfo.swift */; }; 4EE141692C8BABDF0045B661 /* ActiveSessionProgressSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EE141682C8BABDF0045B661 /* ActiveSessionProgressSection.swift */; }; 4EED874A2CBF824B002354D2 /* DeviceRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EED87462CBF824B002354D2 /* DeviceRow.swift */; }; 4EED874B2CBF824B002354D2 /* DevicesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EED87482CBF824B002354D2 /* DevicesView.swift */; }; @@ -4279,7 +4277,7 @@ New, ); LastSwiftUpdateCheck = 1250; - LastUpgradeCheck = 1530; + LastUpgradeCheck = 1610; TargetAttributes = { 5358705F2669D21600D05A09 = { CreatedOnToolsVersion = 12.5; @@ -4686,7 +4684,6 @@ 4E17498F2CC00A3100DD07D1 /* DeviceInfo.swift in Sources */, E12CC1C928D132B800678D5D /* RecentlyAddedView.swift in Sources */, E19D41B32BF2BFEF0082B8B2 /* URLSessionConfiguration.swift in Sources */, - 4EDBDCD12CBDD6590033D347 /* SessionInfo.swift in Sources */, E10B1ECE2BD9AFD800A92EAF /* SwiftfinStore+V2.swift in Sources */, E150C0BE2BFD45BD00944FFA /* RedrawOnNotificationView.swift in Sources */, E1763A722BF3F67C004DF6AB /* SwiftfinStore+Mappings.swift in Sources */, @@ -5194,7 +5191,6 @@ E1D4BF812719D22800A11E64 /* AppAppearance.swift in Sources */, E1BDF2EF29522A5900CC0294 /* AudioActionButton.swift in Sources */, E174120F29AE9D94003EF3B5 /* NavigationCoordinatable.swift in Sources */, - 4EDBDCD22CBDD6590033D347 /* SessionInfo.swift in Sources */, E10231392BCF8A3C009D71FC /* ProgramButtonContent.swift in Sources */, E1DC9844296DECB600982F06 /* ProgressIndicator.swift in Sources */, 6220D0B126D5EC9900B8E046 /* SettingsCoordinator.swift in Sources */, @@ -5640,6 +5636,7 @@ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; + OTHER_SWIFT_FLAGS = "-Xfrontend -warn-long-expression-type-checking=200"; SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -5698,6 +5695,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 14.1; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; + OTHER_SWIFT_FLAGS = "-Xfrontend -warn-long-expression-type-checking=200"; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; diff --git a/Swiftfin.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Swiftfin.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 7cc25202..38f911da 100644 --- a/Swiftfin.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Swiftfin.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -132,8 +132,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/kean/Pulse", "state" : { - "revision" : "3ac5ee35ab233e900aa484919803d51791d1e351", - "version" : "4.2.7" + "revision" : "d1e39ffaaa8b8becff80cb193c93a78e32077af8", + "version" : "4.2.0" } }, { diff --git a/Swiftfin.xcodeproj/xcshareddata/xcschemes/Swiftfin tvOS.xcscheme b/Swiftfin.xcodeproj/xcshareddata/xcschemes/Swiftfin tvOS.xcscheme index 151ec61e..7449a0c3 100644 --- a/Swiftfin.xcodeproj/xcshareddata/xcschemes/Swiftfin tvOS.xcscheme +++ b/Swiftfin.xcodeproj/xcshareddata/xcschemes/Swiftfin tvOS.xcscheme @@ -1,6 +1,6 @@