Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Commit

Permalink
Reduce Xcode build warnings (#577)
Browse files Browse the repository at this point in the history
  • Loading branch information
devinreams committed Jul 25, 2018
1 parent 6b50a17 commit 2bfd303
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 16 deletions.
6 changes: 6 additions & 0 deletions .swiftlint.yml
Expand Up @@ -10,3 +10,9 @@ opt_in_rules:
- opening_brace
- trailing_semicolon
- file_header
cyclomatic_complexity: 15
line_length: 135
file_length:
warning: 450
function_body_length:
warning: 60
4 changes: 1 addition & 3 deletions Lockbox.xcodeproj/project.pbxproj
Expand Up @@ -12,7 +12,6 @@
2C2EC56220ADAB1D00AF8C44 /* LockBoxScreenGraph.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C2EC56120ADAB1D00AF8C44 /* LockBoxScreenGraph.swift */; };
2C2EC56420ADAB5400AF8C44 /* BaseTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C2EC56320ADAB5400AF8C44 /* BaseTestCase.swift */; };
391233682090E52800CB0233 /* Account.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 39DB3677208E2A800026DA92 /* Account.framework */; };
3912336A2090E52800CB0233 /* Deferred.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 39B1508820878E42007497E5 /* Deferred.framework */; };
3912336E2090E52800CB0233 /* FxA.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 39DB367D208E2F8F0026DA92 /* FxA.framework */; };
391233732090E56F00CB0233 /* SwiftyJSON.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 391233712090E56E00CB0233 /* SwiftyJSON.framework */; };
391233752090E56F00CB0233 /* SwiftKeychainWrapper.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 391233722090E56E00CB0233 /* SwiftKeychainWrapper.framework */; };
Expand Down Expand Up @@ -477,7 +476,6 @@
391233812090E60A00CB0233 /* XCGLogger.framework in Frameworks */,
39DB366D208E25710026DA92 /* FxAUtils.framework in Frameworks */,
391233782090E5A300CB0233 /* Shared.framework in Frameworks */,
3912336A2090E52800CB0233 /* Deferred.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -913,7 +911,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0930;
LastUpgradeCheck = 0930;
LastUpgradeCheck = 0940;
ORGANIZATIONNAME = Mozilla;
TargetAttributes = {
2C2EC55120ADA85A00AF8C44 = {
Expand Down
2 changes: 1 addition & 1 deletion Lockbox.xcodeproj/xcshareddata/xcschemes/lockbox.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "0940"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "0940"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions lockbox-ios/Common/Resources/lockbox-ios-Bridging-Header.h
Expand Up @@ -2,4 +2,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef Client_Shared_Bridging_Header_h
#define Client_Shared_Bridging_Header_h

#import <Foundation/Foundation.h>
#import <CommonCrypto/CommonCrypto.h>

#endif
4 changes: 2 additions & 2 deletions lockbox-ios/Presenter/ItemListPresenter.swift
Expand Up @@ -266,7 +266,7 @@ extension ItemListPresenter {
filterTextObservable: Observable<ItemListFilterAction>,
itemSortObservable: Observable<ItemListSortSetting>,
syncStateObservable: Observable<SyncState>,
storageStateObservable: Observable<LoginStoreState>) -> Driver<[ItemSectionModel]> { // swiftlint:disable:this line_length
storageStateObservable: Observable<LoginStoreState>) -> Driver<[ItemSectionModel]> {
let throttledListObservable = loginListObservable
.throttle(1.0, scheduler: ConcurrentMainScheduler.instance)
let throttledSyncStateObservable = syncStateObservable
Expand All @@ -281,7 +281,7 @@ extension ItemListPresenter {
throttledSyncStateObservable,
throttledStorageStateObservable
)
.map { (latest: ([Login], ItemListFilterAction, ItemListSortSetting, SyncState, LoginStoreState)) -> LoginListTextSort in // swiftlint:disable:this line_length
.map { (latest: ([Login], ItemListFilterAction, ItemListSortSetting, SyncState, LoginStoreState)) -> LoginListTextSort in
return LoginListTextSort(
logins: latest.0,
text: latest.1.filteringText,
Expand Down
2 changes: 1 addition & 1 deletion lockbox-ios/Presenter/WelcomePresenter.swift
Expand Up @@ -165,7 +165,7 @@ extension WelcomePresenter {
return Single.just(())
}

return target.biometryManager.authenticateWithMessage(latest?.email ?? Constant.string.unlockPlaceholder) // swiftlint:disable:this line_length
return target.biometryManager.authenticateWithMessage(latest?.email ?? Constant.string.unlockPlaceholder)
.catchError { _ in
// ignore errors from local authentication
return Observable.never().asSingle()
Expand Down
2 changes: 1 addition & 1 deletion lockbox-ios/Store/DataStore.swift
Expand Up @@ -110,7 +110,7 @@ class DataStore {
return self.storageStateSubject.asObservable()
}

init(dispatcher: Dispatcher = Dispatcher.shared, // swiftlint:disable:this function_body_length
init(dispatcher: Dispatcher = Dispatcher.shared,
profileFactory: @escaping ProfileFactory = defaultProfileFactory,
fxaLoginHelper: FxALoginHelper = FxALoginHelper.sharedInstance,
keychainWrapper: KeychainWrapper = KeychainWrapper.standard) {
Expand Down
2 changes: 1 addition & 1 deletion lockbox-ios/View/ItemDetailView.swift
Expand Up @@ -126,7 +126,7 @@ extension ItemDetailView: UIGestureRecognizerDelegate {
fileprivate func setupDataSource() {
self.dataSource = RxTableViewSectionedReloadDataSource<ItemDetailSectionModel>(
configureCell: { _, tableView, _, cellConfiguration in
guard let cell = tableView.dequeueReusableCell(withIdentifier: "itemdetailcell") as? ItemDetailCell else { // swiftlint:disable:this line_length
guard let cell = tableView.dequeueReusableCell(withIdentifier: "itemdetailcell") as? ItemDetailCell else {
fatalError("couldn't find the right cell!")
}

Expand Down
2 changes: 1 addition & 1 deletion lockbox-ios/View/ItemListView.swift
Expand Up @@ -172,7 +172,7 @@ extension ItemListView {

retCell = cell
case .Item(let title, let username, _):
guard let cell = tableView.dequeueReusableCell(withIdentifier: "itemlistcell") as? ItemListCell else { // swiftlint:disable:this line_length
guard let cell = tableView.dequeueReusableCell(withIdentifier: "itemlistcell") as? ItemListCell else {
fatalError("couldn't find the right cell!")
}

Expand Down
7 changes: 4 additions & 3 deletions lockbox-ios/View/RootView.swift
@@ -1,6 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// swiftlint:disable line_length

import UIKit

Expand Down Expand Up @@ -78,7 +79,7 @@ class RootView: UIViewController, RootViewProtocol {
case .fxa:
self.currentViewController?.pushViewController(FxAView(), animated: true)
case .onboardingConfirmation:
if let onboardingConfirmationView = UIStoryboard(name: "OnboardingConfirmation", bundle: nil).instantiateViewController(withIdentifier: "onboardingconfirmation") as? OnboardingConfirmationView { // swiftlint:disable:this line_length
if let onboardingConfirmationView = UIStoryboard(name: "OnboardingConfirmation", bundle: nil).instantiateViewController(withIdentifier: "onboardingconfirmation") as? OnboardingConfirmationView {
self.currentViewController?.pushViewController(onboardingConfirmationView, animated: true)
}
}
Expand All @@ -89,7 +90,7 @@ class RootView: UIViewController, RootViewProtocol {
case .list:
self.currentViewController?.popToRootViewController(animated: true)
case .detail(let id):
if let itemDetailView = UIStoryboard(name: "ItemDetail", bundle: nil).instantiateViewController(withIdentifier: "itemdetailview") as? ItemDetailView { // swiftlint:disable:this line_length
if let itemDetailView = UIStoryboard(name: "ItemDetail", bundle: nil).instantiateViewController(withIdentifier: "itemdetailview") as? ItemDetailView {
itemDetailView.itemId = id
self.currentViewController?.pushViewController(itemDetailView, animated: true)
}
Expand All @@ -101,7 +102,7 @@ class RootView: UIViewController, RootViewProtocol {
case .list:
self.currentViewController?.popToRootViewController(animated: true)
case .account:
if let accountSettingView = UIStoryboard(name: "AccountSetting", bundle: nil).instantiateViewController(withIdentifier: "accountsetting") as? AccountSettingView { // swiftlint:disable:this line_length
if let accountSettingView = UIStoryboard(name: "AccountSetting", bundle: nil).instantiateViewController(withIdentifier: "accountsetting") as? AccountSettingView {
self.currentViewController?.pushViewController(accountSettingView, animated: true)
}
case .autoLock:
Expand Down
2 changes: 1 addition & 1 deletion lockbox-ios/View/WelcomeView.swift
Expand Up @@ -77,7 +77,7 @@ extension WelcomeView: WelcomeViewProtocol {
public var firstTimeLearnMoreHidden: AnyObserver<Bool> {
return self.learnMore.rx.isHidden.asObserver()
}

public var firstTimeLearnMoreArrowHidden: AnyObserver<Bool> {
return self.learnMoreImage.rx.isHidden.asObserver()
}
Expand Down
2 changes: 1 addition & 1 deletion lockbox-iosTests/SettingListPresenterSpec.swift
Expand Up @@ -90,7 +90,7 @@ class SettingsPresenterSpec: QuickSpec {
beforeEach {
self.view = FakeSettingsView()
self.view.itemsObserver = self.scheduler.createObserver([SettingSectionModel].self)

self.routeActionHandler = FakeRouteActionHandler()
self.settingActionHandler = FakeSettingActionHandler()
self.dataStoreActionHandler = FakeDataStoreActionHandler()
Expand Down

0 comments on commit 2bfd303

Please sign in to comment.