Skip to content

Commit 5626796

Browse files
committed
Add custom clang-format, re-format all code
1 parent 6c31731 commit 5626796

File tree

7 files changed

+657
-522
lines changed

7 files changed

+657
-522
lines changed

puma_motor_driver/.clang-format

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
BasedOnStyle: Google
3+
AccessModifierOffset: -2
4+
ConstructorInitializerIndentWidth: 2
5+
AlignEscapedNewlinesLeft: false
6+
AlignTrailingComments: true
7+
AllowAllParametersOfDeclarationOnNextLine: false
8+
AllowShortIfStatementsOnASingleLine: false
9+
AllowShortLoopsOnASingleLine: false
10+
AllowShortFunctionsOnASingleLine: None
11+
AlwaysBreakTemplateDeclarations: true
12+
AlwaysBreakBeforeMultilineStrings: true
13+
BreakBeforeBinaryOperators: false
14+
BreakBeforeTernaryOperators: false
15+
BreakConstructorInitializersBeforeComma: true
16+
BinPackParameters: true
17+
ColumnLimit: 120
18+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
19+
DerivePointerBinding: false
20+
PointerBindsToType: true
21+
ExperimentalAutoDetectBinPacking: false
22+
IndentCaseLabels: true
23+
MaxEmptyLinesToKeep: 1
24+
NamespaceIndentation: None
25+
ObjCSpaceBeforeProtocolList: true
26+
PenaltyBreakBeforeFirstCallParameter: 19
27+
PenaltyBreakComment: 60
28+
PenaltyBreakString: 1
29+
PenaltyBreakFirstLessLess: 1000
30+
PenaltyExcessCharacter: 1000
31+
PenaltyReturnTypeOnItsOwnLine: 90
32+
SpacesBeforeTrailingComments: 2
33+
Cpp11BracedListStyle: false
34+
Standard: Auto
35+
IndentWidth: 2
36+
TabWidth: 2
37+
UseTab: Never
38+
IndentFunctionDeclarationAfterType: false
39+
SpacesInParentheses: false
40+
SpacesInAngles: false
41+
SpaceInEmptyParentheses: false
42+
SpacesInCStyleCastParentheses: false
43+
SpaceAfterControlStatementKeyword: true
44+
SpaceBeforeAssignmentOperators: true
45+
ContinuationIndentWidth: 4
46+
SortIncludes: false
47+
SpaceAfterCStyleCast: false
48+
49+
# Configure each individual brace in BraceWrapping
50+
BreakBeforeBraces: Custom
51+
52+
# Control of individual brace wrapping cases
53+
BraceWrapping:
54+
AfterClass: 'true'
55+
AfterControlStatement: 'true'
56+
AfterEnum : 'true'
57+
AfterFunction : 'true'
58+
AfterNamespace : 'true'
59+
AfterStruct : 'true'
60+
AfterUnion : 'true'
61+
BeforeCatch : 'true'
62+
BeforeElse : 'true'
63+
IndentBraces : 'false'

puma_motor_driver/CMakeLists.txt

+6-7
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,12 @@ install(TARGETS multi_puma_node
4242

4343
if(BUILD_TESTING)
4444
find_package(ament_lint_auto REQUIRED)
45-
# the following line skips the linter which checks for copyrights
46-
# comment the line when a copyright and license is added to all source files
47-
set(ament_cmake_copyright_FOUND TRUE)
48-
# the following line skips cpplint (only works in a git repo)
49-
# comment the line when this package is in a git repo and when
50-
# a copyright and license is added to all source files
51-
set(ament_cmake_cpplint_FOUND TRUE)
45+
list(APPEND AMENT_LINT_AUTO_EXCLUDE
46+
ament_cmake_copyright
47+
ament_cmake_cpplint
48+
ament_cmake_uncrustify
49+
)
50+
set(ament_cmake_clang_format_CONFIG_FILE .clang-format)
5251
ament_lint_auto_find_test_dependencies()
5352
endif()
5453

0 commit comments

Comments
 (0)