From cdaba2b212ff878cf071982ad56351bcb0254c35 Mon Sep 17 00:00:00 2001 From: KitsuneAlex Date: Thu, 2 May 2024 02:02:09 +0200 Subject: [PATCH] Add clang-format and clang-tidy configurations --- .clang-format | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++ .clang-tidy | 76 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 154 insertions(+) create mode 100644 .clang-format create mode 100644 .clang-tidy diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..a4068a4 --- /dev/null +++ b/.clang-format @@ -0,0 +1,78 @@ +BasedOnStyle: LLVM +AccessModifierOffset: -4 +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: None +AlignOperands: Align +AllowAllArgumentsOnNextLine: false +AllowAllConstructorInitializersOnNextLine: false +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortBlocksOnASingleLine: Always +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: None +AllowShortIfStatementsOnASingleLine: Never +AllowShortLambdasOnASingleLine: None +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterReturnType: None +AlwaysBreakAfterDefinitionReturnType: None +IndentWrappedFunctionNames: true +AlwaysBreakTemplateDeclarations: Yes +BreakBeforeBraces: Custom +BraceWrapping: + AfterCaseLabel: false + AfterClass: false + AfterControlStatement: Never + AfterEnum: false + AfterFunction: false + AfterNamespace: false + AfterUnion: false + BeforeCatch: true + BeforeElse: true + IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: true +BreakBeforeBinaryOperators: None +BreakBeforeTernaryOperators: false +BreakConstructorInitializers: BeforeColon +BreakInheritanceList: BeforeColon +ColumnLimit: 140 +CompactNamespaces: false +ContinuationIndentWidth: 4 +IndentCaseLabels: true +IndentPPDirectives: None +IndentWidth: 4 +KeepEmptyLinesAtTheStartOfBlocks: true +MaxEmptyLinesToKeep: 2 +NamespaceIndentation: All +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: true +PointerAlignment: Left +ReflowComments: false +SpaceAfterCStyleCast: true +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: false +SpaceBeforeAssignmentOperators: true +SpaceBeforeCpp11BracedList: true +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeParens: Never +SpaceBeforeRangeBasedForLoopColon: true +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 0 +SpacesInAngles: false +SpacesInCStyleCastParentheses: false +SpacesInContainerLiterals: true +SpacesInParentheses: false +SpacesInSquareBrackets: false +PackConstructorInitializers: Never +ConstructorInitializerIndentWidth: 4 +BreakBeforeConceptDeclarations: Always +TabWidth: 4 +UseTab: Never +RequiresClausePosition: OwnLine +IndentRequiresClause: false +AlignEscapedNewlines: Left +BreakConstructorInitializersBeforeComma: true +BinPackParameters: false +BinPackArguments: true +EmptyLineAfterAccessModifier: Never +EmptyLineBeforeAccessModifier: Always diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..7bbeee6 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,76 @@ +Checks: ' +-*, +readability-*, +-readability-magic-numbers, +modernize-*, +-modernize-use-trailing-return-type, +-modernize-use-default-member-init, +cppcoreguidelines-*, +-cppcoreguidelines-owning-memory, +-cppcoreguidelines-use-default-member-init, +-cppcoreguidelines-avoid-magic-numbers, +-cppcoreguidelines-pro-type-reinterpret-cast, +-cppcoreguidelines-pro-bounds-pointer-arithmetic, +-cppcoreguidelines-macro-usage, +-cppcoreguidelines-missing-std-forward, +-google-explicit-constructor, +-fuchsia-overloaded-operator, +bugprone-*, +-bugprone-assert-side-effect, +-bugprone-assignment-in-if-condition, +-bugprone-easily-swappable-parameters, +-bugprone-reserved-identifier +' +HeaderFilterRegex: '' +AnalyzeTemporaryDtors: false +CheckOptions: + - key: modernize-replace-auto-ptr.IncludeStyle + value: llvm + - key: readability-uppercase-literal-suffix.NewSuffixes + value: L;LL;LU;LLU + - key: readability-identifier-naming.NamespaceCase + value: lower_case + - key: readability-identifier-naming.ClassCase + value: CamelCase + - key: readability-identifier-naming.EnumConstantCase + value: UPPER_CASE + - key: readability-identifier-naming.MemberCase + value: lower_case + - key: readability-identifier-naming.ClassMemberCase + value: lower_case + - key: readability-identifier-naming.VariableCase + value: lower_case + - key: readability-identifier-naming.PrivateMemberPrefix + value: _ + - key: readability-identifier-naming.ProtectedMemberPrefix + value: _ + - key: readability-identifier-naming.FunctionCase + value: lower_case + - key: readability-identifier-naming.ConstantCase + value: UPPER_CASE + - key: readability-identifier-naming.ConstantParameterCase + value: lower_case + - key: readability-identifier-naming.ClassConstantCase + value: UPPER_CASE + - key: readability-identifier-naming.StaticConstantCase + value: UPPER_CASE + - key: readability-identifier-naming.StaticVariableCase + value: lower_case + - key: readability-identifier-naming.LocalConstantCase + value: UPPER_CASE + - key: readability-identifier-naming.TypedefCase + value: CamelCase + - key: readability-identifier-naming.TypeAliasCase + value: CamelCase + - key: readability-identifier-naming.TemplateParameterCase + value: CamelCase + - key: readability-identifier-naming.TemplateParameterPrefix + value: T + - key: readability-identifier-naming.TemplateTemplateParameterCase + value: CamelCase + - key: readability-identifier-naming.TemplateTemplateParameterPrefix + value: T + - key: readability-identifier-naming.ValueTemplateParameterCase + value: CamelCase + - key: readability-identifier-naming.ValueTemplateParameterPrefix + value: T