Skip to content

Commit

Permalink
🎨 clang-format and clang-tidy config improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
lamarrr committed Nov 29, 2024
1 parent b02292b commit 1989519
Show file tree
Hide file tree
Showing 85 changed files with 3,356 additions and 2,952 deletions.
78 changes: 60 additions & 18 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
Language: Cpp
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignArrayOfStructures: Left
AlignConsecutiveAssignments:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AlignConsecutiveDeclarations:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AlignConsecutiveBitFields:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AlignConsecutiveMacros:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
Expand Down Expand Up @@ -60,40 +75,67 @@ IndentCaseLabels: true
IndentPPDirectives: AfterHash
IndentWidth: 2
IndentWrappedFunctionNames: true
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
InsertNewlineAtEOF: true
IntegerLiteralSeparator:
Binary: 8
Decimal: 3
Hex: 4
KeepEmptyLines:
AtEndOfFile: false
AtStartOfBlock: false
AtStartOfFile: false
LineEnding: LF
MacroBlockBegin: ""
MacroBlockEnd: ""
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PackConstructorInitializers: CurrentLine
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakComment: 30000
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: true
PointerAlignment: Middle
QualifierAlignment: Right
ReferenceAlignment : Middle
ReflowComments: false
RemoveParentheses: MultipleParentheses
RemoveSemicolon : true
RequiresClausePosition: WithPreceding
SeparateDefinitionBlocks: Always
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: true
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeParens: Custom
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterFunctionDefinitionName: false
AfterOverloadedOperator: false
AfterPlacementOperator : true
AfterRequiresInClause: true
AfterRequiresInExpression: true
BeforeNonEmptyParentheses: false
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpaceBeforeSquareBrackets: false
SpacesBeforeTrailingComments: 8
SpacesInAngles: false
SpacesInAngles: Never
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParens: Custom
SpacesInParensOptions:
ExceptDoubleParentheses: true
InConditionalStatements: false
InCStyleCasts: false
InEmptyParentheses: false
SpacesInSquareBrackets: false
TabWidth: 4
Standard: c++20
TabWidth: 4
14 changes: 13 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
Checks: "clang-diagnostic-*,clang-analyzer-*,google-*,-google-readability-casting,readability-*,bugprone-*,-bugprone-easily-swappable-parameters,cert-*,llvm-*,-llvm-header-guard,performance-*"
Checks: >
clang-diagnostic-*
clang-analyzer-*
google-*
-google-readability-casting
readability-*
-readability-identifier-length
bugprone-*
-bugprone-easily-swappable-parameters
cert-*
llvm-*
-llvm-header-guard
performance-*"
WarningsAsErrors: ""
HeaderFilterRegex: ""
FormatStyle: file
4 changes: 2 additions & 2 deletions ashura/engine/assets.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/// SPDX-License-Identifier: MIT
#pragma once
#include "ashura/engine/font.h"
Expand All @@ -18,7 +17,8 @@ typedef StrVecMap<Dyn<Font *>> FontMap;
struct AssetMap
{
explicit AssetMap(AllocatorImpl allocator) :
shaders{allocator}, fonts{allocator}
shaders{allocator},
fonts{allocator}
{
}

Expand Down
Loading

0 comments on commit 1989519

Please sign in to comment.