objective-c - Uncrustify:删除 ObjC 代码中的双及更多空行

标签 objective-c uncrustify

所以基本上我有这样的代码:

NSString *const SomeKey = @"SomeKey";


@implementation SomeClass


- (void)doSomeWork {
    [self startDoingSomeWork];



    [self stopDoingSomeWork];
    [self notifySomeWorkDone];
}

我需要将此代码自动格式化为以下形式:

NSString *const SomeKey = @"SomeKey";

@implementation SomeClass

- (void)doSomeWork {
    [self startDoingSomeWork];

    [self stopDoingSomeWork];
    [self notifySomeWorkDone];
}

所以基本上我需要用单个空行替换所有双、三重等空行。

是否有任何 Uncrustify 选项可以启用它?
如果否,那么您知道这种情况的任何解决方法吗?

最佳答案

最后我找到了正确的选项。
只需将此行添加到您的配置文件中即可:

nl_max = 2

关于objective-c - Uncrustify:删除 ObjC 代码中的双及更多空行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34324716/

相关文章:

iphone - PrepareForSegue 方法将文本从两个不同的 TextView 传递到下一个 View 中的 TextView

ios - Xcode 与 uncrustify : how to align function declaration to colons?

code-formatting - uncrustify:如何设置最大线长度

uncrustify - 如何使 Uncrustify 在函数之间强制空白行?

ctags 多行 C 函数原型(prototype)

ios - 获取我附近的清真餐厅的列表FourSquare API

iPhone 录音

ios - 如何为 Swift iOS 编程配置 Uncrustify for Allman 风格?

ios - 如何在 Objective-c 中使用元编程

objective-c - 实现协议(protocol)的问题