Skip to content

Disallow line breaks in completely empty array and dict exprs. #186

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

Conversation

dylansturg
Copy link
Contributor

There's no reason to have a newline between the square brackets when there's nothing, other than a : for dict exprs, between the brackets.

Originally, I was making this change to mitigate a problem with indentation of this types of exprs in a function call. While this does fix the problem for arrays and dicts, it's not a suitable solution for closures. Regardless of future changes that would better mitigate the indentation problem, I think disallowing newlines in this contexts is an improvement.

There's no reason to have a newline between the square brackets when there's nothing, other than a `:` for dict exprs, between the brackets.
@allevato allevato merged commit d8a1666 into swiftlang:master Apr 10, 2020
@dylansturg dylansturg deleted the no_useless_newlines_in_empty_square_brackets branch April 15, 2020 20:33
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