1

コードのフォーマットに clang-format を使用しています。以下のコードを見るとわかるように、ブロック コードを除いてすべて正常に動作します。失敗したブロックにはインデント 4 スペースがあります...

_loginOperation = [CheckTIMPreparation tim_CheckPreparationSuccess:^{
    [weakSelf checkIsJoinGroup];
} failure:^(NSString *errorString) {
    [weakSelf showloginingViewWithFail];
}];

フォーマット後:

_loginOperation = [CheckTIMPreparation tim_CheckPreparationSuccess:^{
  [weakSelf checkIsJoinGroup];
}
    failure:^(NSString *errorString) {
      [weakSelf showloginingViewWithFail];
    }];

clang-format 設定をカスタマイズするにはどうすればよいですか?

これが私の設定です:

BasedOnStyle: LLVM  
IndentWidth: 4  
BreakBeforeBraces: Attach  
AllowShortIfStatementsOnASingleLine: true  
IndentCaseLabels: true    
ObjCBlockIndentWidth: 4   
ObjCSpaceAfterProperty: true
ColumnLimit: 0  
AlignTrailingComments: true  
SpaceAfterCStyleCast: true 
SpacesInParentheses: false  
SpacesInSquareBrackets: false
4

1 に答える 1