Format Objective-C code with Uncrustify.
Clone or download this repository to a proper location, add the bin
directory to the PATH
for easy access:
export PATH="$PATH:/path/to/uncrustify-objc/bin"
uncrustify-objc dir [dir] [dir] ...
Examples:
$ cd ~/projects/awesome
$ uncrustify-objc .
$ uncrustify-objc /path/to/some/directory ~/iOSProject ~/CocoaProject
You may install XCFormat to format your code in Xcode. To let XCFormat use our Uncrustify config file:
- Replace the executable file
uncrustify
at/Applications/XCFormat.app/Contents/PlugIns/SourceExtension.appex/Contents/Resources
- Open XCFormat, click "Config" button under the "Uncrustify" tab, replace the config file
uncrustify.cfg
in the opened Finder
Update the config file:
cd uncrustify
./uncrustify --update-config-with-doc -o uncrustify.cfg -c uncrustify.cfg