Enable SwiftLint rule 'static_operator' and fix all violations
This commit is contained in:
parent
831ffe2235
commit
b7e08dfb9e
3 changed files with 15 additions and 9 deletions
|
|
@ -170,7 +170,7 @@ only_rules:
|
||||||
- sorted_first_last
|
- sorted_first_last
|
||||||
# - sorted_imports # Managed by SwiftFormat.
|
# - sorted_imports # Managed by SwiftFormat.
|
||||||
- statement_position
|
- statement_position
|
||||||
# - static_operator
|
- static_operator
|
||||||
- strict_fileprivate
|
- strict_fileprivate
|
||||||
- strong_iboutlet
|
- strong_iboutlet
|
||||||
- superfluous_disable_command
|
- superfluous_disable_command
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,9 @@ extension AdditionField {
|
||||||
}
|
}
|
||||||
|
|
||||||
infix operator =>: MultiplicationPrecedence
|
infix operator =>: MultiplicationPrecedence
|
||||||
public func => (key: String, value: String) -> AdditionField {
|
|
||||||
|
public extension String {
|
||||||
|
static func => (key: String, value: String) -> AdditionField {
|
||||||
AdditionField(title: key, content: value)
|
AdditionField(title: key, content: value)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,11 +50,14 @@ func assertDefaults(
|
||||||
}
|
}
|
||||||
|
|
||||||
infix operator ∈: AdditionPrecedence
|
infix operator ∈: AdditionPrecedence
|
||||||
func ∈ (field: AdditionField, password: Password) -> Bool { // swiftlint:disable:this identifier_name
|
|
||||||
password.getFilteredAdditions().contains(field)
|
|
||||||
}
|
|
||||||
|
|
||||||
infix operator ∉: AdditionPrecedence
|
infix operator ∉: AdditionPrecedence
|
||||||
func ∉ (field: AdditionField, password: Password) -> Bool { // swiftlint:disable:this identifier_name
|
|
||||||
|
extension AdditionField {
|
||||||
|
static func ∈ (field: AdditionField, password: Password) -> Bool { // swiftlint:disable:this identifier_name
|
||||||
|
password.getFilteredAdditions().contains(field)
|
||||||
|
}
|
||||||
|
|
||||||
|
static func ∉ (field: AdditionField, password: Password) -> Bool { // swiftlint:disable:this identifier_name
|
||||||
!(field ∈ password)
|
!(field ∈ password)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue