Skip to content

Commit

Permalink
Update .clang-format to comply with ROS coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-mueller committed Oct 27, 2024
1 parent 21b7395 commit 2dbef75
Showing 1 changed file with 61 additions and 20 deletions.
81 changes: 61 additions & 20 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,24 +1,65 @@
Language: Cpp
# From https://github.com/PickNikRobotics/roscpp_code_format

---
BasedOnStyle: Google
IndentWidth: 4
MaxEmptyLinesToKeep: 1
AccessModifierOffset: -2
ConstructorInitializerIndentWidth: 2
AlignEscapedNewlinesLeft: false
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AlwaysBreakTemplateDeclarations: true
AlwaysBreakBeforeMultilineStrings: true
BreakBeforeBinaryOperators: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: true
BinPackParameters: true
ColumnLimit: 120
PenaltyBreakAssignment: 2
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
ConstructorInitializerAllOnOneLineOrOnePerLine: true
DerivePointerBinding: false
PointerBindsToType: true
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: true
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 60
PenaltyBreakString: 1
PenaltyBreakFirstLessLess: 1000
PenaltyExcessCharacter: 1000
PenaltyReturnTypeOnItsOwnLine: 90
SpacesBeforeTrailingComments: 2
Cpp11BracedListStyle: false
Standard: Auto
IndentWidth: 2
TabWidth: 2
UseTab: Never
IndentFunctionDeclarationAfterType: false
SpacesInParentheses: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterControlStatementKeyword: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
SortIncludes: false
SpaceAfterCStyleCast: false

# Configure each individual brace in BraceWrapping
BreakBeforeBraces: Custom

# Control of individual brace wrapping cases
BraceWrapping:
AfterClass: true
AfterFunction: true
AfterStruct: true
BeforeElse: true
BeforeWhile: true
SplitEmptyFunction: false
SplitEmptyNamespace: false
SplitEmptyRecord: false
BinPackArguments: false
BinPackParameters: false
AllowAllArgumentsOnNextLine: false
AllowShortIfStatementsOnASingleLine: true
AllowShortFunctionsOnASingleLine: true
AllowShortBlocksOnASingleLine: true
AfterClass: 'true'
AfterControlStatement: 'true'
AfterEnum : 'true'
AfterFunction : 'true'
AfterNamespace : 'true'
AfterStruct : 'true'
AfterUnion : 'true'
BeforeCatch : 'true'
BeforeElse : 'true'
IndentBraces : 'false'

0 comments on commit 2dbef75

Please sign in to comment.