-
Notifications
You must be signed in to change notification settings - Fork 5
/
.clang-tidy
79 lines (74 loc) · 3.99 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
# the checks with the hyphen prepended are disabled until they are fixed
# some like clang-analyzer-osx* should stay disabled as they are not relevant, to improve performance somewhat
Checks: 'bugprone-*,cert-*,clang-analyzer-*,concurrency-*,cppcoreguidelines-*,hicpp-*,misc-*,modernize-*,performance-*,portability-*,readability-*,
-clang-analyzer-osx*,
-clang-analyzer-optin.osx*,
-cppcoreguidelines-pro-type-cstyle-cast,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-pro-bounds-constant-array-index,
-readability-magic-numbers,
-readability-function-cognitive-complexity,
-readability-identifier-length,
-bugprone-easily-swappable-parameters,
-misc-non-private-member-variables-in-classes,
-hicpp-vararg,
-cppcoreguidelines-special-member-functions,
-hicpp-special-member-functions,
-cppcoreguidelines-pro-type-member-init,
-hicpp-member-init,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-misc-const-correctness,
-cppcoreguidelines-pro-type-const-cast,
-hicpp-signed-bitwise,
-cert-err58-cpp,
-hicpp-multiway-paths-covered,
-cert-dcl50-cpp,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-hicpp-no-array-decay,
-bugprone-narrowing-conversions,
-cppcoreguidelines-narrowing-conversions,
-cert-err33-c,
-concurrency-mt-unsafe,
-bugprone-branch-clone,
-cppcoreguidelines-pro-type-reinterpret-cast,
-cppcoreguidelines-avoid-c-arrays,
-hicpp-avoid-c-arrays,
-modernize-avoid-c-arrays,
-cppcoreguidelines-avoid-const-or-ref-data-members,
-misc-use-anonymous-namespace,
-cppcoreguidelines-avoid-do-while,
-hicpp-explicit-conversions,
-misc-unused-parameters,
-modernize-use-trailing-return-type,
-readability-qualified-auto,
-readability-redundant-string-cstr,
-readability-non-const-parameter,
-performance-unnecessary-value-param,
-cppcoreguidelines-prefer-member-initializer,
-readability-implicit-bool-conversion,
-performance-inefficient-vector-operation,
-readability-else-after-return,
-bugprone-exception-escape,
'
# todo, clang-analyzer-core.NullDereference is also suppressed in the code itself with NOLINT, consider fixing that too
# todo these can all be fixed automatically but that needs to be done with caution
# hicpp-explicit-conversions, misc-unused-parameter,modernize-use-trailing-return-type,readability-qualified-auto,readability-redundant-string-cstr,
# readability-non-const-parameter,performance-unnecessary-value-param,cppcoreguidelines-prefer-member-initializer,readability-implicit-bool-conversion
# performance-inefficient-vector-operation,readability-else-after-return
CheckOptions:
# we don't want these to be passed by reference, even if (especially for shared_ptrs) it incurs a much greater cost
# since we either we use c apis like pipewire which clang-tidy/c++ cannot reason about (NodeInfo, LinkInfo, DeviceInfo),
# or we depend on shared_ptrs to work across multiple threads, notably when the caller finishes before the callee
performance-unnecessary-value-param.AllowedTypes: 'NodeInfo; LinkInfo; DeviceInfo; std::shared_ptr'
# note some checks are disabled in the code itself by adding NOLINT(check-name) or NOLINTNEXTLINE(check-name)
# treat clang diagnostic warnings (aka compiler warnings) as errors, to ensure CI fails on these warnings
# note we can't completely suppress warnings like can be done for other checks above, they will always be outputted
# these can however be suppressed by disabling the compiler warnings in meson, but that is not really what we want
# we cannot ignore clang-diagnostic-error, which are just compilation errors, which will occur when using clang < 16 (clang-tidy always wants clang for compilation it seems)
WarningsAsErrors: '*'
# set this to the include directory specifically, not '.*' since we don't want generated files like config.h being scanned
HeaderFilterRegex: './include/'