Fix line_length violation a different way

This commit is contained in:
Xaver Lohmüller
2019-01-16 14:16:56 -08:00
committed by JP Simard
parent 0badea7cd1
commit 7b00a110a0
@@ -46,8 +46,9 @@ public struct IdenticalOperandsRule: ConfigurationProviderRule, OptInRule, Autom
public func validate(file: File) -> [StyleViolation] {
let operators = type(of: self).operators.joined(separator: "|")
let pattern = "(?<!\\.|\\$)(?:\\s|\\b|\\A)([\\$A-Za-z0-9_\\.]+)\\s*" +
operators + "\\s*\\1\\b(?!\\s*(?:\\.|\\>|\\<))"
let pattern = """
(?<!\\.|\\$)(?:\\s|\\b|\\A)([\\$A-Za-z0-9_\\.]+)\\s*(\(operators))\\s*\\1\\b(?!\\s*(\\.|\\>|\\<))
"""
let syntaxKinds = SyntaxKind.commentKinds
let excludingPattern = "\\?\\?\\s*" + pattern