nicklockwood / SwiftFormat

A command-line tool and Xcode Extension for formatting Swift code
MIT License
7.9k stars 640 forks source link

TODOs in docstrings should be preserved #959

Closed keith closed 3 years ago

keith commented 3 years ago

With this code:

    /// blah
    /// blah
    /// TODO: re-write as a flow: PPG-5401
    ///
    /// blah

SwiftFormat replaces the TODO line to only have 2 slashes

nicklockwood commented 3 years ago

@keith that's deliberate. Xcode doesn't correctly parse TODO: comments with three slashes

keith commented 3 years ago

Interesting, it is a weird trade-off since it being reformatted like that breaks the docstring

nicklockwood commented 3 years ago

Yes, maybe it should have a heuristic to avoid applying the change in the middle of a docstring block like that.

nicklockwood commented 3 years ago

@keith fixed in 0.48.6