Skip to content

Sample clang‐format

Damian edited this page Feb 13, 2024 · 1 revision

Sample CLang-Format

The following sample is borrowed from, Terminal, and can be used along side of an .editorconfig file.

---
Language: Cpp
BasedOnStyle: Microsoft
AccessModifierOffset: -4
AlignEscapedNewlines: Left
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortFunctionsOnASingleLine: All
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
  AfterCaseLabel: true
  AfterUnion: true
  AfterExternBlock: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
ColumnLimit: 0
CommentPragmas: "suppress"
ConstructorInitializerAllOnOneLineOrOnePerLine: true
Cpp11BracedListStyle: false
FixNamespaceComments: false
IncludeBlocks: Regroup
IncludeCategories:
    - Regex: '^.*(precomp|pch|stdafx)'
      Priority: -1
    - Regex: '^".*"'
      Priority: 1
    - Regex: '^<.*>'
      Priority: 2
    - Regex: '.*'
      Priority: 3
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: "BEGIN_TEST_METHOD_PROPERTIES|BEGIN_MODULE|BEGIN_TEST_CLASS|BEGIN_TEST_METHOD"
MacroBlockEnd: "END_TEST_METHOD_PROPERTIES|END_MODULE|END_TEST_CLASS|END_TEST_METHOD"
NamespaceIndentation: All
PointerAlignment: Left
ReflowComments: false
SortIncludes: false
SpaceAfterTemplateKeyword: false
SpacesInAngles: false
SpacesInContainerLiterals: false
Clone this wiki locally