I have used Uncrustify for formatting code.
But Uncrustify doesn't support for the new Objective-C syntax of LLVM 4.0.
What am I going to do?
The Code formated by Uncrustify:
@interface SJTLLVM4Tester()
@property (strong) NSNumber *number;
@end
@implementation SJTLLVM4Tester
-(id)init {
self = [super init];
if (self) {
self.number = @'C';
self.number = @123;
self.number = @0x123ul;
self.number = @-1.2e-3f;
self.number = @YES;
NSDictionary *dictionary = @{@"key1":@1,@"key2":@2,@"key3":@3};
NSMutableArray *array = [[NSMutableArray alloc] initWithArray:@[@1,@2,@3]];
self.number = dictionary[@"key1"];
array[0] = self.number;
}
return self;
}
@end
The execution result:
This has been fixed in the latest uncrustify release : 0.60.
You can grab it here : https://github.com/bengardner/uncrustify/archive/uncrustify-0.60.tar.gz
I'm using Brew and had to manually update the URL & SHA1 with
brew edit uncrustify
and thenbrew upgrade uncrustify
.Below is my new formula :
Works like a charm now.