SEGGER Embedded Studio for 自动统一代码格式

Tool -> Options -> Text Editor -> Formatting

配置选项:

配代码参考格式链接:Clang-Format Style Options — Clang 20.0.0git documentation (llvm.org)

 

AlignConsecutiveAssignments: Consecutive

AlignEscapedNewlinesLeft: Left

AlignOperands: DontAlign

AlignTrailingComments:

Kind: Always

OverEmptyLines: 2

AllowShortBlocksOnASingleLine: Never

AllowShortCaseLabelsOnASingleLine: false

AllowShortFunctionsOnASingleLine: Inline

AllowShortIfStatementsOnASingleLine: Never

AllowShortLoopsOnASingleLine: false

AlwaysBreakBeforeMultilineStrings: true

AlwaysBreakTemplateDeclarations: Yes

BinPackArguments: false

BinPackParameters: false

ColumnLimit: 120

PackConstructorInitializers: CurrentLine

DerivePointerAlignment: true

IndentCaseLabels: false

KeepEmptyLinesAtTheStartOfBlocks: false

PenaltyBreakBeforeFirstCallParameter: 1

PenaltyReturnTypeOnItsOwnLine: 200

PointerAlignment: Left

SpacesBeforeTrailingComments: 4

Standard: Auto

 多种格式选择:

 

 

posted @ 2024-09-04 10:58  求隐  阅读(225)  评论(0)    收藏  举报