Fix codestyle

This commit is contained in:
Arkadiusz Fal 2021-06-19 22:17:48 +02:00
parent bb19fca073
commit cbcf58d5c7
6 changed files with 14 additions and 5 deletions

2
.swiftformat Normal file
View File

@ -0,0 +1,2 @@
--disable trailingCommas
--exclude Tests*

View File

@ -1 +1,9 @@
parent_config: https://raw.githubusercontent.com/sindresorhus/swiftlint-config/main/.swiftlint.yml
disabled_rules:
- opening_brace
excluded:
- Tests Apple TV
- Tests iOS
- Tests macOS

View File

@ -2,7 +2,7 @@ import SwiftUI
struct TrendingCountrySelectionView: View {
@Environment(\.presentationMode) private var presentationMode
@ObservedObject var provider: TrendingCountriesProvider
@ObservedObject private var provider = TrendingCountriesProvider()
@State private var query: String = ""
@Binding var selectedCountry: Country

View File

@ -6,7 +6,6 @@ struct TrendingView: View {
@Binding var tabSelection: TabSelection
@ObservedObject private var countriesProvider = TrendingCountriesProvider()
@ObservedObject private var videosProvider = TrendingVideosProvider()
@State private var selectingCategory = false
@ -32,7 +31,7 @@ struct TrendingView: View {
selectingCountry.toggle()
}
.fullScreenCover(isPresented: $selectingCountry) {
TrendingCountrySelectionView(provider: countriesProvider, selectedCountry: $trendingState.country)
TrendingCountrySelectionView(selectedCountry: $trendingState.country)
}
Spacer()

View File

@ -33,7 +33,7 @@ final class PlayerState: ObservableObject {
var externalMetadata = [
makeMetadataItem(.commonIdentifierTitle, value: video.title),
makeMetadataItem(.quickTimeMetadataGenre, value: video.genre),
makeMetadataItem(.commonIdentifierDescription, value: video.description),
makeMetadataItem(.commonIdentifierDescription, value: video.description)
]
if let thumbnailData = try? Data(contentsOf: video.thumbnailURL!),

View File

@ -29,7 +29,7 @@ final class SponsorBlockSegmentsProvider: ObservableObject {
private var parameters: [String: String] {
[
"videoID": id,
"categories": JSON(SponsorBlockSegmentsProvider.categories).rawString(String.Encoding.utf8)!,
"categories": JSON(SponsorBlockSegmentsProvider.categories).rawString(String.Encoding.utf8)!
]
}
}