Skip to content

Commit 07f1f79

Browse files
committed
style: standardize C++ and Python code formatting rules
- Consolidate .clang-format in repo root and remove redundant cpp/.clang-format - Configure clang-format with BlockIndent, IndentPPDirectives BeforeHash, and preserve include order - Add Ruff configuration for Python formatting and linting in pyproject.toml - Enable formatOnSave for C++ and Python in .vscode settings - Reformat entire C++ and Python codebase
1 parent 7ef71fc commit 07f1f79

104 files changed

Lines changed: 12090 additions & 12944 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-format

Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
Language: Cpp
33
# BasedOnStyle: Google
44
AccessModifierOffset: -2
5-
AlignAfterOpenBracket: Align
5+
AlignAfterOpenBracket: BlockIndent
66
AlignConsecutiveAssignments: false
77
AlignConsecutiveDeclarations: false
88
AlignEscapedNewlinesLeft: true
99
AlignOperands: true
1010
AlignTrailingComments: true
11-
AllowAllParametersOfDeclarationOnNextLine: true
11+
AllowAllArgumentsOnNextLine: false
12+
AllowAllParametersOfDeclarationOnNextLine: false
1213
AllowShortBlocksOnASingleLine: false
1314
AllowShortCaseLabelsOnASingleLine: false
1415
AllowShortFunctionsOnASingleLine: All
@@ -19,24 +20,12 @@ AlwaysBreakAfterReturnType: None
1920
AlwaysBreakBeforeMultilineStrings: true
2021
AlwaysBreakTemplateDeclarations: true
2122
BinPackArguments: true
22-
BinPackParameters: true
23-
BraceWrapping:
24-
AfterClass: false
25-
AfterControlStatement: false
26-
AfterEnum: false
27-
AfterFunction: false
28-
AfterNamespace: false
29-
AfterObjCDeclaration: false
30-
AfterStruct: false
31-
AfterUnion: false
32-
BeforeCatch: false
33-
BeforeElse: false
34-
IndentBraces: false
23+
BinPackParameters: false
3524
BreakBeforeBinaryOperators: None
36-
BreakBeforeBraces: Allman
25+
BreakBeforeBraces: Attach
3726
BreakBeforeTernaryOperators: true
3827
BreakConstructorInitializersBeforeComma: false
39-
ColumnLimit: 120
28+
ColumnLimit: 160
4029
CommentPragmas: '^ IWYU pragma:'
4130
ConstructorInitializerAllOnOneLineOrOnePerLine: true
4231
ConstructorInitializerIndentWidth: 4
@@ -46,20 +35,9 @@ DerivePointerAlignment: false
4635
DisableFormat: false
4736
ExperimentalAutoDetectBinPacking: false
4837
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
49-
SortIncludes: true
50-
IncludeBlocks: Regroup
51-
IncludeCategories:
52-
# Headers in <> without extension.
53-
- Regex: '<([A-Za-z0-9\Q/-_\E])+>'
54-
Priority: 3
55-
# Headers in <> with extension.
56-
- Regex: '<([A-Za-z0-9.\Q/-_\E])+>'
57-
Priority: 2
58-
# Headers in "" with extension.
59-
- Regex: '"([A-Za-z0-9.\Q/-_\E])+"'
60-
Priority: 1
61-
- Regex: '.*'
62-
Priority: 0
38+
IndentPPDirectives: BeforeHash
39+
SortIncludes: Never
40+
IncludeBlocks: Preserve
6341
IndentCaseLabels: true
6442
IndentWidth: 4
6543
IndentWrappedFunctionNames: false
@@ -71,7 +49,7 @@ NamespaceIndentation: None
7149
ObjCBlockIndentWidth: 2
7250
ObjCSpaceAfterProperty: false
7351
ObjCSpaceBeforeProtocolList: false
74-
PenaltyBreakBeforeFirstCallParameter: 1
52+
PenaltyBreakBeforeFirstCallParameter: 50
7553
PenaltyBreakComment: 300
7654
PenaltyBreakFirstLessLess: 120
7755
PenaltyBreakString: 1000

cpp/.clang-format

Lines changed: 0 additions & 96 deletions
This file was deleted.

0 commit comments

Comments
 (0)