Skip to content

Commit

Permalink
Run SwiftLint autocorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
Pietro Caselani committed Mar 30, 2020
1 parent c813e33 commit fc26d28
Show file tree
Hide file tree
Showing 138 changed files with 404 additions and 418 deletions.
Expand Up @@ -52,7 +52,7 @@ final class AppStateViewController: UITableViewController {
}

override func numberOfSections(in _: UITableView) -> Int {
return configurationSections.count
configurationSections.count
}

override func tableView(_: UITableView, numberOfRowsInSection section: Int) -> Int {
Expand Down
2 changes: 1 addition & 1 deletion CouchTrackerApp/Core/Bundle+CouchTrackerApp.swift
Expand Up @@ -16,5 +16,5 @@ public final class CouchTrackerAppBundleProvider: BundleProvider {
public func couchTrackerAppImage(named name: String,
bundleProvider: BundleProvider = CouchTrackerAppBundleProvider.instance,
compatibleWith traits: UITraitCollection? = nil) -> UIImage? {
return UIImage(named: name, in: bundleProvider.bundle, compatibleWith: traits)
UIImage(named: name, in: bundleProvider.bundle, compatibleWith: traits)
}
2 changes: 1 addition & 1 deletion CouchTrackerApp/Design/Fonts.swift
Expand Up @@ -3,7 +3,7 @@ public enum Fonts {
public static let secondaryText = UIFont.systemFont(ofSize: Sizes.secondaryText)
public static let titleBold = bold(ofSize: Sizes.title)
public static func bold(ofSize size: CGFloat = UIFont.labelFontSize) -> UIFont {
return UIFont.boldSystemFont(ofSize: size)
UIFont.boldSystemFont(ofSize: size)
}

public enum Sizes {
Expand Down
4 changes: 2 additions & 2 deletions CouchTrackerApp/Environment.swift
Expand Up @@ -28,11 +28,11 @@ public final class Environment {
public let syncStateObservable: SyncStateObservable

var currentAppState: AppState {
return Environment.getAppState(userDefaults: userDefaults)
Environment.getAppState(userDefaults: userDefaults)
}

private static func getAppState(userDefaults: UserDefaults) -> AppState {
return UserDefaultsAppStateDataHolder.currentAppConfig(userDefaults)
UserDefaultsAppStateDataHolder.currentAppConfig(userDefaults)
}

// swiftlint:disable function_body_length
Expand Down
14 changes: 7 additions & 7 deletions CouchTrackerApp/Extensions/UIColor+CouchTracker.swift
Expand Up @@ -13,7 +13,7 @@ extension UIColor {
**/

public static var ctdarkerBunker: UIColor {
return UIColor(red: 0.1764705926, green: 0.1764705926, blue: 0.1764705926, alpha: 1.0000000000)
UIColor(red: 0.1764705926, green: 0.1764705926, blue: 0.1764705926, alpha: 1.0000000000)
}

/**
Expand All @@ -26,7 +26,7 @@ extension UIColor {
**/

public static var ctbunker: UIColor {
return UIColor(red: 0.1725489944, green: 0.1725489944, blue: 0.1725489944, alpha: 1.0000000000)
UIColor(red: 0.1725489944, green: 0.1725489944, blue: 0.1725489944, alpha: 1.0000000000)
}

/**
Expand All @@ -39,7 +39,7 @@ extension UIColor {
**/

public static var ctzircon: UIColor {
return UIColor(red: 0.8823528886, green: 0.8823528886, blue: 0.8823528886, alpha: 1.0000000000)
UIColor(red: 0.8823528886, green: 0.8823528886, blue: 0.8823528886, alpha: 1.0000000000)
}

/**
Expand All @@ -52,7 +52,7 @@ extension UIColor {
**/

public static var ctblack: UIColor {
return UIColor(red: 0.1333332956, green: 0.1333332956, blue: 0.1333332956, alpha: 1.0000000000)
UIColor(red: 0.1333332956, green: 0.1333332956, blue: 0.1333332956, alpha: 1.0000000000)
}

/**
Expand All @@ -65,7 +65,7 @@ extension UIColor {
**/

public static var ctjaguar: UIColor {
return UIColor(red: 0.1647059023, green: 0.1647059023, blue: 0.1647059023, alpha: 1.0000000000)
UIColor(red: 0.1647059023, green: 0.1647059023, blue: 0.1647059023, alpha: 1.0000000000)
}

/**
Expand All @@ -78,7 +78,7 @@ extension UIColor {
**/

public static var ctconcord: UIColor {
return UIColor(red: 0.4862745106, green: 0.4862745106, blue: 0.4862745106, alpha: 1.0000000000)
UIColor(red: 0.4862745106, green: 0.4862745106, blue: 0.4862745106, alpha: 1.0000000000)
}

/**
Expand All @@ -91,6 +91,6 @@ extension UIColor {
**/

public static var ctfog: UIColor {
return UIColor(red: 0.8274509907, green: 0.7960783839, blue: 0.8941177130, alpha: 1.0000000000)
UIColor(red: 0.8274509907, green: 0.7960783839, blue: 0.8941177130, alpha: 1.0000000000)
}
}
8 changes: 4 additions & 4 deletions CouchTrackerApp/Images/Images.swift
@@ -1,18 +1,18 @@
public enum Images {
// swiftlint:disable force_unwrapping
public static func filter() -> UIImage {
return couchTrackerAppImage(named: "Filter")!
couchTrackerAppImage(named: "Filter")!
}

public static func direction() -> UIImage {
return couchTrackerAppImage(named: "Direction")!
couchTrackerAppImage(named: "Direction")!
}

public static func posterPlacehoder() -> UIImage {
return couchTrackerAppImage(named: "PosterPlacehoder")!
couchTrackerAppImage(named: "PosterPlacehoder")!
}

public static func backdropPlaceholder() -> UIImage {
return couchTrackerAppImage(named: "BackdropPlaceholder")!
couchTrackerAppImage(named: "BackdropPlaceholder")!
}
}
Expand Up @@ -71,21 +71,21 @@ final class MoviesManagerViewController: TabmanViewController, TMBarCouchTracker

extension MoviesManagerViewController: TMBarDataSource {
func barItem(for _: TMBar, at index: Int) -> TMBarItemable {
return TMBarItem(title: pages[index].title)
TMBarItem(title: pages[index].title)
}
}

extension MoviesManagerViewController: PageboyViewControllerDataSource {
func numberOfViewControllers(in _: PageboyViewController) -> Int {
return pages.count
pages.count
}

func viewController(for _: PageboyViewController,
at index: PageboyViewController.PageIndex) -> UIViewController? {
return pages[index].page as? UIViewController
pages[index].page as? UIViewController
}

func defaultPage(for _: PageboyViewController) -> PageboyViewController.Page? {
return Page.at(index: defaultPageIndex)
Page.at(index: defaultPageIndex)
}
}
Expand Up @@ -6,7 +6,7 @@ import TraktSwift

extension GenreRealmDataSource: GenreDataSource {
public func fetchGenres() -> Maybe<[Genre]> {
return fetchRealmGenres().mapElements { $0.toEntity() }
fetchRealmGenres().mapElements { $0.toEntity() }
}

public func save(genres: [Genre]) throws {
Expand All @@ -21,13 +21,13 @@ extension RealmShowDataSource: ShowDataSource {
}

public func observeWatchedShow(showIds: ShowIds) -> Observable<WatchedShowEntity> {
return observeRealmWatchedShow(showIds: showIds.toRealm()).map { $0.toEntity() }
observeRealmWatchedShow(showIds: showIds.toRealm()).map { $0.toEntity() }
}
}

extension RealmShowsDataSource: WatchedShowEntitiesObservable, ShowsDataHolder {
public func observeWatchedShows() -> Observable<WatchedShowEntitiesState> {
return observeRealmWatchedShows().map { objectState -> WatchedShowEntitiesState in
observeRealmWatchedShows().map { objectState -> WatchedShowEntitiesState in
switch objectState {
case .notInitialized:
return WatchedShowEntitiesState.unavailable
Expand Down
8 changes: 4 additions & 4 deletions CouchTrackerApp/Persistence/Realm/RealmAdapters.swift
Expand Up @@ -4,7 +4,7 @@ import TraktSwift

extension GenreRealm {
func toEntity() -> Genre {
return Genre(name: name, slug: slug)
Genre(name: name, slug: slug)
}
}

Expand All @@ -21,7 +21,7 @@ extension Genre {

extension ShowIdsRealm {
func toEntity() -> ShowIds {
return ShowIds(trakt: trakt,
ShowIds(trakt: trakt,
tmdb: tmdb.value,
imdb: imdb,
slug: slug,
Expand All @@ -47,7 +47,7 @@ extension ShowIds {

extension SeasonIdsRealm {
public func toEntity() -> SeasonIds {
return SeasonIds(tvdb: tvdb.value, tmdb: tmdb.value, trakt: trakt, tvrage: tvrage.value)
SeasonIds(tvdb: tvdb.value, tmdb: tmdb.value, trakt: trakt, tvrage: tvrage.value)
}
}

Expand Down Expand Up @@ -87,7 +87,7 @@ extension WatchedEpisodeEntity {

extension EpisodeIdsRealm {
public func toEntity() -> EpisodeIds {
return EpisodeIds(trakt: trakt,
EpisodeIds(trakt: trakt,
tmdb: tmdb.value,
imdb: imdb,
tvdb: tvdb.value,
Expand Down
Expand Up @@ -10,7 +10,7 @@ final class SearchCollectionViewDataSource: NSObject, SearchDataSource {
}

func collectionView(_: UICollectionView, numberOfItemsInSection _: Int) -> Int {
return entities.count
entities.count
}

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
Expand Down
8 changes: 4 additions & 4 deletions CouchTrackerApp/Show/Manager/ShowManagerViewController.swift
Expand Up @@ -66,21 +66,21 @@ final class ShowManagerViewController: TabmanViewController, TMBarCouchTracker {

extension ShowManagerViewController: TMBarDataSource {
func barItem(for _: TMBar, at index: Int) -> TMBarItemable {
return TMBarItem(title: pages[index].title)
TMBarItem(title: pages[index].title)
}
}

extension ShowManagerViewController: PageboyViewControllerDataSource {
func numberOfViewControllers(in _: PageboyViewController) -> Int {
return pages.count
pages.count
}

func viewController(for _: PageboyViewController,
at index: PageboyViewController.PageIndex) -> UIViewController? {
return pages[index].page as? UIViewController
pages[index].page as? UIViewController
}

func defaultPage(for _: PageboyViewController) -> PageboyViewController.Page? {
return Page.at(index: defaultPageIndex)
Page.at(index: defaultPageIndex)
}
}
Expand Up @@ -34,7 +34,7 @@ final class ShowSeasonsViewController: UITableViewController {
}

override func tableView(_: UITableView, numberOfRowsInSection _: Int) -> Int {
return show?.seasons.count ?? 0
show?.seasons.count ?? 0
}

override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
Expand Down
Expand Up @@ -70,21 +70,21 @@ final class ShowsManagerViewController: TabmanViewController, TMBarCouchTracker

extension ShowsManagerViewController: TMBarDataSource {
func barItem(for _: TMBar, at index: Int) -> TMBarItemable {
return TMBarItem(title: pages[index].title)
TMBarItem(title: pages[index].title)
}
}

extension ShowsManagerViewController: PageboyViewControllerDataSource {
func numberOfViewControllers(in _: PageboyViewController) -> Int {
return pages.count
pages.count
}

func viewController(for _: PageboyViewController,
at index: PageboyViewController.PageIndex) -> UIViewController? {
return pages[index].page as? UIViewController
pages[index].page as? UIViewController
}

func defaultPage(for _: PageboyViewController) -> PageboyViewController.Page? {
return Page.at(index: defaultPageIndex)
Page.at(index: defaultPageIndex)
}
}
2 changes: 1 addition & 1 deletion CouchTrackerApp/Shows/Now/ShowsNowModule.swift
Expand Up @@ -2,6 +2,6 @@ import CouchTrackerCore

enum ShowsNowModule {
static func setupModule() -> BaseView {
return ShowsNowViewController()
ShowsNowViewController()
}
}
Expand Up @@ -10,7 +10,7 @@ final class TrendingCollectionViewDataSource: NSObject, TrendingDataSource, UICo
}

func collectionView(_: UICollectionView, numberOfItemsInSection _: Int) -> Int {
return viewModels.count
viewModels.count
}

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
Expand Down
2 changes: 1 addition & 1 deletion CouchTrackerCore/AppFlow/AppFlowDefaultPresenter.swift
Expand Up @@ -11,7 +11,7 @@ public final class AppFlowDefaultPresenter: AppFlowPresenter {
}

public func observeViewState() -> Observable<AppFlowViewState> {
return viewStateSubject.distinctUntilChanged()
viewStateSubject.distinctUntilChanged()
}

public func viewDidLoad() {
Expand Down
Expand Up @@ -7,7 +7,7 @@ public final class AppFlowUserDefaultsRepository: AppFlowRepository {

public var lastSelectedTab: Int {
get {
return userDefaults.integer(forKey: AppFlowUserDefaultsRepository.lastTabKey)
userDefaults.integer(forKey: AppFlowUserDefaultsRepository.lastTabKey)
}
set {
userDefaults.set(newValue, forKey: AppFlowUserDefaultsRepository.lastTabKey)
Expand Down
8 changes: 4 additions & 4 deletions CouchTrackerCore/AppState/AppState.swift
Expand Up @@ -5,7 +5,7 @@ public struct AppState: Hashable, Codable {
public let hideSpecials: Bool

public var isLogged: Bool {
return userSettings != nil
userSettings != nil
}

public init(userSettings: Settings?, hideSpecials: Bool) {
Expand All @@ -14,11 +14,11 @@ public struct AppState: Hashable, Codable {
}

public static func initialState() -> AppState {
return Defaults.appState
Defaults.appState
}

public func newBuilder() -> AppStateBuilder {
return AppStateBuilder(state: self)
AppStateBuilder(state: self)
}

public func buildUpon(_ builderFn: (inout AppStateBuilder) -> Void) -> AppState {
Expand All @@ -38,6 +38,6 @@ public struct AppStateBuilder {
}

public func build() -> AppState {
return AppState(userSettings: userSettings, hideSpecials: hideSpecials)
AppState(userSettings: userSettings, hideSpecials: hideSpecials)
}
}
2 changes: 1 addition & 1 deletion CouchTrackerCore/AppState/AppStateDefaultPresenter.swift
Expand Up @@ -23,7 +23,7 @@ public final class AppStateDefaultPresenter: AppStatePresenter {
}

public func observeViewState() -> Observable<AppStateViewState> {
return viewStateSubject.distinctUntilChanged()
viewStateSubject.distinctUntilChanged()
}

public func select(configuration: AppConfigurationViewModel) {
Expand Down
8 changes: 4 additions & 4 deletions CouchTrackerCore/AppState/AppStateManager.swift
Expand Up @@ -19,11 +19,11 @@ public final class DefaultAppStateManager: AppStateManager {
}

public func observe() -> Observable<AppState> {
return subject.distinctUntilChanged()
subject.distinctUntilChanged()
}

public func login() -> Completable {
return fetchUserSettings()
fetchUserSettings()
.asSingle()
.flatMapCompletable { settings -> Completable in
Completable.from { [weak self] in
Expand All @@ -33,7 +33,7 @@ public final class DefaultAppStateManager: AppStateManager {
}

public func toggleHideSpecials() -> Completable {
return Completable.from { [weak self] in
Completable.from { [weak self] in
try self?.updateAppStateTogglingHideSpecials()
}
}
Expand All @@ -47,7 +47,7 @@ public final class DefaultAppStateManager: AppStateManager {
}

private func fetchUserSettings() -> Observable<Settings> {
return trakt.users.rx.request(.settings)
trakt.users.rx.request(.settings)
.filterSuccessfulStatusAndRedirectCodes()
.map(Settings.self)
.asObservable()
Expand Down
Expand Up @@ -15,7 +15,7 @@ public final class UserDefaultsAppStateDataHolder: AppStateDataHolder {
}

public func currentAppState() throws -> AppState {
return UserDefaultsAppStateDataHolder.currentAppConfig(userDefaults)
UserDefaultsAppStateDataHolder.currentAppConfig(userDefaults)
}

public static func currentAppConfig(_ userDefaults: UserDefaults) -> AppState {
Expand Down

0 comments on commit fc26d28

Please sign in to comment.