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
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
IndentGotoLabels: true
IndentPPDirectives: BeforeHash
IndentCaseLabels: false
# Alignment checks
AlignAfterOpenBracket: false
@@ -70,6 +73,9 @@ BraceWrapping:
# Don't break before ?:, it looks ugly
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
BreakAfterAttributes: Leave
# Trim empty lines when there are more than 1
MaxEmptyLinesToKeep: 2
@@ -89,7 +95,12 @@ SpaceAfterTemplateKeyword: true
# Put spaces before \.?\= operators, initializer {lists}, inline (parentheses), // comments.
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: true
SpaceBeforeParens: Always
SpaceBeforeParens: Custom
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterFunctionDeclarationName: true
AfterFunctionDefinitionName: true
AfterOverloadedOperator: true
SpacesBeforeTrailingComments: 1
SpacesInLineCommentPrefix:
Minimum: 1
@@ -97,6 +108,7 @@ SpacesInLineCommentPrefix:
# for (auto& loops : range), conditional ( statements ), ( parentheses ), [ brackets ]
SpaceBeforeCaseColon: false
SpaceBeforeInheritanceColon: false
SpaceBeforeCtorInitializerColon: false
SpaceBeforeRangeBasedForLoopColon: false
SpacesInConditionalStatement: false
SpacesInParentheses: false
+2 -1
View File
@@ -11,7 +11,8 @@ namespace panic {
public:
// std::stacktrace stack;
std::string message;
Panic (std::string message) : message (message) {
Panic (std::string message):
message(message) {
// stack = std::stacktrace::current();
}
+6 -3
View File
@@ -230,7 +230,8 @@ mod slice {
T *head;
T *tail;
Iter (T *head, T *tail) : head (head),
Iter (T *head, T *tail):
head(head),
tail(tail) {}
public:
@@ -273,10 +274,12 @@ mod vec {
T *tail;
public:
Drain () : allocation (nullptr),
Drain ():
allocation(nullptr),
head(nullptr),
tail(nullptr) {}
Drain (T *allocation, usize len) : allocation (allocation),
Drain (T *allocation, usize len):
allocation(allocation),
head(allocation),
tail(allocation + len) {}
~Drain () {