Last active
July 29, 2021 06:37
-
-
Save Astro36/ef933be73050b4d5a6e0522536723a18 to your computer and use it in GitHub Desktop.
Rust-like Clang-Format Style
This file contains 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
# https://gist.github.com/Astro36/ef933be73050b4d5a6e0522536723a18 | |
AccessModifierOffset: -4 | |
AlignAfterOpenBracket: Align | |
AlignConsecutiveAssignments: false | |
AlignConsecutiveDeclarations: false | |
# AlignConsecutiveMacros: false | |
AlignEscapedNewlines: DontAlign | |
AlignOperands: true | |
AlignTrailingComments: false | |
# AllowAllArgumentsOnNextLine: false | |
# AllowAllConstructorInitializersOnNextLine: false | |
AllowAllParametersOfDeclarationOnNextLine: false | |
# AllowShortBlocksOnASingleLine: Empty | |
AllowShortCaseLabelsOnASingleLine: false | |
AllowShortFunctionsOnASingleLine: Empty | |
# AllowShortIfStatementsOnASingleLine: Always | |
# AllowShortLambdasOnASingleLine: All | |
AllowShortLoopsOnASingleLine: true | |
AlwaysBreakAfterReturnType: None | |
AlwaysBreakBeforeMultilineStrings: false | |
# AlwaysBreakTemplateDeclarations: Yes | |
BinPackArguments: true | |
BinPackParameters: true | |
BreakBeforeBinaryOperators: NonAssignment | |
BreakBeforeBraces: Attach | |
BreakBeforeTernaryOperators: true | |
BreakConstructorInitializers: BeforeColon | |
# BreakInheritanceList: BeforeColon | |
BreakStringLiterals: false | |
ColumnLimit: 0 | |
CompactNamespaces: false | |
ConstructorInitializerAllOnOneLineOrOnePerLine: false | |
ConstructorInitializerIndentWidth: 0 | |
ContinuationIndentWidth: 4 | |
Cpp11BracedListStyle: false | |
DerivePointerAlignment: false | |
ExperimentalAutoDetectBinPacking: false | |
FixNamespaceComments: true | |
IncludeBlocks: Merge | |
IncludeCategories: | |
- Regex: '^<.*\.h>' | |
Priority: 1 | |
- Regex: '^<.*' | |
Priority: 2 | |
- Regex: '.*' | |
Priority: 3 | |
IndentCaseLabels: false | |
# IndentGotoLabels: false | |
IndentPPDirectives: AfterHash | |
IndentWidth: 4 | |
IndentWrappedFunctionNames: true | |
KeepEmptyLinesAtTheStartOfBlocks: false | |
MaxEmptyLinesToKeep: 1 | |
NamespaceIndentation: All | |
PointerAlignment: Left | |
SortIncludes: true | |
SortUsingDeclarations: true | |
SpaceAfterCStyleCast: true | |
# SpaceAfterLogicalNot: false | |
SpaceAfterTemplateKeyword: false | |
SpaceBeforeAssignmentOperators: true | |
# SpaceBeforeCpp11BracedList: true | |
# SpaceBeforeCtorInitializerColon: false | |
# SpaceBeforeInheritanceColon: false | |
SpaceBeforeParens: ControlStatements | |
# SpaceBeforeRangeBasedForLoopColon: true | |
# SpaceInEmptyBlock: false | |
SpaceInEmptyParentheses: false | |
SpacesBeforeTrailingComments: 1 | |
SpacesInAngles: false | |
SpacesInCStyleCastParentheses: false | |
SpacesInContainerLiterals: false | |
SpacesInParentheses: false | |
SpacesInSquareBrackets: false | |
# Standard: Latest | |
UseTab: Never |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wrote another
.clang-format
that seems to match Rust style more closely:https://gist.github.com/YodaEmbedding/c2c77dc693d11f3734d78489f9a6eea4