-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Labels
helpQuestions or user problems that require more explanation rather than code changes.Questions or user problems that require more explanation rather than code changes.
Description
Hi! I want to create new custom_rules to validate that SwiftUI Text has .multilineTextAlignment. But I had a lot of problems
Right now my regex rule looks like this:
\\bText\\([^\\)]*\\)(?!\\s*\\.(multilineTextAlignment|modifier\\())
And everything works fine until it hits:
Text("\(address.postalCode), \(address.city)")
Text(value(from: anotherValue))
Text("\(intValue)")
Text(textValue) + Text(" ") + Text(anotherTextValue)
Text(
veryBigName
)
Do you have any ideas on how to avoid this problem?
Full custom_rule:
custom_rules:
multiline_text_alignment_rule:
name: "Multiline Text Alignment"
regex: "\\bText\\([^\\)]*\\)(?!\\s*\\.(multilineTextAlignment|modifier\\())"
message: "Text should have a .multilineTextAlignment() or .modifier()"
severity: error
Metadata
Metadata
Assignees
Labels
helpQuestions or user problems that require more explanation rather than code changes.Questions or user problems that require more explanation rather than code changes.