Add clang-format and clang-tidy configurations

This commit is contained in:
KitsuneAlex 2024-05-02 02:02:09 +02:00
parent 5dc5f6260b
commit cdaba2b212
No known key found for this signature in database
GPG Key ID: 6B0CE864BB69B7D0
2 changed files with 154 additions and 0 deletions

78
.clang-format Normal file
View File

@ -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

76
.clang-tidy Normal file
View File

@ -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