mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-10 21:39:12 +00:00
Add SwiftFormat wraparguments (#579)
Matches the wrapparameters rule, seems it was missed.
This commit is contained in:
parent
96363b117d
commit
afc660a1ea
@ -1,6 +1,6 @@
|
|||||||
--swiftversion 5.6
|
--swiftversion 5.6
|
||||||
|
|
||||||
--exclude ElementX/Sources/Generated,vendor
|
--exclude ElementX/Sources/Generated,vendor,**/Package.swift
|
||||||
|
|
||||||
--disable wrapMultiLineStatementBraces
|
--disable wrapMultiLineStatementBraces
|
||||||
--disable hoistPatternLet
|
--disable hoistPatternLet
|
||||||
@ -10,6 +10,7 @@
|
|||||||
--nospaceoperators ...,..<
|
--nospaceoperators ...,..<
|
||||||
--stripunusedargs closure-only
|
--stripunusedargs closure-only
|
||||||
--trimwhitespace nonblank-lines
|
--trimwhitespace nonblank-lines
|
||||||
|
--wraparguments after-first
|
||||||
--wrapparameters after-first
|
--wrapparameters after-first
|
||||||
--redundanttype inferred
|
--redundanttype inferred
|
||||||
--emptybraces spaced
|
--emptybraces spaced
|
@ -80,11 +80,9 @@ private func decodeAC(_ value: Int, maximumValue: Float) -> (Float, Float, Float
|
|||||||
let quantG = (value / 19) % 19
|
let quantG = (value / 19) % 19
|
||||||
let quantB = value % 19
|
let quantB = value % 19
|
||||||
|
|
||||||
let rgb = (
|
let rgb = (signPow((Float(quantR) - 9) / 9, 2) * maximumValue,
|
||||||
signPow((Float(quantR) - 9) / 9, 2) * maximumValue,
|
signPow((Float(quantG) - 9) / 9, 2) * maximumValue,
|
||||||
signPow((Float(quantG) - 9) / 9, 2) * maximumValue,
|
signPow((Float(quantB) - 9) / 9, 2) * maximumValue)
|
||||||
signPow((Float(quantB) - 9) / 9, 2) * maximumValue
|
|
||||||
)
|
|
||||||
|
|
||||||
return rgb
|
return rgb
|
||||||
}
|
}
|
||||||
|
@ -31,39 +31,31 @@ final class UserAgentBuilder {
|
|||||||
let clientVersion = InfoPlistReader.main.bundleShortVersionString
|
let clientVersion = InfoPlistReader.main.bundleShortVersionString
|
||||||
|
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
return String(
|
return String(format: "%@/%@ (%@; iOS %@; Scale/%0.2f)",
|
||||||
format: "%@/%@ (%@; iOS %@; Scale/%0.2f)",
|
clientName,
|
||||||
clientName,
|
clientVersion,
|
||||||
clientVersion,
|
Device.current.safeDescription,
|
||||||
Device.current.safeDescription,
|
UIDevice.current.systemVersion,
|
||||||
UIDevice.current.systemVersion,
|
UIScreen.main.scale)
|
||||||
UIScreen.main.scale
|
|
||||||
)
|
|
||||||
#elseif os(tvOS)
|
#elseif os(tvOS)
|
||||||
return String(
|
return String(format: "%@/%@ (%@; tvOS %@; Scale/%0.2f)",
|
||||||
format: "%@/%@ (%@; tvOS %@; Scale/%0.2f)",
|
clientName,
|
||||||
clientName,
|
clientVersion,
|
||||||
clientVersion,
|
Device.current.safeDescription,
|
||||||
Device.current.safeDescription,
|
UIDevice.current.systemVersion,
|
||||||
UIDevice.current.systemVersion,
|
UIScreen.main.scale)
|
||||||
UIScreen.main.scale
|
|
||||||
)
|
|
||||||
#elseif os(watchOS)
|
#elseif os(watchOS)
|
||||||
return String(
|
return String(format: "%@/%@ (%@; watchOS %@; Scale/%0.2f)",
|
||||||
format: "%@/%@ (%@; watchOS %@; Scale/%0.2f)",
|
clientName,
|
||||||
clientName,
|
clientVersion,
|
||||||
clientVersion,
|
Device.current.safeDescription,
|
||||||
Device.current.safeDescription,
|
WKInterfaceDevice.current.systemVersion,
|
||||||
WKInterfaceDevice.current.systemVersion,
|
WKInterfaceDevice.currentDevice.screenScale)
|
||||||
WKInterfaceDevice.currentDevice.screenScale
|
|
||||||
)
|
|
||||||
#elseif os(OSX)
|
#elseif os(OSX)
|
||||||
return String(
|
return String(format: "%@/%@ (Mac; Mac OS X %@)",
|
||||||
format: "%@/%@ (Mac; Mac OS X %@)",
|
clientName,
|
||||||
clientName,
|
clientVersion,
|
||||||
clientVersion,
|
NSProcessInfo.processInfo.operatingSystemVersionString)
|
||||||
NSProcessInfo.processInfo.operatingSystemVersionString
|
|
||||||
)
|
|
||||||
#else
|
#else
|
||||||
return nil
|
return nil
|
||||||
#endif
|
#endif
|
||||||
|
@ -64,15 +64,13 @@ class OIDCService {
|
|||||||
"policy_uri": "https://element.io/privacy"
|
"policy_uri": "https://element.io/privacy"
|
||||||
]
|
]
|
||||||
|
|
||||||
let nonTemplatizedRequest = OIDRegistrationRequest(
|
let nonTemplatizedRequest = OIDRegistrationRequest(configuration: metadata,
|
||||||
configuration: metadata,
|
redirectURIs: [redirectURI],
|
||||||
redirectURIs: [redirectURI],
|
responseTypes: nil,
|
||||||
responseTypes: nil,
|
grantTypes: [OIDGrantTypeAuthorizationCode, OIDGrantTypeRefreshToken],
|
||||||
grantTypes: [OIDGrantTypeAuthorizationCode, OIDGrantTypeRefreshToken],
|
subjectType: nil,
|
||||||
subjectType: nil,
|
tokenEndpointAuthMethod: "none",
|
||||||
tokenEndpointAuthMethod: "none",
|
additionalParameters: extraParams)
|
||||||
additionalParameters: extraParams
|
|
||||||
)
|
|
||||||
|
|
||||||
let registrationResponse = try await OIDAuthorizationService.perform(nonTemplatizedRequest)
|
let registrationResponse = try await OIDAuthorizationService.perform(nonTemplatizedRequest)
|
||||||
|
|
||||||
|
@ -22,11 +22,9 @@ extension UNNotification {
|
|||||||
static func with(userInfo: [AnyHashable: Any], actionIdentifier: String = UNNotificationDefaultActionIdentifier) throws -> UNNotification {
|
static func with(userInfo: [AnyHashable: Any], actionIdentifier: String = UNNotificationDefaultActionIdentifier) throws -> UNNotification {
|
||||||
let content = UNMutableNotificationContent()
|
let content = UNMutableNotificationContent()
|
||||||
content.userInfo = userInfo
|
content.userInfo = userInfo
|
||||||
let request = UNNotificationRequest(
|
let request = UNNotificationRequest(identifier: "",
|
||||||
identifier: "",
|
content: content,
|
||||||
content: content,
|
trigger: nil)
|
||||||
trigger: nil
|
|
||||||
)
|
|
||||||
let archiver = MockCoder(requiringSecureCoding: false)
|
let archiver = MockCoder(requiringSecureCoding: false)
|
||||||
let notification = try XCTUnwrap(UNNotification(coder: archiver))
|
let notification = try XCTUnwrap(UNNotification(coder: archiver))
|
||||||
notification.setValue(request, forKey: "request")
|
notification.setValue(request, forKey: "request")
|
||||||
|
@ -21,11 +21,9 @@ extension UNTextInputNotificationResponse {
|
|||||||
static func with(userInfo: [AnyHashable: Any], actionIdentifier: String = UNNotificationDefaultActionIdentifier) throws -> UNNotificationResponse {
|
static func with(userInfo: [AnyHashable: Any], actionIdentifier: String = UNNotificationDefaultActionIdentifier) throws -> UNNotificationResponse {
|
||||||
let content = UNMutableNotificationContent()
|
let content = UNMutableNotificationContent()
|
||||||
content.userInfo = userInfo
|
content.userInfo = userInfo
|
||||||
let request = UNNotificationRequest(
|
let request = UNNotificationRequest(identifier: "",
|
||||||
identifier: "",
|
content: content,
|
||||||
content: content,
|
trigger: nil)
|
||||||
trigger: nil
|
|
||||||
)
|
|
||||||
let archiver = MockCoder(requiringSecureCoding: false)
|
let archiver = MockCoder(requiringSecureCoding: false)
|
||||||
let notification = try XCTUnwrap(UNNotification(coder: archiver))
|
let notification = try XCTUnwrap(UNNotification(coder: archiver))
|
||||||
notification.setValue(request, forKey: "request")
|
notification.setValue(request, forKey: "request")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user