Open bobby-fi opened 3 months ago
Unfortunately this isn't really feasible due to the need to change all the call sites. SwiftFormat only operates on a per-file basis, so it wouldn't know if a call to foo() in another file referred to the same function and needs to have the parens removed.
Also, even if it were possible, I'm not sure it's a good idea. If foo() is just retrieving a value then it should be a property, but what about something like this method:
func popLast() -> Element? { … }
Here it's actually mutating the collection and returning the result. It wouldn't make sense to change that to a property.
I suppose SwiftFormat could try to detect if the method name is a verb or noun and infer from that. Might work better as a SwiftLint rule in that case though.
have generally always preferred computed variables over functions with 0 arguments, would be awesome to be able to enforce that:
don't prefer:
prefer: