-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.clang-tidy
More file actions
165 lines (134 loc) · 5.1 KB
/
Copy path.clang-tidy
File metadata and controls
165 lines (134 loc) · 5.1 KB
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
---
# RIT Launch Initiative FSW clang-tidy configuration
# This configuration enforces the project's coding standards
Checks: >
-*,
bugprone-*,
clang-analyzer-*,
cppcoreguidelines-*,
modernize-*,
performance-*,
portability-*,
-portability-avoid-pragma-once,
readability-*,
-modernize-use-trailing-return-type,
-readability-identifier-length,
-cppcoreguidelines-avoid-magic-numbers,
-readability-magic-numbers,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-avoid-c-arrays,
-modernize-avoid-c-arrays,
-readability-avoid-const-params-in-decls,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-no-malloc,
-cppcoreguidelines-pro-type-reinterpret-cast,
-cppcoreguidelines-init-variables,
-cppcoreguidelines-avoid-non-const-global-variables,
-modernize-use-auto,
-readability-implicit-bool-conversion,
-cppcoreguidelines-pro-type-union-access,
-readability-braces-around-statements,
-readability-else-after-return
WarningsAsErrors: ''
HeaderFilterRegex: '.*'
CheckOptions:
# Naming conventions
# Classes must start with 'C'
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.ClassPrefix
value: 'C'
# Structs must start with 'C' (treated like classes in C++)
- key: readability-identifier-naming.StructCase
value: CamelCase
- key: readability-identifier-naming.StructPrefix
value: 'C'
# Namespaces must start with 'N'
- key: readability-identifier-naming.NamespaceCase
value: CamelCase
- key: readability-identifier-naming.NamespacePrefix
value: 'N'
# Public member functions: CamelCase with capitalized first letter
- key: readability-identifier-naming.PublicMethodCase
value: CamelCase
# Private member functions: camelBack (first letter lowercase)
- key: readability-identifier-naming.PrivateMethodCase
value: camelBack
# Protected member functions: camelBack (first letter lowercase)
- key: readability-identifier-naming.ProtectedMethodCase
value: camelBack
# Member variables: camelBack
- key: readability-identifier-naming.MemberCase
value: camelBack
# Private member variables: camelBack
- key: readability-identifier-naming.PrivateMemberCase
value: camelBack
# Public member variables: camelBack
- key: readability-identifier-naming.PublicMemberCase
value: camelBack
# Protected member variables: camelBack
- key: readability-identifier-naming.ProtectedMemberCase
value: camelBack
# Parameters: camelBack
- key: readability-identifier-naming.ParameterCase
value: camelBack
# Local variables: camelBack
- key: readability-identifier-naming.LocalVariableCase
value: camelBack
# Global variables: camelBack
- key: readability-identifier-naming.GlobalVariableCase
value: camelBack
# Constants: CamelCase or UPPER_CASE both acceptable
- key: readability-identifier-naming.ConstantCase
value: aNy_CasE
# Enums: CamelCase
- key: readability-identifier-naming.EnumCase
value: CamelCase
# Enum constants: CamelCase
- key: readability-identifier-naming.EnumConstantCase
value: CamelCase
# Template parameters: CamelCase
- key: readability-identifier-naming.TemplateParameterCase
value: CamelCase
# Type aliases and typedefs: CamelCase
- key: readability-identifier-naming.TypedefCase
value: CamelCase
- key: readability-identifier-naming.TypeAliasCase
value: CamelCase
# Functions (C style with underscores is allowed for Zephyr compatibility)
- key: readability-identifier-naming.FunctionCase
value: aNy_CasE
# Line length (enforced by clang-format, but mentioned here for completeness)
# Maximum line length is 120 characters (configured in .clang-format)
# Brace wrapping and indentation
# 4 space indents - configured in .clang-format
# Opening braces on same line - configured in .clang-format
# Include sorting
# Alphabetized includes with grouping - configured in .clang-format
# Readability options
- key: readability-braces-around-statements.ShortStatementLines
value: '0'
- key: readability-function-cognitive-complexity.Threshold
value: '50'
- key: readability-function-size.LineThreshold
value: '200'
- key: readability-function-size.StatementThreshold
value: '150'
# Modern C++ features
- key: modernize-use-nullptr.NullMacros
value: 'NULL'
# Performance
- key: performance-move-const-arg.CheckTriviallyCopyableMove
value: 'true'
# Ignore certain patterns for C functions from Zephyr
# C functions with underscores (k_*, z_*, etc.) are explicitly allowed
- key: readability-identifier-naming.FunctionIgnoredRegexp
value: '^(k_|z_|sys_|device_|gpio_|uart_|spi_|i2c_|LOG_|sntp_|.*_init|.*_setup|.*_handler).*'
# Ignore certain variable patterns for compatibility
- key: readability-identifier-naming.LocalVariableIgnoredRegexp
value: '^(k_|z_|sys_|ts|rc|rv|fd)$'
- key: readability-identifier-naming.ParameterIgnoredRegexp
value: '^(k_|z_|sys_|_).*'
...