Skip to content

[SR-15529] swift-format increases indent of multi-line string literals when using tabs for indentation #302

Open
@saagarjha

Description

@saagarjha
Previous ID SR-15529
Radar None
Original Reporter @saagarjha
Type Bug
Environment

.swift-format:

{
    "indentation": {
        "tabs": 1
    },
}

$ swift-format -v
0.50500.0
Additional Detail from JIRA
Votes 0
Component/s swift-format
Labels Bug
Assignee None
Priority Medium

md5: 59a5b2a30254b00568ce72e4b59f40db

Issue Description:

On this code (Note, the indentation is a literal tab)

let string = """
    Hello, this is a test string. \
    Here's another line.
    """

I'd expect this to be idempotent, but swift-format increases the indentation each time it runs:

let string = """
        Hello, this is a test string. \
        Here's another line.
        """

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions