mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
Fix line_length violation a different way
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user