objective-c - ReactiveCocoa 的 ClangFormat 样式

标签 objective-c clang static-analysis reactive-cocoa clang-format

我正在使用 ClangFormat .

我希望以此更新我的 ReactiveCocoa 代码的样式

   [[self.myService indexCase] subscribeNext:^(id response) {
        DDLogDebug(@"response : %@", response);
    }
        error:^(NSError *error) {
            [self.dataManager sendError:error];
        }];

对此

  [[self.myService indexCase]
     subscribeNext:^(id response) {
        DDLogDebug(@"response : %@", response);
     } error:^(NSError *error) {
            [self.dataManager sendError:error];
        }];

我应该查看哪些 ClangFormat 属性以实现此目的?


我当前的 .clang-format 文件:

BasedOnStyle: WebKit
AlignTrailingComments: true
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: true
BreakBeforeBraces: Linux
ColumnLimit: 120
IndentCaseLabels: true
IndentWidth: 4
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 2
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PointerBindsToType: false
SpacesBeforeTrailingComments: 1
TabWidth: 4
UseTab: Never

最佳答案

添加这个:

AllowAllParametersOfDeclarationOnNextLine True

BinPackParameters True

关于objective-c - ReactiveCocoa 的 ClangFormat 样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38245474/

相关文章:

ios - ios 中的日期时间差异(以分钟为单位)

c - Polyspace 警告不转发声明 main()

c++ - 学习 LLVM 后端编程的代码示例

c++ - 源码分析工具?

objective-c - Objective-C 枚举 : how to get rid of them? 的新 Swift 5 警告

ios - 如何将 swift 文件添加到 Objective c pod?

ios - 我想在 iOS 中单击按钮时更改我自己的应用程序语言

c++ - 执行步骤 “make”和-fno-stack-limit时,Qt Creator编译错误

c++ - 懒惰评估是否有效/可优化?

compiler-construction - 如何在 opt (LLVM) 中关闭矢量化