我想修改.swiftlint.yml
以添加一些自定义规则以在下一行强制大括号。这对我有用...
opening_braces:
name: "Opening Braces not on Next Line"
message: "Opening braces should be placed on the next line."
include: "*.swift"
regex: '\S[ \t]*\{'
severity: warning
但是,在某些情况下,我希望允许在同一行使用大括号,例如:
override var cornerRadius: CGFloat
{
get { return layer.cornerRadius }
set { layer.cornerRadius = newValue }
}
如何更改我的正则表达式以允许单行 getter/setter 使用同一行?