| 1234567891011121314151617181920212223242526272829 |
- # Describes the style the codebase ALREADY uses, so running it is close to a
- # no-op on existing files. Derived by measuring: 4-space indent, no tabs,
- # references bound to the type, attached braces, and a 100-column line (the
- # 99th percentile of existing lines is exactly 100).
- Language: Cpp
- BasedOnStyle: LLVM
- IndentWidth: 4
- TabWidth: 4
- UseTab: Never
- ColumnLimit: 100
- PointerAlignment: Left
- ReferenceAlignment: Left
- AccessModifierOffset: -2
- AllowShortFunctionsOnASingleLine: Inline
- AllowShortIfStatementsOnASingleLine: WithoutElse
- AllowShortLoopsOnASingleLine: true
- BreakBeforeBraces: Attach
- # The single most important setting here. Every route handler is a lambda
- # passed to svr.Get/Post/..., and the codebase indents its body 4 from the
- # STATEMENT, not from the lambda's column. Without OuterScope, clang-format
- # re-indents every handler body in the project.
- LambdaBodyIndentation: OuterScope
- # The flat quoted-include convention: our own headers are one group and must
- # not be re-sorted into the system block.
- IncludeBlocks: Preserve
- SortIncludes: CaseSensitive
- # A braced initialiser holding a JSON object literal is laid out by hand to show
- # its shape; letting clang-format repack it destroys the readability.
- Cpp11BracedListStyle: true
|