diff --git a/.github/workflows/swiftlint.yml b/.github/workflows/swiftlint.yml index d2d579ce3..9c69d060a 100644 --- a/.github/workflows/swiftlint.yml +++ b/.github/workflows/swiftlint.yml @@ -2,7 +2,6 @@ name: SwiftLint on: workflow_dispatch: - pull_request: jobs: @@ -11,8 +10,6 @@ jobs: runs-on: macos-latest concurrency: - # When running on develop, use the sha to allow all runs of this workflow to run concurrently. - # Otherwise only allow a single run of this workflow on each branch, automatically cancelling older runs. group: ${{ github.ref == 'refs/heads/develop' && format('swiftlint-develop-{0}', github.sha) || format('swiftlint-{0}', github.ref) }} cancel-in-progress: true @@ -31,7 +28,20 @@ jobs: - name: Setup environment run: source ci_scripts/ci_prepare_env.sh && setup_github_actions_environment + xcodes select 16.1 - name: SwiftLint - run: - bundle exec fastlane linting + run: | + bundle exec fastlane linting -- --reporter sarif --output swiftlint.report.sarif + continue-on-error: true + + - name: Prepare swiftlint.report.sarif + if: success() || failure() + run: | + swift PrepareSarifToUpload.swift + + - name: Upload report + uses: github/codeql-action/upload-sarif@v3 + if: success() || failure() + with: + sarif_file: swiftlint.report.sarif diff --git a/.swiftlint.yml b/.swiftlint.yml index c9ff6d2bb..391feb612 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -1,3 +1,4 @@ +warning_threshold: 1 disabled_rules: # rule identifiers to exclude from running - identifier_name - comment_spacing @@ -56,7 +57,7 @@ trailing_whitespace: ignores_empty_lines: true file_length: - warning: 1200 + warning: 850 error: 1500 function_parameter_count: @@ -72,11 +73,4 @@ type_name: - iPhone - API -identifier_name: - min_length: # only min_length - error: 1 # only error - # excluded: # excluded via string array -# - id -# - URL -# - GlobalAPIKey reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, junit, html, emoji, sonarqube, markdown) diff --git a/Authorization/Authorization.xcodeproj/xcshareddata/xcschemes/Authorization.xcscheme b/Authorization/Authorization.xcodeproj/xcshareddata/xcschemes/Authorization.xcscheme index aef1b20d0..138a67b67 100644 --- a/Authorization/Authorization.xcodeproj/xcshareddata/xcschemes/Authorization.xcscheme +++ b/Authorization/Authorization.xcodeproj/xcshareddata/xcschemes/Authorization.xcscheme @@ -1,6 +1,6 @@ Bool { let calendar = Calendar.current guard let nextWeek = calendar.date(byAdding: .weekOfYear, value: 1, to: currentDate) else { return false } @@ -121,19 +121,19 @@ public extension Date { } self = date } - - init(milliseconds: Double) { - let now = Date() - let calendar = Calendar.current - var components = calendar.dateComponents([.year, .month, .day, .hour, .minute, .second], from: now) - components.nanosecond = Int((milliseconds.truncatingRemainder(dividingBy: 1)) * 1000000) - let seconds = Int(milliseconds) - components.second = seconds % 60 - components.minute = (seconds / 60) % 60 - components.hour = (seconds / 3600) % 24 - let date = calendar.date(from: components) ?? Date() - self = date - } + + init(milliseconds: Double) { + let now = Date() + let calendar = Calendar.current + var components = calendar.dateComponents([.year, .month, .day, .hour, .minute, .second], from: now) + components.nanosecond = Int((milliseconds.truncatingRemainder(dividingBy: 1)) * 1000000) + let seconds = Int(milliseconds) + components.second = seconds % 60 + components.minute = (seconds / 60) % 60 + components.hour = (seconds / 3600) % 24 + let date = calendar.date(from: components) ?? Date() + self = date + } } public enum DateStringStyle { @@ -153,11 +153,11 @@ public extension Date { func secondsSinceMidnight() -> Double { let calendar = Calendar.current let components = calendar.dateComponents([.hour, .minute, .second], from: self) - + guard let hours = components.hour, let minutes = components.minute, let seconds = components.second else { return 0.0 } - + let totalSeconds = Double(hours) * 3600.0 + Double(minutes) * 60.0 + Double(seconds) return totalSeconds } @@ -193,7 +193,7 @@ public extension Date { } let date = dateFormatter.string(from: self) - + switch style { case .courseStartsMonthDDYear: return CoreLocalization.Date.courseStarts + " " + date @@ -229,17 +229,12 @@ public extension Date { case .shortWeekdayMonthDayYear: return ( dueIn ? CoreLocalization.Date.dueIn : "" - ) + getShortWeekdayMonthDayYear(dateFormatterString: date) + ) + date } } private func applyShortWeekdayMonthDayYear(dateFormatter: DateFormatter) { - dateFormatter.dateFormat = "MMMM d, yyyy" - } - - private func getShortWeekdayMonthDayYear(dateFormatterString: String) -> String { - let days = Calendar.current.dateComponents([.day], from: self, to: Date()) - return dateFormatterString + dateFormatter.dateFormat = "MMMM d, yyyy" } func isCurrentYear() -> Bool { @@ -253,7 +248,7 @@ public extension Date { func isEarlierThanOrEqualTo(date: Date) -> Bool { timeIntervalSince1970 <= date.timeIntervalSince1970 } - + func isLaterThanOrEqualTo(date: Date) -> Bool { timeIntervalSince1970 >= date.timeIntervalSince1970 } diff --git a/Core/Core/Network/AuthEndpoint.swift b/Core/Core/Network/AuthEndpoint.swift index d5fe55296..2ec1a78ad 100644 --- a/Core/Core/Network/AuthEndpoint.swift +++ b/Core/Core/Network/AuthEndpoint.swift @@ -67,7 +67,7 @@ enum AuthEndpoint: EndPointType { switch self { case let .getAccessToken(username, password, clientId, tokenType): let params: [String: Encodable & Sendable] = [ - "grant_type": Constants.GrantTypePassword, + "grant_type": AuthConstants.GrantTypePassword, "client_id": clientId, "username": username, "password": password, diff --git a/Core/Core/Network/DownloadManager.swift b/Core/Core/Network/DownloadManager.swift index 7bf031a9f..c12347d10 100644 --- a/Core/Core/Network/DownloadManager.swift +++ b/Core/Core/Network/DownloadManager.swift @@ -437,7 +437,6 @@ public class DownloadManager: DownloadManagerProtocol { self.failedDownloads = [] } } - print(">>> IS NIL") return } if !connectivity.isInternetAvaliable { @@ -824,79 +823,3 @@ public final class BackgroundTaskProvider: @unchecked Sendable { } } } - -// Mark - For testing and SwiftUI preview -#if DEBUG -public class DownloadManagerMock: DownloadManagerProtocol { - - public init() {} - - public func updateUnzippedFileSize(for sequentials: [CourseSequential]) -> [CourseSequential] {[]} - - public var currentDownloadTask: DownloadDataTask? { - return nil - } - - public func publisher() -> AnyPublisher { - return Just(1).eraseToAnyPublisher() - } - - public func eventPublisher() -> AnyPublisher { - return Just( - .canceled( - .init( - id: "", - blockId: "", - courseId: "", - userId: 0, - url: "", - fileName: "", - displayName: "", - progress: 1, - resumeData: nil, - state: .inProgress, - type: .video, - fileSize: 0, - lastModified: "" - ) - ) - ).eraseToAnyPublisher() - } - - public func addToDownloadQueue(blocks: [CourseBlock]) {} - - public func getDownloadTasks() -> [DownloadDataTask] { - [] - } - - public func getDownloadTasksForCourse(_ courseId: String) async -> [DownloadDataTask] { - await withCheckedContinuation { continuation in - continuation.resume(returning: []) - } - } - - public func cancelDownloading(courseId: String, blocks: [CourseBlock]) async throws {} - - public func cancelDownloading(task: DownloadDataTask) {} - - public func cancelDownloading(courseId: String) async {} - - public func cancelAllDownloading() async throws {} - - public func resumeDownloading() {} - - public func deleteFile(blocks: [CourseBlock]) {} - - public func deleteAllFiles() {} - - public func fileUrl(for blockId: String) -> URL? { - return nil - } - - public func isLargeVideosSize(blocks: [CourseBlock]) -> Bool { - false - } - - public func removeAppSupportDirectoryUnusedContent() {} -} -#endif diff --git a/Core/Core/Network/DownloadManagerMock.swift b/Core/Core/Network/DownloadManagerMock.swift new file mode 100644 index 000000000..f7889df09 --- /dev/null +++ b/Core/Core/Network/DownloadManagerMock.swift @@ -0,0 +1,85 @@ +// +// DownloadManagerMock.swift +// Core +// +// Created by Ivan Stepanok on 11.12.2024. +// + +import Foundation +import Combine + +// Mark - For testing and SwiftUI preview +#if DEBUG +public class DownloadManagerMock: DownloadManagerProtocol { + + public init() {} + + public func updateUnzippedFileSize(for sequentials: [CourseSequential]) -> [CourseSequential] {[]} + + public var currentDownloadTask: DownloadDataTask? { + return nil + } + + public func publisher() -> AnyPublisher { + return Just(1).eraseToAnyPublisher() + } + + public func eventPublisher() -> AnyPublisher { + return Just( + .canceled( + .init( + id: "", + blockId: "", + courseId: "", + userId: 0, + url: "", + fileName: "", + displayName: "", + progress: 1, + resumeData: nil, + state: .inProgress, + type: .video, + fileSize: 0, + lastModified: "" + ) + ) + ).eraseToAnyPublisher() + } + + public func addToDownloadQueue(blocks: [CourseBlock]) {} + + public func getDownloadTasks() -> [DownloadDataTask] { + [] + } + + public func getDownloadTasksForCourse(_ courseId: String) async -> [DownloadDataTask] { + await withCheckedContinuation { continuation in + continuation.resume(returning: []) + } + } + + public func cancelDownloading(courseId: String, blocks: [CourseBlock]) async throws {} + + public func cancelDownloading(task: DownloadDataTask) {} + + public func cancelDownloading(courseId: String) async {} + + public func cancelAllDownloading() async throws {} + + public func resumeDownloading() {} + + public func deleteFile(blocks: [CourseBlock]) {} + + public func deleteAllFiles() {} + + public func fileUrl(for blockId: String) -> URL? { + return nil + } + + public func isLargeVideosSize(blocks: [CourseBlock]) -> Bool { + false + } + + public func removeAppSupportDirectoryUnusedContent() {} +} +#endif diff --git a/Core/Core/Network/RequestInterceptor.swift b/Core/Core/Network/RequestInterceptor.swift index 155caa337..c165bc4b0 100644 --- a/Core/Core/Network/RequestInterceptor.swift +++ b/Core/Core/Network/RequestInterceptor.swift @@ -122,7 +122,7 @@ final public class RequestInterceptor: Alamofire.RequestInterceptor { let url = config.baseURL.appendingPathComponent("/oauth2/access_token") let parameters: [String: Encodable & Sendable] = [ - "grant_type": Constants.GrantTypeRefreshToken, + "grant_type": AuthConstants.GrantTypeRefreshToken, "client_id": config.oAuthClientId, "refresh_token": refreshToken, "token_type": config.tokenType.rawValue, diff --git a/Core/Core/View/Base/SnackBarView.swift b/Core/Core/View/Base/SnackBarView.swift index fc61351de..9a0aad422 100644 --- a/Core/Core/View/Base/SnackBarView.swift +++ b/Core/Core/View/Base/SnackBarView.swift @@ -14,7 +14,7 @@ public struct SnackBarView: View { var action: (() -> Void)? private var safeArea: CGFloat { - UIApplication.shared.keyWindow?.safeAreaInsets.bottom ?? 0 + UIApplication.shared.oexKeyWindow?.safeAreaInsets.bottom ?? 0 } private let minHeight: CGFloat = 50 diff --git a/Course/Course.xcodeproj/project.pbxproj b/Course/Course.xcodeproj/project.pbxproj index 4af8a7479..ca106fe78 100644 --- a/Course/Course.xcodeproj/project.pbxproj +++ b/Course/Course.xcodeproj/project.pbxproj @@ -781,7 +781,7 @@ attributes = { BuildIndependentTargetsInParallel = 1; LastSwiftUpdateCheck = 1410; - LastUpgradeCheck = 1400; + LastUpgradeCheck = 1610; TargetAttributes = { 023812E3297AC8EA0087098F = { CreatedOnToolsVersion = 14.1; @@ -1064,6 +1064,7 @@ buildSettings = { CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; + DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = L8PG7LC3Y3; GENERATE_INFOPLIST_FILE = YES; IPHONEOS_DEPLOYMENT_TARGET = 16.4; @@ -1085,6 +1086,7 @@ buildSettings = { CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; + DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = L8PG7LC3Y3; GENERATE_INFOPLIST_FILE = YES; IPHONEOS_DEPLOYMENT_TARGET = 16.4; @@ -1106,6 +1108,7 @@ buildSettings = { CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; + DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = L8PG7LC3Y3; GENERATE_INFOPLIST_FILE = YES; IPHONEOS_DEPLOYMENT_TARGET = 16.4; @@ -1127,6 +1130,7 @@ buildSettings = { CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; + DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = L8PG7LC3Y3; GENERATE_INFOPLIST_FILE = YES; IPHONEOS_DEPLOYMENT_TARGET = 16.4; @@ -1148,6 +1152,7 @@ buildSettings = { CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; + DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = L8PG7LC3Y3; GENERATE_INFOPLIST_FILE = YES; IPHONEOS_DEPLOYMENT_TARGET = 16.4; @@ -1169,6 +1174,7 @@ buildSettings = { CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; + DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = L8PG7LC3Y3; GENERATE_INFOPLIST_FILE = YES; IPHONEOS_DEPLOYMENT_TARGET = 16.4; @@ -1311,6 +1317,7 @@ baseConfigurationReference = ADC2A1B8183A674705F5F7E2 /* Pods-App-Course.debug.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; @@ -1318,6 +1325,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; @@ -1329,6 +1337,7 @@ "@loader_path/Frameworks", ); MARKETING_VERSION = 1.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++20"; PRODUCT_BUNDLE_IDENTIFIER = org.openedx.CourseDetails; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -1347,6 +1356,7 @@ baseConfigurationReference = F4640D6B8065C404E0BC30D5 /* Pods-App-Course.release.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; @@ -1354,6 +1364,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; @@ -1365,6 +1376,7 @@ "@loader_path/Frameworks", ); MARKETING_VERSION = 1.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++20"; PRODUCT_BUNDLE_IDENTIFIER = org.openedx.CourseDetails; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -1446,6 +1458,7 @@ baseConfigurationReference = EDCFD7A1BFD2200B14F10F71 /* Pods-App-Course.debugdev.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; @@ -1453,6 +1466,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; @@ -1464,6 +1478,7 @@ "@loader_path/Frameworks", ); MARKETING_VERSION = 1.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++20"; PRODUCT_BUNDLE_IDENTIFIER = org.openedx.CourseDetails; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -1546,6 +1561,7 @@ baseConfigurationReference = E954A304FDC0409BEC34C125 /* Pods-App-Course.debugprod.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; @@ -1553,6 +1569,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; @@ -1564,6 +1581,7 @@ "@loader_path/Frameworks", ); MARKETING_VERSION = 1.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++20"; PRODUCT_BUNDLE_IDENTIFIER = org.openedx.CourseDetails; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -1640,6 +1658,7 @@ baseConfigurationReference = 4D2F08669DD2579EAAE02E2F /* Pods-App-Course.releasedev.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; @@ -1647,6 +1666,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; @@ -1658,6 +1678,7 @@ "@loader_path/Frameworks", ); MARKETING_VERSION = 1.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++20"; PRODUCT_BUNDLE_IDENTIFIER = org.openedx.CourseDetails; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -1733,6 +1754,7 @@ baseConfigurationReference = F496B47B12CFD866EA6845CC /* Pods-App-Course.releaseprod.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; @@ -1740,6 +1762,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; @@ -1751,6 +1774,7 @@ "@loader_path/Frameworks", ); MARKETING_VERSION = 1.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++20"; PRODUCT_BUNDLE_IDENTIFIER = org.openedx.CourseDetails; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -1832,6 +1856,7 @@ baseConfigurationReference = 3D506212980347A9D5A70E20 /* Pods-App-Course.debugstage.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; @@ -1839,6 +1864,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; @@ -1850,6 +1876,7 @@ "@loader_path/Frameworks", ); MARKETING_VERSION = 1.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++20"; PRODUCT_BUNDLE_IDENTIFIER = org.openedx.CourseDetails; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -1869,6 +1896,7 @@ buildSettings = { CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; + DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = L8PG7LC3Y3; GENERATE_INFOPLIST_FILE = YES; IPHONEOS_DEPLOYMENT_TARGET = 16.4; @@ -1947,6 +1975,7 @@ baseConfigurationReference = A47C63D9EB0D866F303D4588 /* Pods-App-Course.releasestage.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; @@ -1954,6 +1983,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; @@ -1965,6 +1995,7 @@ "@loader_path/Frameworks", ); MARKETING_VERSION = 1.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++20"; PRODUCT_BUNDLE_IDENTIFIER = org.openedx.CourseDetails; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -1983,6 +2014,7 @@ buildSettings = { CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; + DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = L8PG7LC3Y3; GENERATE_INFOPLIST_FILE = YES; IPHONEOS_DEPLOYMENT_TARGET = 16.4; diff --git a/Course/Course.xcodeproj/xcshareddata/xcschemes/Course.xcscheme b/Course/Course.xcodeproj/xcshareddata/xcschemes/Course.xcscheme index f6f5a5c64..d512b4343 100644 --- a/Course/Course.xcodeproj/xcshareddata/xcschemes/Course.xcscheme +++ b/Course/Course.xcodeproj/xcshareddata/xcschemes/Course.xcscheme @@ -1,6 +1,6 @@ UserComment { return try await repository.getResponse(responseID: responseID) } + //swiftlint:enable todo public func addCommentTo(threadID: String, rawBody: String, parentID: String? = nil) async throws -> Post { return try await repository.addCommentTo(threadID: threadID, diff --git a/Discussion/Discussion/Presentation/Comments/Base/BaseResponsesViewModel.swift b/Discussion/Discussion/Presentation/Comments/Base/BaseResponsesViewModel.swift index 4722b958a..da3070355 100644 --- a/Discussion/Discussion/Presentation/Comments/Base/BaseResponsesViewModel.swift +++ b/Discussion/Discussion/Presentation/Comments/Base/BaseResponsesViewModel.swift @@ -137,7 +137,7 @@ public class BaseResponsesViewModel { } func addNewPost(_ post: Post) { - var newPostWithAvatar = post + let newPostWithAvatar = post postComments?.comments.append(newPostWithAvatar) itemsCount += 1 } diff --git a/OpenEdX.xcodeproj/xcshareddata/xcschemes/OpenEdXDev.xcscheme b/OpenEdX.xcodeproj/xcshareddata/xcschemes/OpenEdXDev.xcscheme index cd0feecf1..9ed15e820 100644 --- a/OpenEdX.xcodeproj/xcshareddata/xcschemes/OpenEdXDev.xcscheme +++ b/OpenEdX.xcodeproj/xcshareddata/xcschemes/OpenEdXDev.xcscheme @@ -1,6 +1,6 @@