Reputation: 515
I want to know as if there exists configuration in Uncrustify, so that following formatting(or at least some part of it) can be achieved(language is objective-c).
Original code:
@interface BaseVideoViewController : BaseViewController <UICollectionViewDelegate, UICollectionViewDataSource, CircleTransitionFromController, PassiveUserGifCellDelegate, PassiveUserCollectionViewDelegate>
@property (strong, nonatomic) NSMutableArray <TokBoxParticipants *> *currentPassivePlayersArray;
@interface BaseVideoViewController () {
NSMutableArray <NSString *> *passiveUserForCellList;
}
[UIView animateWithDuration:1.0 parama1:2.0 animations:^{
// oc_block should come down if in same line by formatter
}
completion:^(BOOL finished) {
// something
}];
switch (something.state) {
case 0: {}
Break;
}
if (_voiceTextView == nil) {
Desired code after formatting:
@interface BaseVideoViewController: BaseViewController <UICollectionViewDelegate, UICollectionViewDataSource, CircleTransitionFromController, PassiveUserGifCellDelegate, PassiveUserCollectionViewDelegate>
@property (strong, nonatomic) NSMutableArray <TokBoxParticipants *> *currentPassivePlayersArray;
@interface BaseVideoViewController() {
NSMutableArray<NSString *> *passiveUserForCellList;
}
[UIView animateWithDuration:1.0 parama1:2.0
animations:^{
// oc_block should come down if in same line by formatter
}
completion:^(BOOL finished) {
// something
}];
switch (something.state) {
case 0: {
Break;
}
}
if (_voiceTextView == nil) {
Changes which need to be observed after formatting:
Upvotes: 0
Views: 170
Reputation: 181
Uncrustify-0.65-106-95188777
sp_before_class_colon = remove
sp_before_angle
and sp_inside_angle
mod_move_case_break = true
should do that, but it does not seem to work for OC. It also does not work with your example for C++ unless Break
is changed to break
and the closing brace is on its own line.Submit Feature and Pull requests to the Uncrustify git repo
Upvotes: 1