My test example:
func myFunc() -> [UIColor] {
return [ .red ]
}
The command I ran:
$ swiftformat test.swift --rules spaceAroundOperators
I expected the code to remain unchanged. However, it updates to the following:
func myFunc() -> [UIColor] {
return [.red ]
}
It appears to be treating the [ as an operand.
@meherkasam thanks for reporting, I think the bug is actually that it always tries to remove the space between an opening bracket and a prefix ., but either way it needs fixing.
Thank you for the quick response!
@meherkasam fixed in 0.46.2.