2026-07-27 01:10:58 +08:00
|
|
|
# ── ViewDesignEngine clang-tidy 配置 ──────────────────────────────
|
|
|
|
|
# C++17 CAD 几何引擎静态分析规则集
|
|
|
|
|
#
|
|
|
|
|
# 校验要求:
|
|
|
|
|
# Checks: clang-tidy-14 / clang-tidy-18
|
|
|
|
|
# FormatStyle: file (.clang-format 优先)
|
|
|
|
|
# HeaderFilterRegex: 只分析项目头文件,不检查 Eigen/GTest 等第三方头文件
|
|
|
|
|
# WarningsAsErrors: 'bugprone-*,cert-*,misc-use-after-move,performance-*'
|
|
|
|
|
|
2026-07-23 05:27:51 +00:00
|
|
|
Checks: >
|
|
|
|
|
-*,
|
|
|
|
|
bugprone-*,
|
2026-07-27 01:10:58 +08:00
|
|
|
-bugprone-easily-swappable-parameters,
|
|
|
|
|
-bugprone-narrowing-conversions,
|
2026-07-23 05:27:51 +00:00
|
|
|
cert-*,
|
2026-07-27 01:10:58 +08:00
|
|
|
-cert-err58-cpp,
|
2026-07-23 05:27:51 +00:00
|
|
|
clang-analyzer-*,
|
|
|
|
|
cppcoreguidelines-*,
|
|
|
|
|
-cppcoreguidelines-avoid-magic-numbers,
|
|
|
|
|
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
|
2026-07-27 01:10:58 +08:00
|
|
|
-cppcoreguidelines-pro-type-vararg,
|
|
|
|
|
-cppcoreguidelines-pro-type-reinterpret-cast,
|
2026-07-23 05:27:51 +00:00
|
|
|
-cppcoreguidelines-owning-memory,
|
|
|
|
|
google-*,
|
|
|
|
|
-google-readability-todo,
|
2026-07-27 01:10:58 +08:00
|
|
|
-google-runtime-references,
|
2026-07-23 05:27:51 +00:00
|
|
|
misc-*,
|
2026-07-27 01:10:58 +08:00
|
|
|
-misc-include-cleaner,
|
2026-07-23 05:27:51 +00:00
|
|
|
-misc-non-private-member-variables-in-classes,
|
2026-07-27 01:10:58 +08:00
|
|
|
-misc-no-recursion,
|
2026-07-23 05:27:51 +00:00
|
|
|
modernize-*,
|
|
|
|
|
-modernize-use-trailing-return-type,
|
2026-07-27 01:10:58 +08:00
|
|
|
-modernize-use-nodiscard,
|
2026-07-23 05:27:51 +00:00
|
|
|
performance-*,
|
|
|
|
|
portability-*,
|
|
|
|
|
readability-*,
|
|
|
|
|
-readability-magic-numbers,
|
2026-07-27 01:10:58 +08:00
|
|
|
-readability-identifier-length,
|
|
|
|
|
-readability-function-cognitive-complexity,
|
|
|
|
|
-readability-isolate-declaration,
|
|
|
|
|
|
|
|
|
|
WarningsAsErrors: >
|
|
|
|
|
bugprone-*,
|
|
|
|
|
-bugprone-easily-swappable-parameters,
|
|
|
|
|
-bugprone-narrowing-conversions,
|
|
|
|
|
cert-*,
|
|
|
|
|
clang-analyzer-*,
|
|
|
|
|
performance-*,
|
|
|
|
|
|
|
|
|
|
HeaderFilterRegex: 'include/vde/.*\.h$'
|
|
|
|
|
|
|
|
|
|
FormatStyle: file
|
2026-07-23 05:27:51 +00:00
|
|
|
|
|
|
|
|
CheckOptions:
|
2026-07-27 01:10:58 +08:00
|
|
|
# ── 命名约定 ──
|
2026-07-23 05:27:51 +00:00
|
|
|
- key: readability-identifier-naming.ClassCase
|
|
|
|
|
value: CamelCase
|
|
|
|
|
- key: readability-identifier-naming.StructCase
|
|
|
|
|
value: CamelCase
|
|
|
|
|
- key: readability-identifier-naming.FunctionCase
|
2026-07-27 01:10:58 +08:00
|
|
|
value: camelBack
|
2026-07-23 05:27:51 +00:00
|
|
|
- key: readability-identifier-naming.VariableCase
|
2026-07-27 01:10:58 +08:00
|
|
|
value: camelBack
|
2026-07-23 05:27:51 +00:00
|
|
|
- key: readability-identifier-naming.MemberCase
|
2026-07-27 01:10:58 +08:00
|
|
|
value: camelBack
|
2026-07-23 05:27:51 +00:00
|
|
|
- key: readability-identifier-naming.MemberSuffix
|
2026-07-27 01:10:58 +08:00
|
|
|
value: '_'
|
|
|
|
|
- key: readability-identifier-naming.EnumCase
|
|
|
|
|
value: CamelCase
|
2026-07-23 05:27:51 +00:00
|
|
|
- key: readability-identifier-naming.EnumConstantCase
|
|
|
|
|
value: CamelCase
|
2026-07-27 01:10:58 +08:00
|
|
|
- key: readability-identifier-naming.NamespaceCase
|
|
|
|
|
value: lower_case
|
|
|
|
|
- key: readability-identifier-naming.TemplateParameterCase
|
|
|
|
|
value: CamelCase
|
|
|
|
|
- key: readability-identifier-naming.TypeAliasCase
|
|
|
|
|
value: CamelCase
|
|
|
|
|
- key: readability-identifier-naming.GlobalConstantCase
|
|
|
|
|
value: UPPER_CASE
|
|
|
|
|
- key: readability-identifier-naming.StaticConstantCase
|
|
|
|
|
value: UPPER_CASE
|
|
|
|
|
- key: readability-identifier-naming.ConstexprVariableCase
|
|
|
|
|
value: UPPER_CASE
|
2026-07-23 05:27:51 +00:00
|
|
|
- key: readability-identifier-naming.MacroDefinitionCase
|
|
|
|
|
value: UPPER_CASE
|
|
|
|
|
|
2026-07-27 01:10:58 +08:00
|
|
|
# ── 现代 C++ 检查 ──
|
|
|
|
|
- key: modernize-use-auto.MinTypeNameLength
|
|
|
|
|
value: '8'
|
|
|
|
|
- key: modernize-use-auto.RemoveStars
|
|
|
|
|
value: 'true'
|
|
|
|
|
- key: modernize-use-emplace.ContainersWithPushBack
|
|
|
|
|
value: 'std::vector;std::list;std::deque'
|
|
|
|
|
- key: modernize-loop-convert.UseCxx20ReverseRanges
|
|
|
|
|
value: 'true'
|
|
|
|
|
- key: modernize-pass-by-value.ValuesOnly
|
|
|
|
|
value: 'true'
|
|
|
|
|
|
|
|
|
|
# ── 性能检查 ──
|
|
|
|
|
- key: performance-move-const-arg.CheckTriviallyCopyableMove
|
|
|
|
|
value: 'true'
|
|
|
|
|
- key: performance-for-range-copy.WarnOnAllAutoCopies
|
|
|
|
|
value: 'true'
|
|
|
|
|
- key: performance-unnecessary-value-param.AllowedTypes
|
|
|
|
|
value: ''
|
|
|
|
|
|
|
|
|
|
# ── 代码准则 ──
|
|
|
|
|
- key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctions
|
|
|
|
|
value: 'true'
|
|
|
|
|
- key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor
|
|
|
|
|
value: 'true'
|
|
|
|
|
|
|
|
|
|
# ── 杂项 ──
|
|
|
|
|
- key: misc-throw-by-value-catch-by-reference.CheckThrowTemporaries
|
|
|
|
|
value: 'true'
|
|
|
|
|
|
|
|
|
|
# ── bug 检测 ──
|
|
|
|
|
- key: bugprone-argument-comment.StrictMode
|
|
|
|
|
value: 'false'
|
|
|
|
|
- key: bugprone-exception-escape.FunctionsThatShouldNotThrow
|
|
|
|
|
value: ''
|
|
|
|
|
|
|
|
|
|
# ── 可读性 ──
|
|
|
|
|
- key: readability-function-size.LineThreshold
|
|
|
|
|
value: '-1'
|
|
|
|
|
- key: readability-function-size.StatementThreshold
|
|
|
|
|
value: '800'
|
|
|
|
|
- key: readability-function-size.BranchThreshold
|
|
|
|
|
value: '-1'
|
|
|
|
|
- key: readability-function-size.ParameterThreshold
|
|
|
|
|
value: '-1'
|
|
|
|
|
- key: readability-simplify-subscript-expr.Types
|
|
|
|
|
value: '::std::vector;::std::array'
|