-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.clang-tidy
116 lines (110 loc) · 4.27 KB
/
.clang-tidy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Modified version from: https://github.com/cpp-best-practices/cmake_template
---
Checks: "*,
-abseil-*,
-altera-*,
-android-*,
-fuchsia-*,
-google-*,
-llvm*,
-modernize-use-trailing-return-type,
-zircon-*,
-readability-else-after-return,
-readability-static-accessed-through-instance,
-readability-avoid-const-params-in-decls,
-cppcoreguidelines-non-private-member-variables-in-classes,
-misc-non-private-member-variables-in-classes,
-bugprone-easily-swappable-parameters"
# The bugprone-easily-swappable-parameters check is useful, but it often triggers when users define
# overload methods according to an external library API, which is beyond their control.
# Moreover, without named parameters in C++, solving this problem in some cases is challenging.
WarningsAsErrors: ""
HeaderFilterRegex: ""
FormatStyle: none
CheckOptions:
- key: readability-function-cognitive-complexity.IgnoreMacros
value: "true"
- key: readability-identifier-length.IgnoredVariableNames
value: "x|y|z"
- key: readability-identifier-length.IgnoredParameterNames
value: "x|y|z"
- key: readability-magic-numbers.IgnorePowersOf2IntegerValues
value: "true"
- key: cppcoreguidelines-avoid-magic-numbers.IgnorePowersOf2IntegerValues
value: "true"
############################################
# Naming conventions
############################################
# Based on guidelines from https://wiki.ros.org/CppStyleGuide
# Generic keys are used that together cover all of the
# recognizable identifiers and are sufficient to follow ROS guidelines
# To derive which keys are generic, following example was used:
# https://gist.github.com/KazNX/693761f2ee7881c120d209f04084e98a
# Those rules are not perfectly following naming conventions, as they
# cannot handle corner cases. However, enforcing consistency is much
# better than hoping for user to do it himself.
# For example, lambda expressions and other callables assigned to
# variables will be matched with snake_case (as all variables),
# while CamelCase (as all functions) would me much more intuitive
# Constants
- key: readability-identifier-naming.ClassConstantCase
value: "CamelCase"
- key: readability-identifier-naming.ClassConstantPrefix
value: "k"
- key: readability-identifier-naming.GlobalConstantCase
value: "CamelCase"
- key: readability-identifier-naming.GlobalConstantPrefix
value: "k"
- key: readability-identifier-naming.GlobalConstantPointerCase
value: "CamelCase"
- key: readability-identifier-naming.GlobalConstantPointerPrefix
value: "k"
- key: readability-identifier-naming.EnumConstantCase
value: "CamelCase"
- key: readability-identifier-naming.EnumConstantPrefix
value: "k"
# Functions
- key: readability-identifier-naming.FunctionCase
value: "CamelCase"
- key: readability-identifier-naming.ConstexprFunctionCase
value: "CamelCase"
- key: readability-identifier-naming.ConstexprFunctionPrefix
value: ""
# Macros
- key: readability-identifier-naming.MacroDefinitionCase
value: "UPPER_CASE"
# Namespaces
- key: readability-identifier-naming.NamespaceCase
value: "lower_case"
# Types
- key: readability-identifier-naming.ClassCase
value: "CamelCase"
- key: readability-identifier-naming.EnumCase
value: "CamelCase"
- key: readability-identifier-naming.TemplateParameterCase
value: "CamelCase"
- key: readability-identifier-naming.TypeAliasCase
value: "CamelCase"
- key: readability-identifier-naming.TypedefCase
value: "CamelCase"
- key: readability-identifier-naming.UnionCase
value: "CamelCase"
# Variables
- key: readability-identifier-naming.GlobalVariableCase
value: "lower_case"
- key: readability-identifier-naming.GlobalVariablePrefix
value: "g_"
- key: readability-identifier-naming.LocalConstantPointerCase
value: "lower_case"
- key: readability-identifier-naming.MemberCase
value: "lower_case"
- key: readability-identifier-naming.ClassMemberSuffix
value: "_"
- key: readability-identifier-naming.ProtectedMemberSuffix
value: "_"
- key: readability-identifier-naming.PrivateMemberSuffix
value: "_"
- key: readability-identifier-naming.ParameterCase
value: "lower_case"
- key: readability-identifier-naming.VariableCase
value: "lower_case"