|
| 1 | +--- |
| 2 | +# Last formatted with clang-format version 17.0.3 |
| 3 | +Language: Cpp |
| 4 | +BasedOnStyle: Microsoft |
| 5 | +AccessModifierOffset: -4 |
| 6 | +# AlwaysBreak & BlockIndent are buggy |
| 7 | +# AlwaysBreak: https://github.com/llvm/llvm-project/issues/57241 |
| 8 | +# BlockIndent: https://github.com/llvm/llvm-project/issues/57250 |
| 9 | +# Align is widely the default and seems to work more reasonably. |
| 10 | +AlignAfterOpenBracket: Align |
| 11 | +AlignConsecutiveMacros: Consecutive |
| 12 | +AlignConsecutiveAssignments: AcrossEmptyLines |
| 13 | +AlignConsecutiveBitFields: AcrossEmptyLines |
| 14 | +AlignConsecutiveDeclarations: AcrossEmptyLines |
| 15 | +AlignEscapedNewlines: Left |
| 16 | +AlignOperands: Align |
| 17 | +BreakBeforeBinaryOperators: NonAssignment |
| 18 | +# style Microsoft is actually for C# but TPM code base historically uses ~80 chars |
| 19 | +ColumnLimit: 86 |
| 20 | +# don't break after return types, though clang-format seems to have some issues |
| 21 | +# with this and still breaks after TPM_RC and some other types. |
| 22 | +# open issue with LLVM, no confirmation or workaround identified yet. |
| 23 | +AlwaysBreakAfterDefinitionReturnType: None |
| 24 | +AlwaysBreakAfterReturnType: None |
| 25 | +# we prefer one parameter per line since many parameters have comments |
| 26 | +# and binpacking will create extra inconsistency |
| 27 | +BinPackArguments: false |
| 28 | +BinPackParameters: false |
| 29 | +# Microsft standard C/C++ braces |
| 30 | +BreakBeforeBraces: Allman |
| 31 | +IncludeBlocks: Preserve |
| 32 | +IndentCaseLabels: true |
| 33 | +IndentCaseBlocks: false |
| 34 | +IndentGotoLabels: false |
| 35 | +# Before hash can misalign comments when IndentWidth and PPIndentWidth differ. |
| 36 | +IndentPPDirectives: AfterHash |
| 37 | +IndentWidth: 4 |
| 38 | +PPIndentWidth: 2 |
| 39 | +# resist line-length excursions |
| 40 | +PenaltyExcessCharacter: 100000 |
| 41 | +# prefer not to break after '='' and '(' for function calls |
| 42 | +# can still happen based on length of components |
| 43 | +PenaltyBreakAssignment: 10 |
| 44 | +PenaltyBreakBeforeFirstCallParameter: 1000 |
| 45 | +# prefer to break a string constant rather than wrap the entire set of |
| 46 | +# array brackets and equal sign. If this is too high, can produce this: |
| 47 | +# const char somereallylongvariablename |
| 48 | +# [] = "...." |
| 49 | +# which is really weird. |
| 50 | +PenaltyBreakString: 10 |
| 51 | +PenaltyBreakOpenParenthesis: 1 |
| 52 | +# really dislike breaking after bare return type, wastes vertical space. |
| 53 | +PenaltyReturnTypeOnItsOwnLine: 100000000 |
| 54 | +# FOO* bar, not FOO *bar |
| 55 | +PointerAlignment: Left |
| 56 | +# don't touch comments that might have MD tables or other |
| 57 | +# complex snippets |
| 58 | +ReflowComments: false |
| 59 | +# don't sort includes because we can't be sure includes are order-agnostic. |
| 60 | +SortIncludes: false |
| 61 | +SpaceAroundPointerQualifiers: Default |
| 62 | +SpacesBeforeTrailingComments: 2 |
| 63 | +SpacesInConditionalStatement: false |
| 64 | +# current code is inconsistent, but a simple search for "if (" and "if(" |
| 65 | +# shows false to be most consistent with existing TPM code by |
| 66 | +# about 2-to-1 |
| 67 | +SpaceBeforeParens: false |
| 68 | +StatementMacros: |
| 69 | + - _Acquires_exclusive_lock_ |
| 70 | + - _Acquires_lock_ |
| 71 | + - _Function_class_ |
| 72 | + - _IRQL_requires_ |
| 73 | + - _Must_inspect_result_ |
| 74 | + - _No_competing_thread_ |
| 75 | + - _Post_same_lock_ |
| 76 | + - _Post_writable_byte_size_ |
| 77 | + - _Pre_satisfies_ |
| 78 | + - _Releases_lock_ |
| 79 | + - _Requires_exclusive_lock_held_ |
| 80 | + - _Requires_lock_held_ |
| 81 | + - _Requires_lock_not_held_ |
| 82 | + - _Requires_shared_lock_held_ |
| 83 | + - _Ret_maybenull_ |
| 84 | + - _Success_ |
| 85 | + - _Use_decl_annotations_ |
| 86 | + - "DLPENTRY\n" |
| 87 | +TabWidth: 4 |
| 88 | +TypenameMacros: |
| 89 | + - BN_STRUCT_DEF |
| 90 | +DeriveLineEnding: false |
| 91 | +UseCRLF: false |
| 92 | +UseTab: Never |
| 93 | +WhitespaceSensitiveMacros: |
| 94 | + - STRINGIZE |
| 95 | + - LIB_QUOTE |
| 96 | + - LIB_INCLUDE2 |
| 97 | + - PROFILE_QUOTE |
| 98 | +... |
0 commit comments