diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..3177680 --- /dev/null +++ b/.clang-format @@ -0,0 +1,30 @@ +--- +# Prism coding style — enforced by clang-format. +# Conventions that cannot be automated (e.g. return-type alignment +# across declarations) are documented in AGENTS.md. + +BasedOnStyle: LLVM + +# Indentation — tabs (no spaces) +UseTab: Always +IndentWidth: 8 +TabWidth: 8 + +# Braces — always required after if/else/for/while/do +AllowShortFunctionsOnASingleLine: false +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +BreakBeforeBraces: Attach + +# Pointer/reference alignment — * against name not type +PointerAlignment: Right +ReferenceAlignment: Right + +# Continuation lines — align with first parameter after ( +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false + +# Line width +ColumnLimit: 120 +PenaltyReturnTypeOnItsOwnLine: 1000