Skip to content

Disallow discretionary newlines before trailing closures. #187

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

Merged
merged 1 commit into from
Apr 13, 2020

Conversation

dylansturg
Copy link
Contributor

The behavior was inconsistent between subscripts and function calls. They both use a same-break that ignores discretionary newlines now.

The break ignores discretionary because breaking before a trailing closure's left brace uses excessive vertical whitespace without improving readability. Now the brace is usually glued to the right paren/right square bracket, except when it doesn't fit due to line length.

The behavior was inconsistent between subscripts and function calls. They both use a same-break that ignores discretionary newlines now.

The break ignores discretionary because breaking before a trailing closure's left brace uses excessive vertical whitespace without improving readability. Now the brace is usually glued to the right paren/right square bracket, except when it doesn't fit due to line length.
@allevato allevato merged commit 9d552fb into swiftlang:master Apr 13, 2020
@dylansturg dylansturg deleted the no_trailing_closure_newline branch April 13, 2020 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants