My first sweep at a clang-format configuration. There are a couple of issues:
- Braces for block function bodies are pushed to the next line
- Method calls are being pushed across multiple lines (although parameters are being aligned)
- Literal arrays and dictionaries are being spread out a bit too much for my liking
Regardless, the output is still very readable and consistent. My guess is that this will be integrated into the next major release of Xcode (pleasepleaseplease), so I'm just going to suck it up, have a spoonful of concrete and adapt to the whatever the output is.
Currently best used with ClangFormat-Xcode. Place the contents in a file named .clang-format
at the root of your project, and select the "Edit > Clang Format > File" menu item in Xcode. Assign a keyboard shortcut for bonus points — I use `^```
Is still a deal breaker for me, I wish I'd noticed you'd gotten this done before I made one, and came on the same limitation