|
| 1 | +BasedOnStyle: Google |
| 2 | + |
| 3 | +# These are already part of Google style, but explicitly add them here because |
| 4 | +# they're called out in the coding guidelines: |
| 5 | +Standard: Cpp11 |
| 6 | +IndentWidth: 2 |
| 7 | +UseTab: Never |
| 8 | + |
| 9 | +# Google default of 80 columns is a little tight: |
| 10 | +ColumnLimit: 110 |
| 11 | + |
| 12 | +# Protect long string literals already in source: |
| 13 | +BreakStringLiterals: false |
| 14 | + |
| 15 | +# Comment lines that follow these patterns are likely to be commented out code. Don't reflow these. |
| 16 | +# |
| 17 | +# Patterns in this regex are: |
| 18 | +# 1. a line comment (ie. a second one inside of the first comment) |
| 19 | +# 2. preprocessor directive |
| 20 | +# 3. various common code line endings |
| 21 | +CommentPragmas: '(//|^\s*#|(;|:|"|{|}|\(|\)|\[|\]|<|>)\s*$)' |
| 22 | + |
| 23 | +# Indent before the ':' |
| 24 | +ConstructorInitializerIndentWidth: 2 |
| 25 | + |
| 26 | +# If false, leave case labels at the same level as the switch: |
| 27 | +IndentCaseLabels: false |
| 28 | + |
| 29 | +# Set the indent for public/protected/private in classes: |
| 30 | +AccessModifierOffset: -2 |
| 31 | + |
| 32 | +# Only allow empty functions and inline methods in class headers to go on a single line: |
| 33 | +AllowShortFunctionsOnASingleLine: Inline |
| 34 | + |
| 35 | +# Use one pointer alignment everywhere: |
| 36 | +DerivePointerAlignment: false |
| 37 | + |
| 38 | +# Try to preserve the dominant alignment style |
| 39 | +AlignConsecutiveAssignments: true |
| 40 | +AlignConsecutiveDeclarations: true |
| 41 | + |
| 42 | +# Try to preserve the dominant style for function parameters: |
| 43 | +AlignAfterOpenBracket: AlwaysBreak |
| 44 | +BinPackArguments: false |
| 45 | +BinPackParameters: false |
| 46 | + |
| 47 | +# This copies the Google format for brace breaking, except for adding a break after functions |
| 48 | +BreakBeforeBraces: Custom |
| 49 | +BraceWrapping: |
| 50 | + AfterClass: false |
| 51 | + AfterControlStatement: false |
| 52 | + AfterEnum: false |
| 53 | + AfterFunction: true |
| 54 | + AfterNamespace: false |
| 55 | + AfterObjCDeclaration: false |
| 56 | + AfterStruct: false |
| 57 | + AfterUnion: false |
| 58 | + AfterExternBlock: false |
| 59 | + BeforeCatch: false |
| 60 | + BeforeElse: false |
| 61 | + IndentBraces: false |
| 62 | + SplitEmptyFunction: true |
| 63 | + SplitEmptyRecord: true |
| 64 | + SplitEmptyNamespace: true |
| 65 | + |
0 commit comments