Open ashvardanian opened 2 months ago
Nice! I've been waiting.
Thank you, this was surely needed! I'll review in depth soon. Would you say that the rules you chose are more or less standard across Swift codebases, or are there other alternatives? (I personally don't like to break up all function parameters in multiple lines, but willing to sacrifice for consistency).
Not sure the standard exists in Swift. I'm now enabling these rules in the libraries I maintain - UForm, USearch, StringZilla. Maybe with enough popular libraries agreeing on the format, we can propose that missing standard 🤷♂️
When working with the repository, I am not always sure about how to style code, as Swift gives a lot of flexibility on where to put
public
clauses, how to indent the code and so on. Moreover, Xcode isn't friendly to "Format on Save". Luckily, there is aswift-format
utility from Apple, that works very similar toclang-format
.We extensively use such systems in our codebases. They help keep the code sane when the number of contributors rises. If interested, you may want to add it to your Git hooks.