-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to disable trailing commas on multi-line collections #619
Conversation
Extends the configuration options to allow disabling the addtion of trailing commas on multi-line collections.
I gleaned the name |
Yeah, "line" is the wrong word here, because the logic isn't based on whether the collection wraps across multiple lines, it's about whether it has multiple elements—single element arrays/dictionaries never have a trailing comma inserted, even if they wrap (because of Swift parser subtleties around how collection types are parsed in expression contexts). I think there are other places in swift-format where we use "line" when we really mean "statement" or "element", but fixing those up require ensuring compatibility with older configs. How do you feel about |
It's a mouthful, but it certainly self-documents what the setting is for. I'll refactor it. |
…literal rather than initializer
Refactored the setting name to |
Added a DocC header to auto-gen proper documentation based on the styling of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. Thanks for your contribution!
Add option to disable trailing commas on multi-line collections
Extends the configuration options to allow disabling the addtion of trailing commas on multi-line collections.