SwiftLint
SwiftLint copied to clipboard
SwiftLint format with Swift 6.1 trailing commas feature changes closing parenthesis indentation
New Issue Checklist
- [x] I've Updated SwiftLint to the latest version.
- [x] I've searched for existing GitHub issues.
Bug Description
When using the new Swift 6.1 support for trailing commas, SwiftLint indents the closing parenthesis rather than keep it at the expected non-indented level.
// with trailing comma
let a = CGRect(
x: 0,
y: 0,
width: 100,
height: 100,
)
// without trailing comma
let a = CGRect(
x: 0,
y: 0,
width: 100,
height: 100
)
Environment
- SwiftLint version 0.59.0
- Xcode version (n/a)
Which command are you running and what is the configuration in use?
Which command are you running and what is the configuration in use?
using swiftlint --fix --format with an empty configuration file.
I can repro this
I'm interested in taking a look at this issue. Is anyone currently assigned to it or actively working on it? Thanks!
SwiftLint is entirely relying on SourceKit to format code. With the Swift 6.1.2 toolchain that comes bundled with Xcode 16.4 I see the behavior, too. This is an upstream issue we cannot fix in SwiftLint.