clang-format#283
Merged
Merged
Conversation
Collaborator
|
I fiddled with it a bit in a745588, generating a format from the Mozilla format with a few tweaks that I prefer: @@ -75,7 +75,7 @@
AllowAllParametersOfDeclarationOnNextLine: false
AllowBreakBeforeNoexceptSpecifier: Never
AllowBreakBeforeQtProperty: false
-AllowShortBlocksOnASingleLine: Never
+AllowShortBlocksOnASingleLine: Always
AllowShortCaseExpressionOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false
AllowShortCompoundRequirementOnASingleLine: true
@@ -100,7 +100,7 @@
AfterControlStatement: Never
AfterEnum: true
AfterExternBlock: true
- AfterFunction: true
+ AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: true
@@ -117,20 +117,20 @@
BreakAfterAttributes: Leave
BreakAfterJavaFieldAnnotations: false
BreakAfterOpenBracketBracedList: false
-BreakAfterOpenBracketFunction: false
-BreakAfterOpenBracketIf: false
+BreakAfterOpenBracketFunction: true
+BreakAfterOpenBracketIf: true
BreakAfterOpenBracketLoop: false
BreakAfterOpenBracketSwitch: false
BreakAfterReturnType: TopLevel
BreakArrays: true
BreakBeforeBinaryOperators: None
-BreakBeforeCloseBracketBracedList: false
-BreakBeforeCloseBracketFunction: false
-BreakBeforeCloseBracketIf: false
+BreakBeforeCloseBracketBracedList: true
+BreakBeforeCloseBracketFunction: true
+BreakBeforeCloseBracketIf: true
BreakBeforeCloseBracketLoop: false
BreakBeforeCloseBracketSwitch: false
BreakBeforeConceptDeclarations: Always
-BreakBeforeBraces: Mozilla
+BreakBeforeBraces: Custom
BreakBeforeInlineASMColon: OnlyMultiline
BreakBeforeTemplateCloser: false
BreakBeforeTernaryOperators: true
@@ -140,11 +140,11 @@
BreakInheritanceList: BeforeComma
BreakStringLiterals: true
BreakTemplateDeclarations: Yes
-ColumnLimit: 80
+ColumnLimit: 88
CommentPragmas: "^ IWYU pragma:"
CompactNamespaces: false
-ConstructorInitializerIndentWidth: 2
-ContinuationIndentWidth: 2
+ConstructorInitializerIndentWidth: 4
+ContinuationIndentWidth: 4
Cpp11BracedListStyle: Block
DerivePointerAlignment: false
DisableFormat: false
@@ -169,7 +169,7 @@
Priority: 3
SortPriority: 0
CaseSensitive: false
- - Regex: '.*'
+ - Regex: ".*"
Priority: 1
SortPriority: 0
CaseSensitive: false
@@ -177,16 +177,16 @@
IncludeIsMainSourceRegex: ""
IndentAccessModifiers: false
IndentCaseBlocks: false
-IndentCaseLabels: true
+IndentCaseLabels: false
IndentExportBlock: true
IndentExternBlock: AfterExternBlock
IndentGotoLabels: true
IndentPPDirectives: None
IndentRequiresClause: true
-IndentWidth: 2
+IndentWidth: 4
IndentWrappedFunctionNames: false
-InsertBraces: false
-InsertNewlineAtEOF: false
+InsertBraces: true
+InsertNewlineAtEOF: true
InsertTrailingCommas: None
IntegerLiteralSeparator:
Binary: 0
@@ -221,7 +221,7 @@
Prefix: Leave
Suffix: Leave
ObjCBinPackProtocolList: Auto
-ObjCBlockIndentWidth: 2
+ObjCBlockIndentWidth: 4
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: false
@@ -307,7 +307,7 @@
- Q_UNUSED
- QT_REQUIRE_VERSION
TableGenBreakInsideDAGArg: DontBreak
-TabWidth: 8
+TabWidth: 4
UseTab: Never
VerilogBreakBetweenInstancePorts: true
WhitespaceSensitiveMacros:Basically:
Requires clang-format 22, but we're using a Docker image in What do you think? |
theory
requested changes
Jun 15, 2026
theory
left a comment
Collaborator
There was a problem hiding this comment.
I pushed my own biases; thoughts?
theory
approved these changes
Jun 15, 2026
theory
left a comment
Collaborator
There was a problem hiding this comment.
I like it like this at least.
Member
Author
|
lgtm, I was still trying to match pg_bsd_ident as much as I could, but this is more my preference too |
Co-authored-by: David E. Wheeler <david.wheeler@clickhouse.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
alternative to #278
went with clang 19 because that's what Debian 13 ships
108 column width because on a 13 inch laptop I fit 280 columns & I like 108 as a number