fables-tales / rubyfmt

Ruby Autoformatter!
MIT License
1.08k stars 50 forks source link

Don't strip parens when the receiver of a method call is a const #395

Closed reese closed 1 year ago

reese commented 1 year ago

Resolves #394

On the tin -- if a method is named as a const (e.g. def Bees), it must use parens when called. Without parens, it'll evaluate as a constant, so the parens are semantically important. This PR makes it such that if the receiver is a Const, we always leave the parens.