Don't insert trailing commas into attribute argument lists#1215
Merged
allevato merged 1 commit intoJun 8, 2026
Conversation
allevato
approved these changes
Jun 8, 2026
allevato
left a comment
Member
There was a problem hiding this comment.
Thanks! This seems like a straightforward solution for now vs. trying to hard-code which attributes support this and which don't.
There may be some divergence between what we do here and what tools like SwiftLint might do, to which my answer is still "you shouldn't use multiple linters to check the same rule".
Jason-Abbott
added a commit
to toba/swiftiomatic
that referenced
this pull request
Jun 8, 2026
… don't insert trailing commas into attribute argument lists under multilineTrailingCommaBehavior: alwaysUsed (mirror swiftlang/swift-format#1215); recognize Swift 6.2 'isolated' declaration modifier in SortModifiers' canonical isolation slot alongside 'nonisolated' (mirror realm/SwiftLint#6759); compute NestedCallLayout.columnOffset in grapheme clusters uniformly instead of mixing String.count on tokens with UTF-8 byte length on trivia, fixing column over-count when preceding tokens or trivia contain multi-byte characters (mirror realm/SwiftLint#6747)
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.
fixes #1178.
alwaysUsed inserted a trailing comma into multiline @attached(...) arguments, which the parser rejects (see swiftlang/swift-syntax#3306). macro role and custom attributes are syntactically indistinguishable, so never insert into any attribute's argument list. an existing comma is still managed as configured.