SwiftLint format with Swift 6.1 trailing commas feature changes closing parenthesis indentation
Open
Nobody has claimed this yet.
bug
sourcekit-issue
- Dominant language
- Swift
- Stars
- 19.7k
- Forks
- 2.3k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 11
Description
New Issue Checklist
- I've Updated SwiftLint to the latest version.
- 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)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the formatting shown in the issue with SwiftLint 0.59.0, comparing calls with and without a trailing comma. Trace the formatter behavior responsible for the closing-parenthesis indentation and add a regression check; done means the trailing-comma form keeps the closing parenthesis at the non-indented level.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100