-
Notifications
You must be signed in to change notification settings - Fork 104
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
Swift 3 function names #80
Conversation
let recheckItem1 = try keychain.persistentTokenWithIdentifier(savedItem1.identifier) | ||
let recheckItem2 = try keychain.persistentTokenWithIdentifier(savedItem2.identifier) | ||
let recheckItem1 = try keychain.persistentToken(withIdentifier: savedItem1.identifier) | ||
let recheckItem2 = try keychain.persistentToken(withIdentifier: savedItem2.identifier) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line Length Violation: Line should be 100 characters or less: currently 102 characters (line_length)
} catch { | ||
XCTFail("deletePersistentToken(_:) failed with error: \(error)") | ||
} | ||
|
||
do { | ||
let recheckItem1 = try keychain.persistentTokenWithIdentifier(savedItem1.identifier) | ||
let recheckItem2 = try keychain.persistentTokenWithIdentifier(savedItem2.identifier) | ||
let recheckItem1 = try keychain.persistentToken(withIdentifier: savedItem1.identifier) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line Length Violation: Line should be 100 characters or less: currently 102 characters (line_length)
let fetchedItem1 = try keychain.persistentTokenWithIdentifier(savedItem1.identifier) | ||
let fetchedItem2 = try keychain.persistentTokenWithIdentifier(savedItem2.identifier) | ||
let fetchedItem1 = try keychain.persistentToken(withIdentifier: savedItem1.identifier) | ||
let fetchedItem2 = try keychain.persistentToken(withIdentifier: savedItem2.identifier) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line Length Violation: Line should be 100 characters or less: currently 102 characters (line_length)
XCTAssertEqual(savedItem1.token, token1) | ||
XCTAssertEqual(savedItem2.token, token2) | ||
|
||
// Fetch both tokens from the keychain | ||
do { | ||
let fetchedItem1 = try keychain.persistentTokenWithIdentifier(savedItem1.identifier) | ||
let fetchedItem2 = try keychain.persistentTokenWithIdentifier(savedItem2.identifier) | ||
let fetchedItem1 = try keychain.persistentToken(withIdentifier: savedItem1.identifier) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line Length Violation: Line should be 100 characters or less: currently 102 characters (line_length)
} catch { | ||
XCTFail("deletePersistentToken(_:) failed with error: \(error)") | ||
} | ||
|
||
// Attempt to restore the deleted token | ||
do { | ||
let fetchedToken = try keychain.persistentTokenWithIdentifier(savedToken.identifier) | ||
let fetchedToken = try keychain.persistentToken(withIdentifier: savedToken.identifier) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line Length Violation: Line should be 100 characters or less: currently 102 characters (line_length)
@@ -82,7 +81,7 @@ class KeychainTests: XCTestCase { | |||
|
|||
// Fetch the token again | |||
do { | |||
let fetchedToken = try keychain.persistentTokenWithIdentifier(savedToken.identifier) | |||
let fetchedToken = try keychain.persistentToken(withIdentifier: savedToken.identifier) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line Length Violation: Line should be 100 characters or less: currently 102 characters (line_length)
|
||
// Restore the token | ||
do { | ||
let fetchedToken = try keychain.persistentTokenWithIdentifier(savedToken.identifier) | ||
let fetchedToken = try keychain.persistentToken(withIdentifier: savedToken.identifier) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line Length Violation: Line should be 100 characters or less: currently 102 characters (line_length)
public func updatePersistentToken(_ persistentToken: PersistentToken, | ||
withToken token: Token) throws -> PersistentToken | ||
{ | ||
public func update(_ persistentToken: PersistentToken, with token: Token) throws -> PersistentToken { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line Length Violation: Line should be 100 characters or less: currently 105 characters (line_length)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Barely over the limit, and definitely more readable on one line.
@@ -245,7 +245,7 @@ private extension Generator { | |||
|
|||
private extension String { | |||
/// Prepends the given character to the beginning of `self` until it matches the given length. | |||
func paddedWithCharacter(_ character: Character, toLength length: Int) -> String { | |||
func padded(with character: Character, toLength length: Int) -> String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Valid Docs Violation: Documented declarations should be valid. (valid_docs)
Current coverage is 94.27% (diff: 100%)@@ swift-3 #80 diff @@
==========================================
Files 6 6
Lines 367 367
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
Hits 346 346
Misses 21 21
Partials 0 0
|
@@ -117,7 +117,7 @@ private func urlForToken(name: String, issuer: String, factor: Generator.Factor, | |||
return url | |||
} | |||
|
|||
private func tokenFromURL(_ url: URL, secret externalSecret: Data? = nil) -> Token? { | |||
private func token(from url: URL, secret externalSecret: Data? = nil) -> Token? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function Body Length Violation: Function body should span 40 lines or less excluding comments and whitespace: currently spans 46 lines (function_body_length)
Cyclomatic Complexity Violation: Function should have complexity 10 or less: currently complexity equals 13 (cyclomatic_complexity)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignoring these warnings, as the represent issues that already exist and aren't being exacerbated by this PR.
Update several function names to conform to the Swift 3 naming guidelines.