Add an option for trimmingTrailingWhitespace to ignore whitespace only lines
I recently tried running SwiftLint with --fix --format and saw that it removed thousands of whitespace only lines. It'd be great if the options could mirror the options available in Xcode. Particularly an option to ignore whitespace only lines.
That's not implemented here, it's implemented in SourceKit and SwiftLint.
Isn't it implemented here?
https://github.com/jpsim/SourceKitten/blob/main/Source/SourceKittenFramework/File.swift#L119-L123
Huh, yes you're right. Sorry for closing then, I'm surprised I hooked it up this way.
Would really love the option to make SwiftLint --fix --format mimic the default behavior of Xcode format (⌃ + I)
Going to tackle this. Should the implementation add an additional function parameter:
public func format(trimmingTrailingWhitespace: Bool, ignoringEmptyLines: Bool, useTabs: Bool, indentWidth: Int)
or should it be the default behavior?
@jpsim can you let me know if there is any concerns with my implementation so I can fix them and get it merged in.