summaryrefslogtreecommitdiff
path: root/.clang-tidy
blob: 4f602f5f297ab2c22f638f77560819533e0a2a23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
Checks: '
  -*,
  readability-*,
  readability-identifier-naming,
  performance-*,
  bugprone-*,
  cppcoreguidelines-*,

  -readability-magic-numbers,
  -readability-identifier-length,
  -readability-convert-member-functions-to-static,
  -readability-uppercase-literal-suffix,
  
  -bugprone-narrowing-conversions,
  -bugprone-easily-swappable-parameters,
  -bugprone-signed-char-misuse,

  -cppcoreguidelines-avoid-c-arrays,
  -cppcoreguidelines-avoid-magic-numbers,
  -cppcoreguidelines-avoid-non-const-global-variables,
  '
WarningsAsErrors: ''
HeaderFilterRegex: '(src|include)\/.*\.h$'
FormatStyle: 'file'
CheckOptions:
  # Require argument names to match exactly (instead of allowing a name to be a prefix/suffix of another)
  # Note: 'true' is expected by clang-tidy 12+ but '1' is used for compatibility with older versions
  - key: readability-inconsistent-declaration-parameter-name.Strict
    value: 1

  # === Naming conventions ===
  
  # Classes: PascalCase
  - key: readability-identifier-naming.ClassCase
    value: CamelCase
  
  # Structs: PascalCase
  - key: readability-identifier-naming.StructCase
    value: CamelCase
  # Allow legacy decompilation struct names (UnkStruct_XXXX, struct_D_XXXX, struct_XXXX_entry)
  - key: readability-identifier-naming.StructIgnoredRegexp
    value: '^(UnkStruct_?[0-9A-Fa-fxX]+|struct_D_[0-9A-Fa-fxX]+|struct_[0-9A-Fa-f]+_entry)$'
  
  # Enums: PascalCase
  - key: readability-identifier-naming.EnumCase
    value: CamelCase
  
  # Enum constants: UPPER_CASE (legacy C style)
  - key: readability-identifier-naming.EnumConstantCase
    value: UPPER_CASE
  
  # Namespaces: PascalCase
  - key: readability-identifier-naming.NamespaceCase
    value: CamelCase
  
  # Methods: PascalCase
  - key: readability-identifier-naming.MethodCase
    value: CamelCase
  
  # Parameters: camelCase
  - key: readability-identifier-naming.ParameterCase
    value: camelBack
  
  # Local variables: camelCase
  - key: readability-identifier-naming.LocalVariableCase
    value: camelBack
  
  # Global variables: camelCase with 'g' prefix
  - key: readability-identifier-naming.GlobalVariableCase
    value: CamelCase
  - key: readability-identifier-naming.GlobalVariablePrefix
    value: 'g'
  # Allow legacy decompilation names (D_XXXXXXXX) and boolean-like globals (bName)
  - key: readability-identifier-naming.GlobalVariableIgnoredRegexp
    value: '^(D_[0-9A-Fa-f]+|b[A-Z][a-zA-Z0-9]*)$'
  
  # Public members (structs and class public): camelCase without prefix
  - key: readability-identifier-naming.MemberCase
    value: camelBack
  # Allow legacy decompilation member names (unk_XX, unkXX, fill, pad)
  - key: readability-identifier-naming.MemberIgnoredRegexp
    value: '^(unk_?[0-9A-Fa-f]+|fill|pad[0-9]*)$'
  - key: readability-identifier-naming.PublicMemberCase
    value: camelBack
  - key: readability-identifier-naming.PublicMemberIgnoredRegexp
    value: '^(unk_?[0-9A-Fa-f]+|fill|pad[0-9]*)$'
  
  # Private members: camelCase with 'm' prefix
  - key: readability-identifier-naming.PrivateMemberCase
    value: CamelCase
  - key: readability-identifier-naming.PrivateMemberPrefix
    value: 'm'
  
  # Protected members: camelCase with 'm' prefix
  - key: readability-identifier-naming.ProtectedMemberCase
    value: CamelCase
  - key: readability-identifier-naming.ProtectedMemberPrefix
    value: 'm'
  
  # Static variables: camelCase with 's' prefix
  - key: readability-identifier-naming.StaticVariableCase
    value: CamelCase
  - key: readability-identifier-naming.StaticVariablePrefix
    value: 's'
  
  # Constants: UPPER_CASE
  - key: readability-identifier-naming.ConstantCase
    value: UPPER_CASE
  
  # Macros: UPPER_CASE
  - key: readability-identifier-naming.MacroDefinitionCase
    value: UPPER_CASE
  
  # Type aliases (typedef/using): PascalCase
  - key: readability-identifier-naming.TypeAliasCase
    value: CamelCase
  - key: readability-identifier-naming.TypedefCase
    value: CamelCase
  # Allow legacy decompilation typedef names (UnkStruct_XXXX, struct_D_XXXX, struct_XXXX_entry)
  - key: readability-identifier-naming.TypedefIgnoredRegexp
    value: '^(UnkStruct_?[0-9A-Fa-fxX]+|struct_D_[0-9A-Fa-fxX]+|struct_[0-9A-Fa-f]+_entry)$'
  
  # Template parameters: PascalCase
  - key: readability-identifier-naming.TemplateParameterCase
    value: CamelCase