wasm-micro-runtime/.clang-tidy
2026-03-25 14:53:51 +02:00

60 lines
1.9 KiB
YAML

# refer to https://clang.llvm.org/extra/clang-tidy/checks/list.html
#
# Configure clang-tidy for this project.
# Here is an explanation for why some of the checks are disabled:
#
# -misc-include-cleaner: too noisy with platform abstraction headers
# -bugprone-easily-swappable-parameters: most C APIs have consecutive same-type params
# -bugprone-macro-parentheses: WAMR macros intentionally use unparenthesized args
# -misc-no-recursion: interpreter/validator use intentional recursion
# -readability-magic-numbers: wasm spec constants (opcodes, limits) are ubiquitous
#
Checks: >
-*,
bugprone-*,
cert-*,
clang-analyzer-*,
concurrency-*,
cppcoreguidelines-init-variables,
cppcoreguidelines-narrowing-conversions,
cppcoreguidelines-pro-type-cstyle-cast,
misc-*,
modernize-*,
performance-*,
portability-*,
readability-*,
-bugprone-easily-swappable-parameters,
-bugprone-macro-parentheses,
-misc-include-cleaner,
-misc-no-recursion,
-misc-unused-parameters,
-readability-braces-around-statements,
-readability-else-after-return,
-readability-function-cognitive-complexity,
-readability-identifier-length,
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-named-parameter,
-readability-non-const-parameter,
-readability-redundant-preprocessor,
-readability-suspicious-call-argument,
-readability-uppercase-literal-suffix
# Turn all the warnings from the checks above into errors.
WarningsAsErrors: "*"
# headers in the following directories will be checked:
# - core/iwasm/
# - core/shared/
HeaderFilterRegex: '(core/iwasm/|core/shared/).*\\.h$'
# goto .clang-format at root directory to see the format style
FormatStyle: file
CheckOptions:
- { key: readability-identifier-naming.NamespaceCase, value: lower_case }
- { key: readability-function-cognitive-complexity.Threshold, value: 100 }