1fb726d48Sopenharmony_ci--- 2fb726d48Sopenharmony_ci# Ref: https://releases.llvm.org/12.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/list.html 3fb726d48Sopenharmony_ciChecks: > 4fb726d48Sopenharmony_ci bugprone-*, 5fb726d48Sopenharmony_ci clang-analyzer-*, 6fb726d48Sopenharmony_ci concurrency-mt-unsafe, 7fb726d48Sopenharmony_ci cppcoreguidelines-*, 8fb726d48Sopenharmony_ci cert-* 9fb726d48Sopenharmony_ci hicpp-*, 10fb726d48Sopenharmony_ci llvm-*, 11fb726d48Sopenharmony_ci modernize*, 12fb726d48Sopenharmony_ci performance-*, 13fb726d48Sopenharmony_ci portability-*, 14fb726d48Sopenharmony_ci readability-*, 15fb726d48Sopenharmony_ci -modernize-use-trailing-return-type, 16fb726d48Sopenharmony_ci -hicpp-vararg, 17fb726d48Sopenharmony_ci -hicpp-no-array-decay, 18fb726d48Sopenharmony_ci -cppcoreguidelines-owning-memory, 19fb726d48Sopenharmony_ci -cppcoreguidelines-pro-bounds-array-to-pointer-decay, 20fb726d48Sopenharmony_ci -cppcoreguidelines-pro-type-union-access, 21fb726d48Sopenharmony_ci -cppcoreguidelines-pro-type-vararg, 22fb726d48Sopenharmony_ci -readability-implicit-bool-conversion, 23fb726d48Sopenharmony_ci 24fb726d48Sopenharmony_ciCheckOptions: 25fb726d48Sopenharmony_ci # Ref: https://releases.llvm.org/12.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/readability-identifier-naming.html 26fb726d48Sopenharmony_ci - { key: readability-identifier-naming.NamespaceCase, value: CamelCase } 27fb726d48Sopenharmony_ci - { key: readability-identifier-naming.ClassCase, value: CamelCase } 28fb726d48Sopenharmony_ci - { key: readability-identifier-naming.StructCase, value: CamelCase } 29fb726d48Sopenharmony_ci - { key: readability-identifier-naming.UnionCase, value: CamelCase } 30fb726d48Sopenharmony_ci - { key: readability-identifier-naming.EnumCase, value: CamelCase } 31fb726d48Sopenharmony_ci - { key: readability-identifier-naming.TypedefCase, value: CamelCase } 32fb726d48Sopenharmony_ci - { key: readability-identifier-naming.TypeAliasCase, value: CamelCase } 33fb726d48Sopenharmony_ci - { key: readability-identifier-naming.FunctionCase, value: CamelCase } 34fb726d48Sopenharmony_ci - { key: readability-identifier-naming.GlobalVariableCase, value: camelBack } 35fb726d48Sopenharmony_ci - { key: readability-identifier-naming.GlobalVariablePrefix, value: g_ } 36fb726d48Sopenharmony_ci - { key: readability-identifier-naming.MacroDefinitionCase, value: UPPER_CASE } 37fb726d48Sopenharmony_ci - { key: readability-identifier-naming.EnumConstantCase, value: UPPER_CASE } 38fb726d48Sopenharmony_ci - { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE } 39fb726d48Sopenharmony_ci - { key: readability-identifier-naming.ClassConstantCase, value: UPPER_CASE } 40fb726d48Sopenharmony_ci - { key: readability-identifier-naming.StaticConstantCase, value: UPPER_CASE } 41fb726d48Sopenharmony_ci - { key: readability-identifier-naming.LocalConstantCase, value: camelBack } 42fb726d48Sopenharmony_ci - { key: readability-identifier-naming.ParameterCase, value: camelBack } 43fb726d48Sopenharmony_ci # 如下例外无法处理:对于struct/union的成员变量,仍采用小驼峰不加后缀的命名方式,与局部变量命名风格一致 44fb726d48Sopenharmony_ci # - { key: readability-identifier-naming.ClassMemberCase, value: camelCase } 45fb726d48Sopenharmony_ci # - { key: readability-identifier-naming.PublicMemberSuffix, value: _ } 46fb726d48Sopenharmony_ci # - { key: readability-identifier-naming.ProtectedMemberSuffix, value: _ } 47fb726d48Sopenharmony_ci # - { key: readability-identifier-naming.PrivateMemberSuffix, value: _ } 48fb726d48Sopenharmony_ci 49fb726d48Sopenharmony_ci # 规则8.1.1 避免函数过长,函数不超过50行(非空非注释) 50fb726d48Sopenharmony_ci - { key: readability-function-size.LineThreshold, value: 50 } 51fb726d48Sopenharmony_ci # 建议8.3.3 函数的参数个数不超过5个 52fb726d48Sopenharmony_ci - { key: readability-function-size.ParameterThreshold, value: 5 } 53fb726d48Sopenharmony_ci - { key: readability-function-size.NestingThreshold, value: 4 } 54fb726d48Sopenharmony_ci - { key: bugprone-assert-side-effect.CheckFunctionCalls, value: 1 } 55fb726d48Sopenharmony_ci - { key: modernize-use-transparent-functors.SafeMode, value: 1 } 56fb726d48Sopenharmony_ci 57