|
| 1 | +# Clang-Format Configuration |
| 2 | +--- |
| 3 | +BasedOnStyle: LLVM |
| 4 | + |
| 5 | +# Indent |
| 6 | +ConstructorInitializerIndentWidth: 2 |
| 7 | +ContinuationIndentWidth: 2 |
| 8 | +IndentPPDirectives: AfterHash |
| 9 | + |
| 10 | +# Alignment |
| 11 | +AlignAfterOpenBracket: AlwaysBreak |
| 12 | +AlignEscapedNewlines: Left |
| 13 | +AlignOperands: DontAlign |
| 14 | +PointerAlignment: Left |
| 15 | + |
| 16 | +# Breaks |
| 17 | +AllowAllArgumentsOnNextLine: true |
| 18 | +AllowAllConstructorInitializersOnNextLine: false |
| 19 | +AllowAllParametersOfDeclarationOnNextLine: false |
| 20 | +AllowShortBlocksOnASingleLine: Empty |
| 21 | +AllowShortFunctionsOnASingleLine: Empty |
| 22 | +AllowShortLambdasOnASingleLine: Empty |
| 23 | +AllowShortLoopsOnASingleLine: false |
| 24 | +AllowShortIfStatementsOnASingleLine: Never |
| 25 | +AlwaysBreakBeforeMultilineStrings: true |
| 26 | +AlwaysBreakTemplateDeclarations: Yes |
| 27 | +BinPackArguments: false |
| 28 | +BinPackParameters: false |
| 29 | +BraceWrapping: |
| 30 | + AfterClass: true |
| 31 | + AfterControlStatement: MultiLine |
| 32 | + AfterFunction: true |
| 33 | + AfterStruct: true |
| 34 | + AfterUnion: true |
| 35 | + BeforeCatch: true |
| 36 | + BeforeElse: false |
| 37 | + BeforeLambdaBody: false |
| 38 | + SplitEmptyFunction: false |
| 39 | + SplitEmptyRecord: false |
| 40 | + SplitEmptyNamespace: false |
| 41 | +BreakBeforeBraces: Custom |
| 42 | +KeepEmptyLinesAtTheStartOfBlocks: false |
| 43 | +MaxEmptyLinesToKeep: 2 |
| 44 | + |
| 45 | +# Spaces |
| 46 | +Cpp11BracedListStyle: false |
| 47 | +SpacesInContainerLiterals: false |
| 48 | + |
| 49 | +# Columns |
| 50 | +ColumnLimit: 100 |
| 51 | +PenaltyBreakAssignment: 100 |
| 52 | +PenaltyBreakBeforeFirstCallParameter: 10 |
| 53 | +PenaltyBreakComment: 100 |
| 54 | +PenaltyBreakFirstLessLess: 100 |
| 55 | +PenaltyBreakString: 1000 |
| 56 | +PenaltyExcessCharacter: 10 |
| 57 | +PenaltyReturnTypeOnItsOwnLine: 10000 |
| 58 | + |
| 59 | +# Comments |
| 60 | +ReflowComments: false |
| 61 | +SpacesBeforeTrailingComments: 2 |
| 62 | +CommentPragmas: '^ (NOTE|TODO):' |
| 63 | + |
| 64 | +# Sorting |
| 65 | +SortUsingDeclarations: false |
| 66 | + |
| 67 | +# Line Endings |
| 68 | +DeriveLineEnding: false |
| 69 | +UseCRLF: false |
| 70 | +--- |
| 71 | +Language: Cpp |
| 72 | +Standard: c++20 |
| 73 | + |
| 74 | +# Includes |
| 75 | +SortIncludes: true |
| 76 | +IncludeBlocks: Preserve |
| 77 | +IncludeCategories: |
| 78 | + # Relative Paths |
| 79 | + - Regex: '^"' |
| 80 | + Priority: 1 |
| 81 | + |
| 82 | + # Windows Core Headers |
| 83 | + - Regex: '^<(ntifs|windows)\.h>' |
| 84 | + Priority: 2 |
| 85 | + |
| 86 | + # Windows Driver Headers |
| 87 | + - Regex: '^<(ntddk|wdm)\.h>' |
| 88 | + Priority: 3 |
| 89 | + |
| 90 | + # Windows Headers |
| 91 | + - Regex: '^<(wdf|shellapi|winsock2|ws2tcpip|mswsock)\.h>' |
| 92 | + Priority: 4 |
| 93 | + |
| 94 | + # GTest Headers |
| 95 | + - Regex: '^<(gtest|gmock)/' |
| 96 | + Priority: 5 |
| 97 | + SortPriority: 0 |
| 98 | + |
| 99 | + # Library Headers |
| 100 | + - Regex: '^<.*\.' |
| 101 | + Priority: 6 |
| 102 | + |
| 103 | + # C Compatibility Headers |
| 104 | + - Regex: '^<c(a|c|e|f|i|l|m|s|t|u|w)' |
| 105 | + Priority: 8 |
| 106 | + |
| 107 | + # C++ Standard Library Headers |
| 108 | + - Regex: '^<' |
| 109 | + Priority: 7 |
| 110 | + |
| 111 | +# Sources: a.hpp is main include for a.cpp, a_test.cpp, etc. |
| 112 | +IncludeIsMainRegex: '(_test|_win32|_posix)?$' |
| 113 | + |
| 114 | +# Headers: a.hpp, a_base.hpp, etc. are main includes for a.cpp |
| 115 | +IncludeIsMainSourceRegex: '(_base|_impl)?$' |
| 116 | + |
| 117 | +# Macros |
| 118 | +ForEachMacros: |
| 119 | + - foreach |
| 120 | + - Q_FOREACH |
| 121 | + - BOOST_FOREACH |
| 122 | + |
| 123 | +MacroBlockBegin: '^BEGIN_(MSG_MAP|MSG_MAP_EX|UPDATE_UI_MAP)' |
| 124 | +MacroBlockEnd: '^END_(MSG_MAP|UPDATE_UI_MAP)' |
| 125 | + |
| 126 | +StatementMacros: |
| 127 | + - Q_UNUSED |
| 128 | + - QT_REQUIRE_VERSION |
| 129 | +--- |
| 130 | +Language: ObjC |
| 131 | +DisableFormat: true |
| 132 | +--- |
| 133 | +Language: Java |
| 134 | +BreakAfterJavaFieldAnnotations: true |
| 135 | +--- |
| 136 | +Language: JavaScript |
| 137 | +JavaScriptQuotes: Double |
| 138 | +JavaScriptWrapImports: true |
| 139 | +... |
0 commit comments