# House style. Byte-identical to the .clang-format already committed in PaulDB # and tui-framework -- this file is the source of truth, not a new invention. # # Requires clang-format >= 19: BreakAfterReturnType was renamed from # AlwaysBreakAfterReturnType in 19. Ubuntu 24.04 ships 18 and will REJECT this # file -- install LLVM from apt.llvm.org there. BasedOnStyle: LLVM PointerAlignment: Left ReferenceAlignment: Left ColumnLimit: 100 BreakAfterReturnType: All BinPackParameters: false IndentWidth: 4 TabWidth: 4 UseTab: Never ContinuationIndentWidth: 4 BreakBeforeBraces: Allman KeepEmptyLinesAtTheStartOfBlocks: false SpaceAfterCStyleCast: true SpaceInEmptyParentheses: false SpacesInParentheses: false SpacesInSquareBrackets: false AllowShortIfStatementsOnASingleLine: WithoutElse SortIncludes: CaseSensitive IncludeBlocks: Regroup AllowShortFunctionsOnASingleLine: Empty AllowShortLoopsOnASingleLine: false ReflowComments: true # Zusatz gegenueber der PaulDB-Fassung: ohne das rueckt clang-format den # gesamten Inhalt eines extern "C"-Blocks um 4 ein. Da jeder C-Header hier fuer # die C++-Seite einen solchen Block hat, waere das die Mehrheit jeder Datei. IndentExternBlock: NoIndent # LLVM setzt -2, was zu IndentWidth 2 passt. Bei IndentWidth 4 landen public: # und private: sonst zwei Spalten eingerueckt statt buendig mit der Klammer. AccessModifierOffset: -4 # Damit clang-format bei page.test.c erkennt, dass der # Hauptheader ist und ihn nach ganz oben in einen eigenen Block sortiert. # Der Vorgabewert kennt nur die Formen foo_test.c und foo-test.c, nicht die # P1204-Form foo.test.c. IncludeIsMainRegex: '(\.test)?$' # Include ordering, so that Regroup has a policy to apply. # P1204R0: own headers are included as , never "foo.h". IncludeCategories: # Own project headers first. - Regex: '^$' Priority: 3 # C++ standard library (extensionless). - Regex: '^<[a-z_]+>$' Priority: 4 # Everything else (system, third-party). - Regex: '.*' Priority: 5