realm / realm/SwiftLint

SwiftLint format with Swift 6.1 trailing commas feature changes closing parenthesis indentation

Open
#6,053 5 comments 0 reactions 0 assignees View on GitHub

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
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.