more clang tidy (#586)

Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
This commit is contained in:
coco875 2025-12-08 16:46:29 +01:00 committed by GitHub
parent f022183d6f
commit b2479390ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 107 additions and 0 deletions

View File

@ -1,6 +1,7 @@
Checks: '
-*,
readability-*,
readability-identifier-naming,
performance-*,
bugprone-*,
cppcoreguidelines-*,
@ -27,3 +28,106 @@ CheckOptions:
# 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
# Functions: PascalCase (C++ style)
- key: readability-identifier-naming.FunctionCase
value: lower_case
# Allow legacy decompilation function names (func_XXXXXXXX)
- key: readability-identifier-naming.FunctionIgnoredRegexp
value: '^func_[0-9A-Fa-f]+$'
# 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

View File

@ -23,6 +23,7 @@ extern Editor::Editor gEditor;
extern HarbourMastersIntro gMenuIntro;
extern bool bCleanWorld;
#endif
// NOLINTBEGIN(readability-identifier-naming)
Properties* CM_GetProps();
Properties* CM_GetPropsTrackId(s32 trackId);
@ -228,6 +229,8 @@ void* GetCup();
void CM_RunGarbageCollector(void);
void CM_ResetAudio(void);
// NOLINTEND(readability-identifier-naming)
#ifdef __cplusplus
}
#endif