Add option to add a newline between 2 adjacent attributes#784
Merged
allevato merged 2 commits intoswiftlang:mainfrom Aug 1, 2024
Merged
Add option to add a newline between 2 adjacent attributes#784allevato merged 2 commits intoswiftlang:mainfrom
allevato merged 2 commits intoswiftlang:mainfrom
Conversation
c1d831d to
d05ea4d
Compare
33ebf17 to
b855621
Compare
Member
|
I think we would only want this behavior for declaration attributes, because it would be heavy-handed on type attributes. For example, how does your current implementation handle this case? func f(body: @MainActor @Sendable () -> Void) {}We should definitely keep those horizontally flowing, IMO. Can you add some tests for that case, and also some tests that use attributes in conditional |
Contributor
Author
|
makes sense. I'll give it a go! |
b855621 to
1427a1e
Compare
Contributor
Author
|
@allevato I took your suggestion and expanded the unit test to cover a lot more node types. |
allevato
reviewed
Jul 31, 2024
allevato
reviewed
Jul 31, 2024
Add an option that inserts hard line breaks between adjacent attributes. Closes swiftlang#773
1427a1e to
3b05120
Compare
Contributor
Author
|
@allevato thanks for the feedbacks! I've addressed them. |
Member
|
Thanks! |
thunderseethe
pushed a commit
to thunderseethe/swift-format
that referenced
this pull request
Aug 13, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add an option that inserts hard line breaks between adjacent attributes.
Closes #773