jordanbaird / Ice

Powerful menu bar manager for macOS
https://icemenubar.app
GNU General Public License v3.0
10.27k stars 194 forks source link

style: swift format files #48

Closed ScriptBloom closed 2 months ago

ScriptBloom commented 2 months ago

I have notice some swift files are not formated, so I create a PR to format these files with swiftformat commandline tool.

e.g. adjusting white space it can insert or remove implicit self.

It's useful to keep consistent style.

Thanks for reviewing.

jordanbaird commented 2 months ago

Hey! Thank you for wanting to contribute.

I feel like the repository has consistent styling within itself. For example, I prefer to keep the implicit self in initializers as it makes it more clear that a property is being set, and not a local variable. Another example is that I prefer to keep argument labels in overrides or conformances that involve system APIs (i.e. applicationDidFinishLaunching or init(coder:)). As for whitespace, I generally go with how Xcode chooses to format it, and I'd prefer not to deviate from that.

Ice does have a SwiftLint configuration, and nothing in the repository is currently violating it. I think it's best for every project to maintain its own set of style guidelines, as long as they aren't too far out of the norm. I believe Ice does that, so I'm going to close this PR, but thank you regardless!