Skip to content

Default to not requiring whitespace before ( #2592

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

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Apr 4, 2024

There are only a few cases where ( should be preceded by a space: closure parameters, function types and tuples.

Instead of defaulting to add whitespace before ( check for those cases and if we are not in one of them, don’t require whitespace.

rdar://124569733

Copy link
Contributor

@bnbarham bnbarham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your commit + PR title are the reverse of what the code is actually doing, but LGTM otherwise.

@ahoppen ahoppen force-pushed the ahoppen/no-space-before-attribute-paren branch from 6f48586 to 7c9cea4 Compare April 5, 2024 13:21
@ahoppen
Copy link
Member Author

ahoppen commented Apr 5, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Apr 5, 2024

swiftlang/swift#72876

@swift-ci Please test

There are only a few cases where `(` should be preceded by a space: closure parameters, function types and tuples.

Instead of defaulting to add whitespace before `(`, check for those cases and if we are not in one of them, don’t require whitespace.

rdar://124569733
@ahoppen ahoppen force-pushed the ahoppen/no-space-before-attribute-paren branch from 7c9cea4 to 38bacb3 Compare April 5, 2024 22:52
@ahoppen
Copy link
Member Author

ahoppen commented Apr 5, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Apr 8, 2024

swiftlang/swift#72876

@swift-ci Please test macOS

@ahoppen
Copy link
Member Author

ahoppen commented Apr 8, 2024

swiftlang/swift#72876

@swift-ci Please test Windows

@ahoppen ahoppen changed the title Default to requiring whitespace before ( Default to not requiring whitespace before ( Apr 8, 2024
@ahoppen ahoppen merged commit 30f08dc into swiftlang:main Apr 10, 2024
ahoppen added a commit to ahoppen/swift that referenced this pull request Apr 10, 2024
@ahoppen ahoppen deleted the ahoppen/no-space-before-attribute-paren branch October 21, 2024 20:20
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