Skip to content

Commit

Permalink
Add SwiftLint: Fix 'whitespace' rules (#283)
Browse files Browse the repository at this point in the history
Fix 'whitespace' issues
  • Loading branch information
oleggnidets-okta authored Apr 5, 2021
1 parent f3b43e1 commit e4b4234
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 6 deletions.
18 changes: 18 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ only_rules:
- closure_spacing
- comma
- colon
# Whitespace (Xcode configuration)
- leading_whitespace
- let_var_whitespace
- operator_whitespace
- operator_usage_whitespace
- return_arrow_whitespace

# Spacing
opening_brace:
Expand All @@ -17,6 +23,18 @@ comma:
severity: error
colon:
severity: error
# Whitespace
leading_whitespace:
severity: error
let_var_whitespace:
severity: error
operator_whitespace:
severity: error
operator_usage_whitespace:
severity: error
return_arrow_whitespace:
severity: error

# Paths to ignore
excluded:
- Pods
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ osx_image: xcode12.2
before_install:
- gem install xcpretty
- gem install cocoapods
- brew outdated carthage || brew upgrade carthage
jobs:
include:
- stage: Linting
Expand Down
1 change: 1 addition & 0 deletions Sources/OktaOidc/Common/OktaSignOutOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import Foundation
public struct OktaSignOutOptions: OptionSet {

public let rawValue: Int

public init(rawValue: Int) {
self.rawValue = rawValue
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ import UIKit
func signOutOfOkta(_ authStateManager: OktaOidcStateManager,
from presenter: UIViewController,
callback: @escaping ((Error?) -> Void))
func cancelBrowserSession(completion: (()-> Void)?)
func cancelBrowserSession(completion: (() -> Void)?)
}
#endif
2 changes: 1 addition & 1 deletion Sources/OktaOidc/iOS/OktaOidc+BrowserIOS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ extension OktaOidc: OktaOidcBrowserProtocolIOS {
completionHandler: completionHandler)
}

@objc public func cancelBrowserSession(completion: (()-> Void)? = nil) {
@objc public func cancelBrowserSession(completion: (() -> Void)? = nil) {
guard let userAgentSession = currentUserSessionTask?.userAgentSession else {
completion?()
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import AppKit
func signOutOfOkta(authStateManager: OktaOidcStateManager,
redirectServerConfiguration: OktaRedirectServerConfiguration?,
callback: @escaping ((Error?) -> Void))
func cancelBrowserSession(completion: (()-> Void)?)
func cancelBrowserSession(completion: (() -> Void)?)
}

public extension OktaOidcBrowserProtocolMAC {
Expand All @@ -37,7 +37,7 @@ public extension OktaOidcBrowserProtocolMAC {
redirectServerConfiguration: redirectServerConfiguration,
callback: callback)
}
func cancelBrowserSession(completion: (()-> Void)? = nil) {
func cancelBrowserSession(completion: (() -> Void)? = nil) {
cancelBrowserSession(completion: completion)
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/OktaOidc/macOS/OktaOidc+BrowserMAC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ extension OktaOidc: OktaOidcBrowserProtocolMAC {
completionHandler: completionHandler)
}

@objc public func cancelBrowserSession(completion: (()-> Void)? = nil) {
@objc public func cancelBrowserSession(completion: (() -> Void)? = nil) {
guard let userAgentSession = currentUserSessionTask?.userAgentSession else {
completion?()
return
Expand Down
1 change: 1 addition & 0 deletions Tests/Common/OKTExternalUserAgentMacMock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Foundation

class OKTExternalUserAgentMacMock: OKTExternalUserAgentMac {
let responseURL: URL

init(with responseURL: URL) {
self.responseURL = responseURL
}
Expand Down
1 change: 1 addition & 0 deletions Tests/OktaOidcTests/OktaOidcMacTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import XCTest

fileprivate class OktaOidcPartialMock: OktaOidc {
var error: Error?

override func signInWithBrowserTask(_ task: OktaOidcBrowserTask,
callback: @escaping ((OktaOidcStateManager?, Error?) -> Void)) {
DispatchQueue.main.async {
Expand Down

0 comments on commit e4b4234

Please sign in to comment.