nicklockwood / SwiftFormat

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

Reindent comments #1602

Open shindgewongxj opened 6 months ago

shindgewongxj commented 6 months ago

Comments added by hotkey ⌘ + / start at the head of the line by default, with SwiftFormat, it can be swifter like:

if condition {
//                  Do on condition
    ...
}

SwiftFormat

if condition {
    // Do on condition
    ...
}
nicklockwood commented 6 months ago

The reason I don't do this currently is that people often comment out code temporarily, and having SwiftFormat mangle the indenting in that case is annoying.