Update .clang-format for my fickle tastes

This commit is contained in:
2025-07-12 05:01:06 -04:00
parent d0cef92631
commit 6bd0406df9
6 changed files with 107 additions and 91 deletions
+13 -1
View File
@@ -16,6 +16,9 @@ ColumnLimit: 0
IndentWidth: 4 IndentWidth: 4
ConstructorInitializerIndentWidth: 4 ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4 ContinuationIndentWidth: 4
IndentGotoLabels: true
IndentPPDirectives: BeforeHash
IndentCaseLabels: false
# Alignment checks # Alignment checks
AlignAfterOpenBracket: false AlignAfterOpenBracket: false
@@ -70,6 +73,9 @@ BraceWrapping:
# Don't break before ?:, it looks ugly # Don't break before ?:, it looks ugly
BreakBeforeTernaryOperators: false BreakBeforeTernaryOperators: false
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
BreakAfterAttributes: Leave
# Trim empty lines when there are more than 1 # Trim empty lines when there are more than 1
MaxEmptyLinesToKeep: 2 MaxEmptyLinesToKeep: 2
@@ -89,7 +95,12 @@ SpaceAfterTemplateKeyword: true
# Put spaces before \.?\= operators, initializer {lists}, inline (parentheses), // comments. # Put spaces before \.?\= operators, initializer {lists}, inline (parentheses), // comments.
SpaceBeforeAssignmentOperators: true SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: true SpaceBeforeCpp11BracedList: true
SpaceBeforeParens: Always SpaceBeforeParens: Custom
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterFunctionDeclarationName: true
AfterFunctionDefinitionName: true
AfterOverloadedOperator: true
SpacesBeforeTrailingComments: 1 SpacesBeforeTrailingComments: 1
SpacesInLineCommentPrefix: SpacesInLineCommentPrefix:
Minimum: 1 Minimum: 1
@@ -97,6 +108,7 @@ SpacesInLineCommentPrefix:
# for (auto& loops : range), conditional ( statements ), ( parentheses ), [ brackets ] # for (auto& loops : range), conditional ( statements ), ( parentheses ), [ brackets ]
SpaceBeforeCaseColon: false SpaceBeforeCaseColon: false
SpaceBeforeInheritanceColon: false SpaceBeforeInheritanceColon: false
SpaceBeforeCtorInitializerColon: false
SpaceBeforeRangeBasedForLoopColon: false SpaceBeforeRangeBasedForLoopColon: false
SpacesInConditionalStatement: false SpacesInConditionalStatement: false
SpacesInParentheses: false SpacesInParentheses: false
+2 -1
View File
@@ -11,7 +11,8 @@ namespace panic {
public: public:
// std::stacktrace stack; // std::stacktrace stack;
std::string message; std::string message;
Panic (std::string message) : message (message) { Panic (std::string message):
message(message) {
// stack = std::stacktrace::current(); // stack = std::stacktrace::current();
} }
+6 -3
View File
@@ -230,7 +230,8 @@ mod slice {
T *head; T *head;
T *tail; T *tail;
Iter (T *head, T *tail) : head (head), Iter (T *head, T *tail):
head(head),
tail(tail) {} tail(tail) {}
public: public:
@@ -273,10 +274,12 @@ mod vec {
T *tail; T *tail;
public: public:
Drain () : allocation (nullptr), Drain ():
allocation(nullptr),
head(nullptr), head(nullptr),
tail(nullptr) {} tail(nullptr) {}
Drain (T *allocation, usize len) : allocation (allocation), Drain (T *allocation, usize len):
allocation(allocation),
head(allocation), head(allocation),
tail(allocation + len) {} tail(allocation + len) {}
~Drain () { ~Drain () {