-
Notifications
You must be signed in to change notification settings - Fork 104
Expand file tree
/
Copy path.clang-tidy
More file actions
executable file
·138 lines (134 loc) · 4.82 KB
/
Copy path.clang-tidy
File metadata and controls
executable file
·138 lines (134 loc) · 4.82 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
# CrispASR .clang-tidy
#
# Analogy to the Python stack:
# bugprone-* ≈ pylint error-level + mypy
# readability-* ≈ ruff/pylint convention
# modernize-* ≈ pyupgrade
# cert-* ≈ bandit
# cppcoreguidelines-* ≈ pylint + bandit combined
# performance-* ≈ (no direct Python analogue)
#
# Strategy: enable broad categories, then suppress checks that are either
# inappropriate for this codebase (C-interop with ggml) or too noisy to
# enforce in one pass. Add suppressed checks back incrementally.
Checks: >
-*,
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-narrowing-conversions,
cert-dcl50-cpp,
cert-dcl58-cpp,
cert-err34-c,
cert-err52-cpp,
cert-err60-cpp,
cert-flp30-c,
cert-msc50-cpp,
cert-msc51-cpp,
cppcoreguidelines-avoid-goto,
cppcoreguidelines-init-variables,
cppcoreguidelines-no-malloc,
cppcoreguidelines-prefer-member-initializer,
cppcoreguidelines-pro-type-cstyle-cast,
cppcoreguidelines-pro-type-static-downcast,
cppcoreguidelines-pro-type-union-access,
cppcoreguidelines-slicing,
modernize-avoid-bind,
modernize-loop-convert,
modernize-make-shared,
modernize-make-unique,
modernize-pass-by-value,
modernize-raw-string-literal,
modernize-redundant-void-arg,
modernize-replace-auto-ptr,
modernize-replace-disallow-copy-and-assign-macro,
modernize-replace-random-shuffle,
modernize-return-braced-init-list,
modernize-shrink-to-fit,
modernize-use-bool-literals,
modernize-use-default-member-init,
modernize-use-emplace,
modernize-use-equals-default,
modernize-use-equals-delete,
modernize-use-nodiscard,
modernize-use-noexcept,
modernize-use-nullptr,
modernize-use-override,
modernize-use-transparent-functors,
modernize-use-using,
performance-faster-string-find,
performance-for-range-copy,
performance-implicit-conversion-in-loop,
performance-inefficient-algorithm,
performance-inefficient-string-concatenation,
performance-inefficient-vector-operation,
performance-move-const-arg,
performance-move-constructor-init,
performance-no-automatic-move,
performance-noexcept-move-constructor,
performance-trivially-destructible,
performance-type-promotion-in-math-fn,
performance-unnecessary-copy-initialization,
performance-unnecessary-value-param,
readability-avoid-const-params-in-decls,
readability-braces-around-statements,
readability-const-return-type,
readability-container-size-empty,
readability-delete-null-pointer,
readability-else-after-return,
readability-identifier-naming,
readability-inconsistent-declaration-parameter-name,
readability-make-member-function-const,
readability-misleading-indentation,
readability-misplaced-array-index,
readability-named-parameter,
readability-non-const-parameter,
readability-qualified-auto,
readability-redundant-access-specifiers,
readability-redundant-control-flow,
readability-redundant-preprocessor,
readability-redundant-smartptr-get,
readability-simplify-boolean-expr,
readability-simplify-subscript-expr,
readability-static-accessed-through-instance,
readability-string-compare,
readability-uniqueptr-delete-release,
readability-use-anyofallof
WarningsAsErrors: "" # don't fail the build on tidy warnings; use as advisory
HeaderFilterRegex: '^(src|examples/cli)/(?!.*(miniaudio\.h|httplib\.h|json\.hpp|stb_vorbis\.c)).*\.h$'
# Options for specific checks
CheckOptions:
# Naming conventions — match what the codebase already uses.
- key: readability-identifier-naming.NamespaceCase
value: lower_case
- key: readability-identifier-naming.FunctionCase
value: lower_case
- key: readability-identifier-naming.VariableCase
value: lower_case
- key: readability-identifier-naming.MemberCase
value: lower_case
- key: readability-identifier-naming.ParameterCase
value: lower_case
- key: readability-identifier-naming.LocalVariableCase
value: lower_case
- key: readability-identifier-naming.StructCase
value: lower_case
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.EnumCase
value: lower_case
- key: readability-identifier-naming.EnumConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.MacroDefinitionCase
value: UPPER_CASE
- key: readability-identifier-naming.GlobalConstantCase
value: lower_case
- key: readability-identifier-naming.GlobalVariableCase
value: lower_case
- key: readability-identifier-naming.StaticVariableCase
value: lower_case
# modernize-pass-by-value: only suggest when the copy is cheap or already made
- key: modernize-pass-by-value.IncludeStyle
value: llvm
# performance-unnecessary-value-param: ignore when param is used by value intentionally
- key: performance-unnecessary-value-param.AllowedTypes
value: ""