diff --git a/.swiftlint.yml b/.swiftlint.yml index 2d0f1d9a0..e87896e4b 100755 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -8,6 +8,7 @@ opt_in_rules: - force_unwrapping - private_action - explicit_init + - shorthand_optional_binding included: - ElementX diff --git a/ElementX/Sources/Other/UserIndicator/UserIndicatorModalView.swift b/ElementX/Sources/Other/UserIndicator/UserIndicatorModalView.swift index 3cc36f83b..c9cfbe45d 100644 --- a/ElementX/Sources/Other/UserIndicator/UserIndicatorModalView.swift +++ b/ElementX/Sources/Other/UserIndicator/UserIndicatorModalView.swift @@ -24,7 +24,7 @@ struct UserIndicatorModalView: View { var body: some View { ZStack { VStack(spacing: 12.0) { - if let progressFraction = progressFraction { + if let progressFraction { ProgressView(value: progressFraction) } else { ProgressView() diff --git a/ElementX/Sources/Screens/Authentication/LoginScreen/LoginCoordinator.swift b/ElementX/Sources/Screens/Authentication/LoginScreen/LoginCoordinator.swift index 2dff6267a..cd110cce0 100644 --- a/ElementX/Sources/Screens/Authentication/LoginScreen/LoginCoordinator.swift +++ b/ElementX/Sources/Screens/Authentication/LoginScreen/LoginCoordinator.swift @@ -205,7 +205,7 @@ final class LoginCoordinator: CoordinatorProtocol { let coordinator = ServerSelectionCoordinator(parameters: parameters) coordinator.callback = { [weak self, weak coordinator] action in - guard let self, let coordinator = coordinator else { return } + guard let self, let coordinator else { return } self.serverSelectionCoordinator(coordinator, didCompleteWith: action) } diff --git a/ElementX/Sources/Services/Emojis/EmojiProvider.swift b/ElementX/Sources/Services/Emojis/EmojiProvider.swift index 7f845606d..d79296068 100644 --- a/ElementX/Sources/Services/Emojis/EmojiProvider.swift +++ b/ElementX/Sources/Services/Emojis/EmojiProvider.swift @@ -40,7 +40,7 @@ class EmojiProvider: EmojiProviderProtocol { func getCategories(searchString: String? = nil) async -> [EmojiCategory] { let emojiCategories = await loadIfNeeded() - if let searchString = searchString, searchString.isEmpty == false { + if let searchString, searchString.isEmpty == false { return search(searchString: searchString, emojiCategories: emojiCategories) } else { return emojiCategories diff --git a/changelog.d/pr-579.build b/changelog.d/pr-579.build new file mode 100644 index 000000000..afa078deb --- /dev/null +++ b/changelog.d/pr-579.build @@ -0,0 +1 @@ +Update SwiftLint and SwiftFormat rules. \ No newline at end of file