Skip to content

Commit 33680c7

Browse files
authored
refactor: update clang-tidy configuration for improved checks and error handling (#4811)
1 parent 04abbbc commit 33680c7

File tree

1 file changed

+45
-13
lines changed

1 file changed

+45
-13
lines changed

.clang-tidy

Lines changed: 45 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,48 @@
11
# refer to https://clang.llvm.org/extra/clang-tidy/checks/list.html
2+
#
3+
# Configure clang-tidy for this project.
4+
5+
# Here is an explanation for why some of the checks are disabled:
6+
#
7+
8+
Checks: >
9+
-*,
10+
bugprone-*,
11+
cert-*,
12+
clang-analyzer-*,
13+
concurrency-*,
14+
misc-*,
15+
modernize-*,
16+
performance-*,
17+
portability-*,
18+
readability-*,
19+
-bugprone-easily-swappable-parameters,
20+
-bugprone-macro-parentheses,
21+
-misc-unused-parameters,
22+
-readability-braces-around-statements,
23+
-readability-else-after-return,
24+
-readability-function-cognitive-complexity,
25+
-readability-identifier-length,
26+
-readability-isolate-declaration,
27+
-readability-magic-numbers,
28+
-readability-named-parameter,
29+
-readability-non-const-parameter,
30+
-readability-redundant-preprocessor,
31+
-readability-suspicious-call-argument,
32+
-readability-uppercase-literal-suffix
33+
34+
35+
# Turn all the warnings from the checks above into errors.
36+
WarningsAsErrors: "*"
37+
38+
# headers in the following directories will be checked:
39+
# - core/iwasm/
40+
# - core/shared/
41+
HeaderFilterRegex: '(core/iwasm/|core/shared/).*\\.h$'
42+
43+
# goto .clang-format at root directory to see the format style
44+
FormatStyle: file
245

3-
Checks: '-*, readability-identifier-naming, clang-analyzer-core.*,'
4-
WarningsAsErrors: '-*'
5-
HeaderFilterRegex: ''
6-
FormatStyle: file
7-
InheritParentConfig: false
8-
AnalyzeTemporaryDtors: false
9-
User: wamr
1046
CheckOptions:
11-
- key: readability-identifier-naming.VariableCase
12-
value: lower_case
13-
- key: readability-identifier-naming.ParameterCase
14-
value: lower_case
15-
- key: readability-identifier-naming.MacroDefinitionCase
16-
value: UPPER_CASE
47+
- { key: readability-identifier-naming.NamespaceCase, value: lower_case }
48+
- { key: readability-function-cognitive-complexity.Threshold, value: 100 }

0 commit comments

Comments
 (0)