|
| 1 | +# Copyright Agustin K-ballo Berge, Fusion Fenix 2026 |
| 2 | +# |
| 3 | +# Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 4 | +# file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 5 | +--- |
| 6 | +Language: Cpp |
| 7 | +Standard: Latest |
| 8 | + |
| 9 | +# ── Indentation ────────────────────────────────────────────────────────────── |
| 10 | +IndentWidth: 4 |
| 11 | +TabWidth: 4 |
| 12 | +UseTab: Never |
| 13 | +ContinuationIndentWidth: 4 |
| 14 | +IndentCaseLabels: true |
| 15 | +IndentPPDirectives: AfterHash # `# if`, `# define` inside nested ifdefs |
| 16 | +NamespaceIndentation: None # namespace bodies are NOT indented |
| 17 | + |
| 18 | +# ── Column limit ───────────────────────────────────────────────────────────── |
| 19 | +ColumnLimit: 80 # classic; fits terminal & paper |
| 20 | + |
| 21 | +# ── Brace style ────────────────────────────────────────────────────────────── |
| 22 | +BreakBeforeBraces: Mozilla # wraps after functions and classes/structs |
| 23 | + |
| 24 | +# ── Spaces ─────────────────────────────────────────────────────────────────── |
| 25 | +SpaceBeforeParens: ControlStatements |
| 26 | +SpaceInEmptyParentheses: false |
| 27 | +SpacesInParentheses: false |
| 28 | +SpacesInSquareBrackets: false |
| 29 | +SpacesInAngles: false # `vector<int>` not `vector< int >` |
| 30 | +SpaceAfterTemplateKeyword: true # `template <typename T>` (space after kw) |
| 31 | +SpaceBeforeAssignmentOperators: true |
| 32 | +SpaceBeforeCpp11BracedList: false |
| 33 | + |
| 34 | +# ── Pointer / reference alignment ──────────────────────────────────────────── |
| 35 | +# East-const style: `T const&`, `T*` → pointer/ref binds to the type, not name |
| 36 | +PointerAlignment: Left # `T* p` / `T& r` — type-side binding |
| 37 | +ReferenceAlignment: Left |
| 38 | + |
| 39 | +# ── Template / requires ────────────────────────────────────────────────────── |
| 40 | +AlwaysBreakTemplateDeclarations: Yes # `template <…>` always on its own line |
| 41 | + # before the declaration |
| 42 | + |
| 43 | +# ── Function / call formatting ─────────────────────────────────────────────── |
| 44 | +AllowShortFunctionsOnASingleLine: Inline # only genuinely trivial accessors inline |
| 45 | +AllowShortIfStatementsOnASingleLine: true |
| 46 | +AllowShortLoopsOnASingleLine: true |
| 47 | +AllowShortLambdasOnASingleLine: Inline |
| 48 | +AlignAfterOpenBracket: BlockIndent # always breaks, places closing |
| 49 | + # brackets on new lines |
| 50 | + |
| 51 | +BinPackArguments: true # all args same line |
| 52 | +BinPackParameters: true # same for parameters |
| 53 | + |
| 54 | +# ── Return type ────────────────────────────────────────────────────────────── |
| 55 | +AlwaysBreakAfterReturnType: None # return type stays on same line as name |
| 56 | + # unless forced by column limit |
| 57 | + |
| 58 | +# ── Constructor initialiser lists ──────────────────────────────────────────── |
| 59 | +BreakConstructorInitializers: BeforeColon # `: base(x)\n, member_(y)` style |
| 60 | +ConstructorInitializerIndentWidth: 4 |
| 61 | +PackConstructorInitializers: Never |
| 62 | + |
| 63 | +# ── Inheritance ────────────────────────────────────────────────────────────── |
| 64 | +BreakInheritanceList: BeforeColon |
| 65 | + |
| 66 | +# ── Include sorting ────────────────────────────────────────────────────────── |
| 67 | +SortIncludes: CaseSensitive |
| 68 | +IncludeBlocks: Regroup |
| 69 | +IncludeCategories: |
| 70 | + # 1. The library's own headers <eggs/…> |
| 71 | + - Regex: '^<eggs/' |
| 72 | + Priority: 1 |
| 73 | + # 2. Standard library |
| 74 | + - Regex: '^<[a-z_]+>$' |
| 75 | + Priority: 2 |
| 76 | + # 3. Everything else (config, platform) |
| 77 | + - Regex: '.*' |
| 78 | + Priority: 3 |
| 79 | + |
| 80 | +# ── Comments ───────────────────────────────────────────────────────────────── |
| 81 | +ReflowComments: false # do NOT reflow // section banners |
| 82 | + # (e.g. `// namespace detail`) |
| 83 | +SpacesBeforeTrailingComments: 1 |
| 84 | + |
| 85 | +# ── Alignment ──────────────────────────────────────────────────────────────── |
| 86 | +AlignConsecutiveAssignments: false # no forced vertical alignment of `=` |
| 87 | +AlignConsecutiveDeclarations: false |
| 88 | +AlignTrailingComments: true # trailing `//` comments align in a block |
| 89 | +AlignEscapedNewlines: Left |
| 90 | + |
| 91 | +# ── Misc ───────────────────────────────────────────────────────────────────── |
| 92 | +Cpp11BracedListStyle: true |
| 93 | +FixNamespaceComments: true # auto-add `// namespace foo` at closing } |
| 94 | +CompactNamespaces: false |
| 95 | +MaxEmptyLinesToKeep: 1 |
| 96 | +KeepEmptyLinesAtTheStartOfBlocks: false |
| 97 | +DerivePointerAlignment: false |
| 98 | +SeparateDefinitionBlocks: Always # blank line between top-level definitions |
0 commit comments