-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.clang-tidy
More file actions
155 lines (145 loc) · 7 KB
/
.clang-tidy
File metadata and controls
155 lines (145 loc) · 7 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
HeaderFilterRegex: "include/num_collect/|test/"
Checks: >
clang-diagnostic-*,
-clang-diagnostic-unknown-pragmas,
clang-analyzer-*,
-clang-analyzer-core.UndefinedBinaryOperatorResult,
-clang-analyzer-optin.performance.Padding,
cppcoreguidelines-*,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-avoid-const-or-ref-data-members,
-cppcoreguidelines-missing-std-forward,
-cppcoreguidelines-avoid-do-while,
-cppcoreguidelines-c-copy-assignment-signature,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-macro-to-enum,
google-*,
-google-runtime-references,
-google-readability-todo,
performance-*,
portability-*,
-portability-template-virtual-member-function,
readability-*,
readability-identifier-naming,
-readability-identifier-length,
-readability-function-cognitive-complexity,
-readability-suspicious-call-argument,
-readability-avoid-unconditional-preprocessor-if,
-readability-redundant-member-init,
-readability-math-missing-parentheses,
-readability-simplify-boolean-expr,
-readability-magic-numbers,
-readability-qualified-auto,
modernize-*,
-modernize-pass-by-value,
-modernize-return-braced-init-list,
-modernize-concat-nested-namespaces,
-modernize-use-std-numbers,
-modernize-use-constraints,
-modernize-use-auto,
-modernize-macro-to-enum,
hicpp-*,
-hicpp-use-auto,
cert-*,
-cert-err58-cpp,
-cert-msc51-cpp,
-cert-msc32-c,
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-exception-escape,
-bugprone-unchecked-optional-access,
-bugprone-chained-comparison,
-bugprone-optional-value-conversion,
-bugprone-crtp-constructor-accessibility,
-bugprone-misplaced-widening-cast,
-bugprone-suspicious-include,
concurrency-*,
-boost-*,
openmp-*,
-openmp-use-default-none,
-openmp-exception-escape,
# Ignored checks:
#
# - google-runtime-references is a Google-specific rule, and forces use of raw pointers.
# - modernize-pass-by-value causes some programs to crash when applied to Eigen's objects
# (https://eigen.tuxfamily.org/dox/group__TopicPassingByValue.html).
# - clang-analyzer-core.UndefinedBinaryOperatorResult cause warnings for Eigen.
# - clang-analyzer-optin.performance.Padding is hard to be fixed.
# - readability-function-cognitive-complexity is hard to be fixed in tests.
# - cppcoreguidelines-owning-memory forces to use an external library.
# - cppcoreguidelines-pro-bounds-constant-array-index forces to use an external library.
# - bugprone-easily-swappable-parameters, readability-suspicious-call-argument is difficult to fix.
# - cert-err58-cpp produces warnings in all tests due to Catch2 library.
# - cppcoreguidelines-avoid-non-const-global-variables produces warnings in all tests due to Catch2 library.
# - readability-identifier-length prevent traditional codes.
# - openmp-use-default-none cannot be fixed when class members are used as usual in object-oriented programming.
# - bugprone-exception-escape has a bug.
# - bugprone-unchecked-optional-access complains even when std::optional::value function is used and has a bug as in https://github.com/clangd/clangd/issues/1700.
# - cppcoreguidelines-avoid-const-or-ref-data-members prevents expression templates.
# - readability-avoid-unconditional-preprocessor-if generates warnings to automatically generated files which cannot be fixed.
# - cppcoreguidelines-missing-std-forward cannot be fixed sometimes.
# - modernize-concat-nested-namespaces, modernize-use-constraints will be fixed later.
# - clang-diagnostic-unknown-pragmas generates false positives for "#pragma omp" even with flags for OpenMP.
# - bugprone-chained-comparison prevents use of my assertion macro.
# - readability-redundant-member-init generates too many warnings in existing codes.
# - modernize-use-std-numbers generates many false positives.
# - bugprone-optional-value-conversion has a bug to generate warnings even when checks of existence of values exist.
# - cppcoreguidelines-avoid-do-while has a bug to ignore NOLINT.
# - readability-math-missing-parentheses generates too many warnings in existing codes.
# - bugprone-crtp-constructor-accessibility generates too many warnings in existing codes.
# - hicpp-use-auto, modernize-use-auto should not be fixed in source codes using Eigen library.
# - cppcoreguidelines-c-copy-assignment-signature generates false positives.
# - cppcoreguidelines-pro-bounds-pointer-arithmetic prevents implementation of containers and use of arguments of main functions.
# - readability-simplify-boolean-expr generates unfixable warnings in assertion macros.
# - openmp-exception-escape is generating warnings for rare cases that cannot be tested.
# - bugprone-misplaced-widening-cast generates false positives.
# - cppcoreguidelines-macro-to-enum, modernize-macro-to-enum, cppcoreguidelines-macro-usage generates false positives in this project.
# - cppcoreguidelines-avoid-magic-numbers, readability-magic-numbers resulted in too many NOLINT comments in this project.
# - bugprone-suspicious-include generates warnings in unity builds.
# - readability-qualified-auto make source codes less changeable.
# - cert-msc51-cpp, cert-msc32-c are disabled because reproducibility is important in this project.
CheckOptions:
# Naming Conventions
# for these parameters of the naming convention,
# see https://clang.llvm.org/extra/clang-tidy/checks/readability/identifier-naming.html
- key: readability-identifier-naming.NamespaceCase
value: lower_case
- key: readability-identifier-naming.ClassCase
value: lower_case
- key: readability-identifier-naming.StructCase
value: lower_case
- key: readability-identifier-naming.EnumCase
value: lower_case
- key: readability-identifier-naming.FunctionCase
value: lower_case
- key: readability-identifier-naming.VariableCase
value: lower_case
- key: readability-identifier-naming.ConstantCase
value: lower_case
- key: readability-identifier-naming.ParameterCase
value: lower_case
- key: readability-identifier-naming.EnumConstantCase
value: lower_case
- key: readability-identifier-naming.MemberCase
value: lower_case
- key: readability-identifier-naming.PrivateMemberSuffix
value: _
- key: readability-identifier-naming.ProtectedMemberSuffix
value: _
- key: readability-identifier-naming.TypeTemplateParameterCase
value: CamelCase
- key: readability-identifier-naming.ValueTemplateParameterCase
value: CamelCase
- key: readability-identifier-naming.ConceptCase
value: lower_case
- key: readability-identifier-naming.MacroDefinitionCase
value: UPPER_CASE
# Workaround of https://github.com/llvm/llvm-project/issues/46097.
- key: readability-identifier-naming.TypeTemplateParameterIgnoredRegexp
value: expr-type
- key: modernize-use-trailing-return-type.TransformLambdas
value: none