Skip to content

Commit

Permalink
Fix swift lint conditional_returns_on_newline
Browse files Browse the repository at this point in the history
  • Loading branch information
levieggertcru committed Jul 16, 2024
1 parent ad411ee commit 1973c44
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ class RealmDownloadedLanguagesCache {

func getDownloadedLanguage(languageId: String) -> DownloadedLanguageDataModel? {

guard let downloadedLanguage = realmDatabase.openRealm().object(ofType: RealmDownloadedLanguage.self, forPrimaryKey: languageId) else { return nil }
guard let downloadedLanguage = realmDatabase.openRealm()
.object(ofType: RealmDownloadedLanguage.self, forPrimaryKey: languageId) else {

return nil
}

return DownloadedLanguageDataModel(realmDownloadedLanguage: downloadedLanguage)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ extension DownloadableLanguageListItemDomainModel: Identifiable {
}

func wasDownloadedBefore(date: Date) -> Bool {
guard let downloadedAt = downloadStatus.downloadedAt else { return false }

guard let downloadedAt = downloadStatus.downloadedAt else {
return false
}

return downloadedAt < date
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ struct DownloadableLanguageItemView: View {
}

private func stopProgressAnimationTimer() {
guard progressAnimationTimer != nil else { return }

guard progressAnimationTimer != nil else {
return
}

progressAnimationTimer?.invalidate()
progressAnimationTimer = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ struct LanguageDownloadIcon: View {

private func shouldFinishAnimatingDownloadProgress() -> Bool {

guard let animationDownloadProgress = animationDownloadProgress else { return false }
guard let animationDownloadProgress = animationDownloadProgress else {
return false
}

return animationDownloadProgress <= 1
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ class DashboardViewModel: ObservableObject {
$currentTab.eraseToAnyPublisher()
.sink { [weak self] currentTab in

guard let self = self else { return }
guard let self = self else {
return
}

dashboardTabObserver.send(self.tabs[currentTab])
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ class GetToolFilterCategoriesRepository: GetToolFilterCategoriesRepositoryInterf

func getCategoryFilter(from categoryId: String?, translatedInAppLanguage: AppLanguageDomainModel) -> CategoryFilterDomainModel? {

guard let categoryId = categoryId else { return nil }
guard let categoryId = categoryId else {
return nil
}

return createCategoryDomainModel(with: categoryId, translatedInAppLanguage: translatedInAppLanguage, filteredByLanguageId: nil)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ class ToolFilterLanguageSelectionViewModel: ObservableObject {
.switchToLatest()
.receive(on: DispatchQueue.main)
.sink { [weak self] viewLanguageFiltersDomainModel in
guard let self = self else { return }

guard let self = self else {
return
}

let interfaceStrings = viewLanguageFiltersDomainModel.interfaceStrings

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,9 @@ extension MobileContentPagesViewModel {

private func countLanguageUsage(localeId: String) {

if languageUsageAlreadyCountedThisSession(localeId: localeId) { return }
if languageUsageAlreadyCountedThisSession(localeId: localeId) {
return
}

let locale = Locale(identifier: localeId)

Expand Down

0 comments on commit 1973c44

Please sign in to comment.