-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.clang-tidy
More file actions
113 lines (107 loc) · 3.99 KB
/
.clang-tidy
File metadata and controls
113 lines (107 loc) · 3.99 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
# micro-decoder clang-tidy configuration
# C++17, embedded-friendly checks
Checks: >
-*,
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-narrowing-conversions,
clang-analyzer-*,
-clang-analyzer-cplusplus.NewDeleteLeaks,
cppcoreguidelines-init-variables,
cppcoreguidelines-prefer-member-initializer,
cppcoreguidelines-pro-type-member-init,
cppcoreguidelines-slicing,
misc-definitions-in-headers,
misc-redundant-expression,
misc-unused-parameters,
modernize-deprecated-headers,
modernize-loop-convert,
modernize-make-unique,
modernize-redundant-void-arg,
modernize-use-bool-literals,
modernize-use-default-member-init,
modernize-use-emplace,
modernize-use-nullptr,
modernize-use-override,
performance-*,
-performance-no-int-to-ptr,
readability-avoid-const-params-in-decls,
readability-braces-around-statements,
readability-const-return-type,
readability-container-size-empty,
readability-delete-null-pointer,
readability-duplicate-include,
readability-else-after-return,
readability-identifier-naming,
readability-implicit-bool-conversion,
readability-inconsistent-declaration-parameter-name,
readability-magic-numbers,
readability-make-member-function-const,
readability-misplaced-array-index,
readability-non-const-parameter,
readability-redundant-control-flow,
readability-redundant-declaration,
readability-redundant-preprocessor,
readability-redundant-smartptr-get,
readability-redundant-string-cstr,
readability-redundant-string-init,
readability-simplify-boolean-expr,
readability-simplify-subscript-expr,
readability-static-accessed-through-instance,
readability-static-definition-in-anonymous-namespace,
readability-string-compare,
readability-uppercase-literal-suffix
WarningsAsErrors: '*'
HeaderFilterRegex: '(include/micro_decoder|src)/.*\.h$'
CheckOptions:
# Naming conventions matching existing code style
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.StructCase
value: CamelCase
- key: readability-identifier-naming.EnumCase
value: CamelCase
- key: readability-identifier-naming.EnumConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.FunctionCase
value: lower_case
- key: readability-identifier-naming.MethodCase
value: lower_case
- key: readability-identifier-naming.PrivateMethodCase
value: lower_case
- key: readability-identifier-naming.PrivateMethodSuffix
value: ''
- key: readability-identifier-naming.ParameterCase
value: lower_case
- key: readability-identifier-naming.VariableCase
value: lower_case
- key: readability-identifier-naming.PrivateMemberCase
value: lower_case
- key: readability-identifier-naming.PrivateMemberSuffix
value: '_'
- key: readability-identifier-naming.ConstantCase
value: lower_case
- key: readability-identifier-naming.ConstexprVariableCase
value: UPPER_CASE
- key: readability-identifier-naming.GlobalConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.StaticConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.NamespaceCase
value: lower_case
- key: readability-identifier-naming.MacroDefinitionCase
value: UPPER_CASE
# Magic numbers - allow common values used in bit manipulation and byte handling
# Includes: small indices (0-7), bit shifts (8,16,24,32,40,48,56), byte values (255,256)
- key: readability-magic-numbers.IgnoredIntegerValues
value: '0;1;2;3;4;5;6;7;8;16;24;32;40;48;56;64;128;255;256'
- key: readability-magic-numbers.IgnorePowersOf2IntegerValues
value: 'true'
- key: readability-magic-numbers.IgnoreAllFloatingPointValues
value: 'true'
# Implicit bool conversion - allow for pointers and integers (common C++ idioms)
# Bitfield checks like `if (flags & FLAG)` are idiomatic and readable
- key: readability-implicit-bool-conversion.AllowPointerConditions
value: 'true'
- key: readability-implicit-bool-conversion.AllowIntegerConditions
value: 'true'