# Clang-Tidy Configuration for wayland-bongocat
# Static analysis for C code with best practices

# Enable checks
Checks: >
  -*,
  bugprone-*,
  -bugprone-easily-swappable-parameters,
  -bugprone-reserved-identifier,
  clang-analyzer-*,
  -clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
  concurrency-*,
  misc-*,
  -misc-no-recursion,
  performance-*,
  portability-*,
  readability-*,
  -readability-identifier-length,
  -readability-magic-numbers,
  -readability-function-cognitive-complexity,
  -readability-else-after-return,
  -readability-uppercase-literal-suffix,
  -misc-use-anonymous-namespace,
  -readability-non-const-parameter,
  -performance-enum-size,

# Only analyze project headers, not system/lib headers
HeaderFilterRegex: '.*/(include|src)/.*\.(h|hpp)$'

# Treat warnings as warnings (not errors by default)
WarningsAsErrors: ''

# Check options
CheckOptions:
  # Naming conventions (C style)
  - key: readability-identifier-naming.GlobalConstantCase
    value: UPPER_CASE
  - key: readability-identifier-naming.MacroDefinitionCase
    value: UPPER_CASE
  - key: readability-identifier-naming.FunctionCase
    value: lower_case
  - key: readability-identifier-naming.VariableCase
    value: lower_case
  - key: readability-identifier-naming.ParameterCase
    value: lower_case
  - key: readability-identifier-naming.StructCase
    value: lower_case
  - key: readability-identifier-naming.TypedefCase
    value: lower_case
  - key: readability-identifier-naming.TypedefSuffix
    value: '_t'
  - key: readability-identifier-naming.EnumCase
    value: lower_case
#  - key: readability-identifier-naming.EnumConstantCase
#    value: UPPER_CASE
  - key: readability-identifier-naming.MemberIgnoredRegexp
    value: '^_?[a-z]+(_[a-z0-9]+)*$'
  - key: readability-identifier-naming.PublicMemberIgnoredRegexp
    value: '^_?[a-z]+(_[a-z0-9]+)*$'
  # Naming conventions (C++ style)
  - key: readability-identifier-naming.NamespaceCase
    value: lower_case
  - key: readability-identifier-naming.ClassCase
    value: CamelCase
  - key: readability-identifier-naming.ClassMemberCase
    value: camelBack
  - key: readability-identifier-naming.PrivateMemberCase
    value: camelBack
  - key: readability-identifier-naming.ProtectedMemberCase
    value: camelBack
  - key: readability-identifier-naming.PublicMemberCase
    value: lower_case
  - key: readability-identifier-naming.StaticConstantCase
    value: UPPER_CASE
  - key: readability-identifier-naming.ClassConstantCase
    value: CamelCase
  - key: readability-identifier-naming.ConstexprMethodCase
    value: CamelCase
  - key: readability-identifier-naming.ClassMethodCase
    value: camelBack
  - key: readability-identifier-naming.PublicMethodCase
    value: camelBack
  - key: readability-identifier-naming.PrivateMethodCase
    value: camelBack
  - key: readability-identifier-naming.ProtectedMethodCase
    value: camelBack
  - key: readability-identifier-naming.ConstexprMethodCase
    value: camelBack
  - key: readability-identifier-naming.LocalVariableCase
    value: lower_case
  - key: readability-identifier-naming.ConstantParameterCase
    value: lower_case
  - key: readability-identifier-naming.ParameterPackCase
    value: lower_case
  - key: readability-identifier-naming.LocalConstantCase
    value: lower_case
  - key: readability-identifier-naming.ConstexprVariableCase
    value: UPPER_CASE
  - key: readability-identifier-naming.TemplateParameterCase
    value: CamelCase
  - key: readability-identifier-naming.TemplateTemplateParameterCase
    value: CamelCase
  
  # Braces around statements
  - key: readability-braces-around-statements.ShortStatementLines
    value: '1'
  
  # Function size limits (advisory)
  - key: readability-function-size.LineThreshold
    value: '200'
  - key: readability-function-size.StatementThreshold
    value: '100'
  - key: readability-function-size.ParameterThreshold
    value: '8'
  
  # Performance checks
  - key: performance-unnecessary-value-param.AllowedTypes
    value: ''
  
  # Misc settings
  - key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
    value: 'true'
  - key: readability-identifier-length.IgnoredVariableNames
    value: 'i|j|k|x|y|z'
  - key: readability-identifier-length.IgnoredParameterNames
    value: 'i|j|k|x|y|z'

# System header directories to ignore
SystemHeaders: false

# Use colors in diagnostics
UseColor: true

#FormatStyle: file
