Skip to content
Snippets Groups Projects
.clang-format 3.85 KiB
Newer Older
  • Learn to ignore specific revisions
  • Karsten Suehring's avatar
    Karsten Suehring committed
    ---
    
    # to be used on clang-format version 14 or later
    
    Karsten Suehring's avatar
    Karsten Suehring committed
    Language:        Cpp
    AccessModifierOffset: -2
    AlignAfterOpenBracket: Align
    
    AlignConsecutiveAssignments: AcrossComments
    AlignConsecutiveBitFields: AcrossComments
    AlignConsecutiveDeclarations: AcrossComments
    AlignConsecutiveMacros: AcrossComments
    AlignEscapedNewlines: Left
    AlignOperands:   Align
    
    Karsten Suehring's avatar
    Karsten Suehring committed
    AlignTrailingComments: true
    
    AllowAllArgumentsOnNextLine: false
    
    Karsten Suehring's avatar
    Karsten Suehring committed
    AllowAllParametersOfDeclarationOnNextLine: false
    
    AllowShortBlocksOnASingleLine: Always
    
    AllowShortCaseLabelsOnASingleLine: false
    
    AllowShortEnumsOnASingleLine: false
    
    AllowShortFunctionsOnASingleLine: All
    
    AllowShortIfStatementsOnASingleLine: Never
    AllowShortLambdasOnASingleLine: All
    
    Karsten Suehring's avatar
    Karsten Suehring committed
    AllowShortLoopsOnASingleLine: false
    AlwaysBreakAfterReturnType: None
    AlwaysBreakBeforeMultilineStrings: false
    
    AlwaysBreakTemplateDeclarations: No
    
    Karsten Suehring's avatar
    Karsten Suehring committed
    BinPackArguments: true
    BinPackParameters: true
    
    BraceWrapping:
      AfterCaseLabel:  true
    
    Karsten Suehring's avatar
    Karsten Suehring committed
      AfterClass:      true
    
      AfterControlStatement: Always
    
    Karsten Suehring's avatar
    Karsten Suehring committed
      AfterEnum:       true
      AfterFunction:   true
      AfterNamespace:  true
    
      AfterObjCDeclaration: true
    
    Karsten Suehring's avatar
    Karsten Suehring committed
      AfterStruct:     true
      AfterUnion:      true
      AfterExternBlock: true
      BeforeCatch:     true
      BeforeElse:      true
    
      BeforeLambdaBody: true
      BeforeWhile:     false
    
    Karsten Suehring's avatar
    Karsten Suehring committed
      IndentBraces:    false
      SplitEmptyFunction: false
      SplitEmptyRecord: false
      SplitEmptyNamespace: false
    BreakBeforeBinaryOperators: NonAssignment
    
    BreakBeforeBraces: Custom
    
    Karsten Suehring's avatar
    Karsten Suehring committed
    BreakBeforeInheritanceComma: false
    
    BreakInheritanceList: BeforeColon
    
    Karsten Suehring's avatar
    Karsten Suehring committed
    BreakBeforeTernaryOperators: true
    BreakConstructorInitializers: BeforeComma
    BreakAfterJavaFieldAnnotations: false
    BreakStringLiterals: true
    ColumnLimit:     120
    CommentPragmas:  '^ IWYU pragma:'
    CompactNamespaces: false
    ConstructorInitializerAllOnOneLineOrOnePerLine: true
    ConstructorInitializerIndentWidth: 2
    ContinuationIndentWidth: 2
    Cpp11BracedListStyle: false
    DerivePointerAlignment: false
    DisableFormat:   false
    ExperimentalAutoDetectBinPacking: false
    FixNamespaceComments: true
    
    ForEachMacros:
    
    Karsten Suehring's avatar
    Karsten Suehring committed
      - foreach
      - Q_FOREACH
      - BOOST_FOREACH
    IncludeBlocks:   Preserve
    
    IncludeCategories:
    
    Karsten Suehring's avatar
    Karsten Suehring committed
      - Regex:           '^"(llvm|llvm-c|clang|clang-c)/'
        Priority:        2
    
        SortPriority:    0
        CaseSensitive:   false
    
    Karsten Suehring's avatar
    Karsten Suehring committed
      - Regex:           '^(<|"(gtest|gmock|isl|json)/)'
        Priority:        3
    
        SortPriority:    0
        CaseSensitive:   false
    
    Karsten Suehring's avatar
    Karsten Suehring committed
      - Regex:           '.*'
        Priority:        1
    
        SortPriority:    0
        CaseSensitive:   false
    
    Karsten Suehring's avatar
    Karsten Suehring committed
    IncludeIsMainRegex: '(Test)?$'
    IndentCaseLabels: false
    
    IndentCaseBlocks: true
    IndentGotoLabels: false
    
    Karsten Suehring's avatar
    Karsten Suehring committed
    IndentPPDirectives: None
    
    IndentExternBlock: NoIndent
    
    Karsten Suehring's avatar
    Karsten Suehring committed
    IndentWidth:     2
    IndentWrappedFunctionNames: true
    JavaScriptQuotes: Leave
    JavaScriptWrapImports: true
    KeepEmptyLinesAtTheStartOfBlocks: false
    MacroBlockBegin: ''
    MacroBlockEnd:   ''
    MaxEmptyLinesToKeep: 1
    
    NamespaceIndentation: None
    
    Karsten Suehring's avatar
    Karsten Suehring committed
    ObjCBinPackProtocolList: Auto
    ObjCBlockIndentWidth: 2
    ObjCSpaceAfterProperty: false
    ObjCSpaceBeforeProtocolList: true
    PenaltyBreakAssignment: 2
    PenaltyBreakBeforeFirstCallParameter: 19
    PenaltyBreakComment: 300
    PenaltyBreakFirstLessLess: 120
    PenaltyBreakString: 1000
    PenaltyExcessCharacter: 1000000
    PenaltyReturnTypeOnItsOwnLine: 60
    
    PointerAlignment: Left
    
    Karsten Suehring's avatar
    Karsten Suehring committed
    ReflowComments:  true
    SortIncludes:    false
    SortUsingDeclarations: true
    SpaceAfterCStyleCast: true
    
    SpaceAfterLogicalNot: false
    
    Karsten Suehring's avatar
    Karsten Suehring committed
    SpaceAfterTemplateKeyword: false
    SpaceBeforeAssignmentOperators: true
    
    SpaceBeforeCaseColon: false
    
    Karsten Suehring's avatar
    Karsten Suehring committed
    SpaceBeforeCtorInitializerColon: true
    SpaceBeforeInheritanceColon: true
    SpaceBeforeParens: ControlStatements
    
    SpaceAroundPointerQualifiers: Default
    
    Karsten Suehring's avatar
    Karsten Suehring committed
    SpaceBeforeRangeBasedForLoopColon: false
    
    SpaceInEmptyBlock: false
    
    Karsten Suehring's avatar
    Karsten Suehring committed
    SpaceInEmptyParentheses: false
    SpacesBeforeTrailingComments: 3
    
    SpacesInAngles: false
    SpacesInConditionalStatement: false
    
    Karsten Suehring's avatar
    Karsten Suehring committed
    SpacesInContainerLiterals: true
    SpacesInCStyleCastParentheses: false
    SpacesInParentheses: false
    SpacesInSquareBrackets: false
    
    Standard:        c++17
    
    Karsten Suehring's avatar
    Karsten Suehring committed
    TabWidth:        8
    UseTab:          Never
    ...