mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Fix project warnings (#791)
- Swift 5.8 warnings - Run SwiftFormat 0.51.5 - Fix SwiftLint blanket_disable_command warnings. (Assets.swift will be fixed by SwiftGen).
This commit is contained in:
@@ -83,3 +83,4 @@ extension UntranslatedL10n {
|
|||||||
|
|
||||||
private final class BundleToken {}
|
private final class BundleToken {}
|
||||||
|
|
||||||
|
// swiftlint:enable all
|
||||||
|
|||||||
@@ -721,3 +721,4 @@ extension L10n {
|
|||||||
|
|
||||||
private final class BundleToken {}
|
private final class BundleToken {}
|
||||||
|
|
||||||
|
// swiftlint:enable all
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Generated using Sourcery 2.0.1 — https://github.com/krzysztofzablocki/Sourcery
|
// Generated using Sourcery 2.0.2 — https://github.com/krzysztofzablocki/Sourcery
|
||||||
// DO NOT EDIT
|
// DO NOT EDIT
|
||||||
|
|
||||||
// swiftlint:disable all
|
// swiftlint:disable all
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ struct LoadableImage<TransformerView: View, PlaceholderView: View>: View {
|
|||||||
guard image == nil, let mediaSource else { return }
|
guard image == nil, let mediaSource else { return }
|
||||||
|
|
||||||
if case let .success(image) = await imageProvider?.loadImageFromSource(mediaSource, size: size) {
|
if case let .success(image) = await imageProvider?.loadImageFromSource(mediaSource, size: size) {
|
||||||
self.cachedImage = image
|
cachedImage = image
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,8 +50,9 @@ class EmojiPickerScreenViewModel: EmojiPickerScreenViewModelType, EmojiPickerScr
|
|||||||
|
|
||||||
private func loadEmojis() {
|
private func loadEmojis() {
|
||||||
Task(priority: .userInitiated) { [weak self] in
|
Task(priority: .userInitiated) { [weak self] in
|
||||||
let categories = await emojiProvider.getCategories(searchString: nil)
|
guard let self else { return }
|
||||||
self?.state.categories = convert(emojiCategories: categories)
|
let categories = await self.emojiProvider.getCategories(searchString: nil)
|
||||||
|
self.state.categories = convert(emojiCategories: categories)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -90,3 +90,4 @@ private final class BundleToken {}
|
|||||||
{% else %}
|
{% else %}
|
||||||
// No string found
|
// No string found
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
// swiftlint:enable all
|
||||||
|
|||||||
@@ -105,3 +105,4 @@ private final class BundleToken {}
|
|||||||
{% else %}
|
{% else %}
|
||||||
// No string found
|
// No string found
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
// swiftlint:enable all
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
import XCTest
|
import XCTest
|
||||||
|
|
||||||
// swiftlint:disable force_unwrapping
|
// swiftlint:disable force_unwrapping
|
||||||
|
|
||||||
class DateTests: XCTestCase {
|
class DateTests: XCTestCase {
|
||||||
let calendar = Calendar.current
|
let calendar = Calendar.current
|
||||||
let startOfToday = Calendar.current.startOfDay(for: .now)
|
let startOfToday = Calendar.current.startOfDay(for: .now)
|
||||||
@@ -41,3 +42,5 @@ class DateTests: XCTestCase {
|
|||||||
XCTAssertEqual(theMillennium.formattedMinimal(), theMillennium.formatted(.dateTime.year().day().month()))
|
XCTAssertEqual(theMillennium.formattedMinimal(), theMillennium.formatted(.dateTime.year().day().month()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// swiftlint:enable force_unwrapping
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
import MatrixRustSDK
|
import MatrixRustSDK
|
||||||
import XCTest
|
import XCTest
|
||||||
|
|
||||||
// swiftlint:disable force_unwrapping
|
|
||||||
class MessageTimelineItemTests: XCTestCase {
|
class MessageTimelineItemTests: XCTestCase {
|
||||||
// MARK: Image
|
// MARK: Image
|
||||||
|
|
||||||
@@ -95,6 +94,8 @@ class MessageTimelineItemTests: XCTestCase {
|
|||||||
source: mediaSourceFromUrl(url: "mxc://doesnt/matter"),
|
source: mediaSourceFromUrl(url: "mxc://doesnt/matter"),
|
||||||
info: makeAudioInfo(mimetype: nil))
|
info: makeAudioInfo(mimetype: nil))
|
||||||
let messageItem = MockEventTimelineItem.message(from: imageContent)
|
let messageItem = MockEventTimelineItem.message(from: imageContent)
|
||||||
|
|
||||||
|
// swiftlint:disable:next force_unwrapping
|
||||||
XCTAssertTrue(messageItem.contentType!.conforms(to: .mpeg4Audio))
|
XCTAssertTrue(messageItem.contentType!.conforms(to: .mpeg4Audio))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,7 +129,6 @@ class MessageTimelineItemTests: XCTestCase {
|
|||||||
|
|
||||||
// MARK: - Mocks
|
// MARK: - Mocks
|
||||||
|
|
||||||
// swiftlint:disable force_cast
|
|
||||||
private struct MockEventTimelineItem: EventTimelineItemProtocol {
|
private struct MockEventTimelineItem: EventTimelineItemProtocol {
|
||||||
static func message<Content: MessageContentProtocol>(from content: Content) -> MessageTimelineItem<Content> {
|
static func message<Content: MessageContentProtocol>(from content: Content) -> MessageTimelineItem<Content> {
|
||||||
let item = MockEventTimelineItem(underlyingContent: content)
|
let item = MockEventTimelineItem(underlyingContent: content)
|
||||||
@@ -137,6 +137,7 @@ private struct MockEventTimelineItem: EventTimelineItemProtocol {
|
|||||||
|
|
||||||
let underlyingContent: MessageContentProtocol
|
let underlyingContent: MessageContentProtocol
|
||||||
|
|
||||||
|
// swiftlint:disable:next force_cast
|
||||||
func content() -> MatrixRustSDK.TimelineItemContent { underlyingContent as! TimelineItemContent }
|
func content() -> MatrixRustSDK.TimelineItemContent { underlyingContent as! TimelineItemContent }
|
||||||
|
|
||||||
func eventId() -> String? { UUID().uuidString }
|
func eventId() -> String? { UUID().uuidString }
|
||||||
|
|||||||
Reference in New Issue
Block a user