Skip to content

Autocorrect bug with Explicit Init rule #5289

Description

@BB9z

New Issue Checklist

Steps to reproduce

$ swiftlint --version
0.53.0

$ echo "f { e in\n    A.init(e: e)\n}" >> z1.swift

$ cat z1.swift
f { e in
    A.init(e: e)
}

$ swiftlint z1.swift --autocorrect --enable-all-rules
Correcting Swift files at paths z1.swift
Correcting 'z1.swift' (1/1)
/Users/.../Documents/z1.swift:2:6 Corrected Explicit Init
Done correcting 1 file!

$ cat z1.swift
f { e inA(e: e)
}

The lint result should be

f { e in
    A(e: e)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUnexpected and reproducible misbehavior.good first issueIssue to be taken up by new contributors yet unfamiliar with the project.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions