Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SwiftLint: Fix 'whitespace' rules #283

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add SwiftLint: Fix 'whitespace' issues
  • Loading branch information
oleggnidets-okta committed Apr 2, 2021
commit 09ff1d1a0ff8bec547ac2593b3f39269e472a2f3
18 changes: 17 additions & 1 deletion .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,16 @@ comma:
severity: error
colon:
severity: error
# Paths to ignore
# Whitespace
leading_whitespace:
severity: error
let_var_whitespace:
severity: error
operator_whitespace:
severity: error
operator_usage_whitespace:
severity: error
return_arrow_whitespace:
severity: error
excluded:
- Pods
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