From 90402e1472578d3d3584876168f654a55b671acf Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Mon, 28 Apr 2025 15:34:52 +0200 Subject: ide: add clang tooling configuration --- .clang-format | 153 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .clangd | 5 ++ 2 files changed, 158 insertions(+) create mode 100644 .clang-format create mode 100644 .clangd diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..7af84f6 --- /dev/null +++ b/.clang-format @@ -0,0 +1,153 @@ +--- +Language: Cpp + +AccessModifierOffset: -2 + +AlignAfterOpenBracket: Align +AlignArrayOfStructures: Left +AlignConsecutiveAssignments: false +AlignConsecutiveBitFields: true +AlignConsecutiveDeclarations: false +AlignEscapedNewlines: Right +AlignOperands: true +AlignTrailingComments: + Kind: Always + +AllowAllParametersOfDeclarationOnNextLine: false +AllowAllArgumentsOnNextLine: false +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: None +AllowShortIfStatementsOnASingleLine: false +AllowShortLambdasOnASingleLine: Inline +AllowShortLoopsOnASingleLine: false + +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakTemplateDeclarations: Yes + +BinPackArguments: false +BinPackParameters: false + +BraceWrapping: + AfterCaseLabel: true + AfterClass: true + AfterControlStatement: Always + AfterEnum: true + AfterFunction: true + AfterNamespace: true + AfterStruct: true + AfterUnion: true + AfterExternBlock: true + BeforeCatch: true + BeforeElse: true + BeforeWhile: false + IndentBraces: false + +BreakBeforeBraces: Custom +BreakBeforeConceptDeclarations: Always +BreakInheritanceList: AfterComma +BreakBeforeInlineASMColon: Always +BreakConstructorInitializers: BeforeComma +BreakStringLiterals: true + +ColumnLimit: 144 + +CompactNamespaces: false + +Cpp11BracedListStyle: true + +DerivePointerAlignment: false + +EmptyLineBeforeAccessModifier: Always + +FixNamespaceComments: true + +IncludeBlocks: Regroup +IncludeCategories: + # Local Headers + - Regex: '^"[[:alnum:]_/\-]+\.h(pp)?' + Priority: 200 + # sigc++ Headers + - Regex: '^' + Priority: 500 + + +IndentCaseLabels: false +IndentPPDirectives: None +IndentWidth: 2 +IndentRequiresClause: false + +InsertTrailingCommas: Wrapped + +IntegerLiteralSeparator: + Binary: 4 + Decimal: 3 + DecimalMinDigits: 5 + Hex: 2 + HexMinDigits: 6 + +KeepEmptyLinesAtTheStartOfBlocks: true + +LambdaBodyIndentation: OuterScope + +MaxEmptyLinesToKeep: 1 + +NamespaceIndentation: All + +PointerAlignment: Middle + +ReferenceAlignment: Middle + +ReflowComments: true + +RemoveSemicolon: true + +RequiresClausePosition: OwnLine +RequiresExpressionIndentation: OuterScope + +ShortNamespaceLines: 0 + +SortIncludes: true +SortUsingDeclarations: true + +SpaceAfterCStyleCast: false +SpaceAfterTemplateKeyword: false +SpaceBeforeAssignmentOperators: true +SpaceBeforeParens: ControlStatements +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 2 +SpacesInAngles: false +SpacesInContainerLiterals: false +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +SpacesInSquareBrackets: false + +Standard: Latest + +TabWidth: 2 + +UseTab: Never + +... diff --git a/.clangd b/.clangd new file mode 100644 index 0000000..e26469f --- /dev/null +++ b/.clangd @@ -0,0 +1,5 @@ +CompileFlags: + Remove: [-fmodules-ts, -fdeps-format=*, -fmodule-mapper=*, -fcondition-coverage] +Diagnostics: + UnusedIncludes: Strict + MissingIncludes: Strict \ No newline at end of file -- cgit v1.2.3