# clang-tidy configuration for linthis
# Reference: https://clang.llvm.org/extra/clang-tidy/

---
# 启用的检查规则
Checks: >
  -*,
  bugprone-*,
  clang-analyzer-*,
  cppcoreguidelines-*,
  google-*,
  misc-*,
  modernize-*,
  performance-*,
  readability-*,
  -modernize-use-trailing-return-type,
  -readability-magic-numbers,
  -cppcoreguidelines-avoid-magic-numbers,
  -google-readability-todo,
  -readability-identifier-length,
  -cppcoreguidelines-pro-bounds-array-to-pointer-decay

# 将警告视为错误的规则 (可选)
WarningsAsErrors: ''

# 头文件过滤正则表达式
HeaderFilterRegex: '.*'

# 分析系统头文件
AnalyzeTemporaryDtors: false

# 格式化风格 (用于自动修复)
FormatStyle: 'google'

# 检查选项
CheckOptions:
  # readability-identifier-naming: 命名规范
  - key: readability-identifier-naming.ClassCase
    value: CamelCase
  - key: readability-identifier-naming.StructCase
    value: CamelCase
  - key: readability-identifier-naming.EnumCase
    value: CamelCase
  - key: readability-identifier-naming.FunctionCase
    value: CamelCase
  - key: readability-identifier-naming.MethodCase
    value: CamelCase
  - key: readability-identifier-naming.VariableCase
    value: lower_case
  - key: readability-identifier-naming.ParameterCase
    value: lower_case
  - key: readability-identifier-naming.MemberCase
    value: lower_case
  - key: readability-identifier-naming.MemberSuffix
    value: '_'
  - key: readability-identifier-naming.ConstantCase
    value: CamelCase
  - key: readability-identifier-naming.ConstantPrefix
    value: 'k'
  - key: readability-identifier-naming.GlobalConstantCase
    value: CamelCase
  - key: readability-identifier-naming.GlobalConstantPrefix
    value: 'k'
  - key: readability-identifier-naming.MacroDefinitionCase
    value: UPPER_CASE
  - key: readability-identifier-naming.NamespaceCase
    value: lower_case

  # modernize 相关选项
  - key: modernize-use-nullptr.NullMacros
    value: 'NULL'
  - key: modernize-loop-convert.MinConfidence
    value: reasonable
  - key: modernize-pass-by-value.IncludeStyle
    value: google

  # performance 相关选项
  - key: performance-move-const-arg.CheckTriviallyCopyableMove
    value: true

  # misc 相关选项
  - key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
    value: true

  # cppcoreguidelines 相关选项
  - key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor
    value: true
