uncrustify config for iOS developer
Uncrustify make code formatting beautiful. It needs configrations, I couldn't find a good configuration for iOS developer on Objective-C.
Here's a repo collecting pretty uncrustify config for iOS developer.
You can distribute your configurations over pull request.
- Tested with Xcode 4.6+ (also works in Xcode 5) on OS X 10.7 or higher.
- Uncrustify 0.60 higher (0.60 has a bug for Objective-C block, so install master HEAD or higher in the future)
- BBUncrustifyPlugin-Xcode
- using HomeBrew install Uncrustify
brew install uncrustify --HEAD
- install BBUncrustifyPlugin-Xcode
- clone this repo to
~/.uncrustify/
or other folder as BBUncrustifyPlugin-Xcode said.
git clone https://github.com/dijkst/uncrustify-config-ios.git ~/.uncrustify
Default settings disable the alignment of continued assignment or variable definition. If you need them, just set align_assign_span
, align_var_def_span
and align_oc_msg_spec_span
to 1
.
before:
NSString *const BBUncrustifyOptionEvictCommentInsertion = @"evictCommentInsertion";
NSString *const BBUncrustifyOptionSourceFilename = @"sourceFilename";
NSString *const BBUncrustifyOptionSupplementalConfigurationFolders = @"supplementalConfigurationFolders";
after:
NSString *const BBUncrustifyOptionEvictCommentInsertion = @"evictCommentInsertion";
NSString *const BBUncrustifyOptionSourceFilename = @"sourceFilename";
NSString *const BBUncrustifyOptionSupplementalConfigurationFolders = @"supplementalConfigurationFolders";
before:
-( void )viewWillEnter ;
after:
- (void)viewWillEnter;
- (void)a {
}
- (void)b{
}
after:
- (void)a {
}
- (void)b {
}
and so on.
uncrustify-config-ios is available under the MIT license.