prog:clang-tidy
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
prog:clang-tidy [2024/03/22 13:58] – Ajout de "Cache" root | prog:clang-tidy [2024/12/23 09:44] (Version actuelle) – [readability-identifier-naming] : précision sur GlobalFunction root | ||
---|---|---|---|
Ligne 74: | Ligne 74: | ||
// NOLINTEND(google*) | // NOLINTEND(google*) | ||
</ | </ | ||
+ | |||
+ | =====Détail des règles===== | ||
+ | |||
+ | ====readability-identifier-naming==== | ||
+ | |||
+ | Priorité de la convention de nommage: | ||
+ | |||
+ | Voir directement le code source avec les méthodes [[https:// | ||
+ | |||
+ | Ci-dessous, '' | ||
+ | |||
+ | | Algo | Exemple | | ||
+ | |< | ||
+ | variable objective-C: | ||
+ | si SK_ObjcIvar: | ||
+ | SK_ObjcIvar | ||
+ | sinon | ||
+ | fin | ||
+ | </ | ||
+ | </ | ||
+ | |< | ||
+ | typedef: | ||
+ | si SK_Typedef: | ||
+ | SK_Typedef | ||
+ | sinon | ||
+ | fin | ||
+ | </ | ||
+ | typedef int INTeGER; | ||
+ | </ | ||
+ | |< | ||
+ | using: | ||
+ | si SK_TypeAlias: | ||
+ | SK_TypeAlias | ||
+ | sinon | ||
+ | fin | ||
+ | </ | ||
+ | using DOUbLE = double; | ||
+ | </ | ||
+ | |< | ||
+ | namespace: | ||
+ | si inline namespace && SK_InlineNamespace: | ||
+ | SK_InlineNamespace | ||
+ | si SK_Namespace | ||
+ | SK_Namespace | ||
+ | fin | ||
+ | </ | ||
+ | inline namespace NAMEsPACE {} | ||
+ | |||
+ | namespace nAMEPACE {} | ||
+ | </ | ||
+ | |< | ||
+ | enum: | ||
+ | si enum && SK_Enum: | ||
+ | SK_Enum | ||
+ | fin | ||
+ | |||
+ | field in enum: | ||
+ | si enum class && SK_ScopedEnumConstant: | ||
+ | SK_ScopedEnumConstant | ||
+ | si SK_EnumConstant: | ||
+ | SK_EnumConstant | ||
+ | si SK_Constant: | ||
+ | SK_Constant | ||
+ | fin</ | ||
+ | enum eNUM { EnuM_CONST }; | ||
+ | |||
+ | enum class eNUM { ENUM_Const }; | ||
+ | </ | ||
+ | |< | ||
+ | union ou struct ou class: | ||
+ | si abstract (une méthode virtuelle pure) && SK_AbstractClass: | ||
+ | SK_AbstractClass | ||
+ | si struct && SK_Struct: | ||
+ | SK_Struct | ||
+ | si struct && SK_Class: | ||
+ | SK_Class | ||
+ | si class && SK_Class: | ||
+ | SK_Class | ||
+ | si class && SK_Struct: | ||
+ | SK_Struct | ||
+ | si union && SK_Union: | ||
+ | SK_Union | ||
+ | si enum && SK_Enum: | ||
+ | SK_Enum | ||
+ | fin | ||
+ | </ | ||
+ | class ABStract { | ||
+ | virtual fOo() = 0; | ||
+ | }; | ||
+ | |||
+ | struct STRuct {}; | ||
+ | |||
+ | class ClAsS {}; | ||
+ | |||
+ | union UnIon {}; | ||
+ | |||
+ | enum class eNUM {}; | ||
+ | </ | ||
+ | |< | ||
+ | membre d'une classe: | ||
+ | si CheckAnonFieldInParent && struct/ | ||
+ | Appliquer les règles ci-dessous en | ||
+ | considérant le private/ | ||
+ | si const: | ||
+ | si SK_ConstantMember: | ||
+ | SK_ConstantMember | ||
+ | si SK_Constant: | ||
+ | SK_Constant | ||
+ | si private && SK_PrivateMember: | ||
+ | SK_PrivateMember | ||
+ | si protected && SK_ProtectedMember: | ||
+ | SK_ProtectedMember | ||
+ | si public && SK_PublicMember: | ||
+ | SK_PublicMember | ||
+ | si SK_Member: | ||
+ | SK_Member | ||
+ | fin | ||
+ | </ | ||
+ | class { | ||
+ | const int InT; | ||
+ | |||
+ | private: | ||
+ | short ShorT; | ||
+ | |||
+ | protected: | ||
+ | double DoublE; | ||
+ | |||
+ | public: | ||
+ | float FloaT; | ||
+ | }</ | ||
+ | |< | ||
+ | paramètre: | ||
+ | // Possible en C++ ?!? | ||
+ | si constexpr && SK_ConstexprVariable: | ||
+ | SK_ConstexprVariable | ||
+ | si const: | ||
+ | si pointeur && SK_ConstantPointerParameter: | ||
+ | SK_ConstantPointerParameter | ||
+ | si SK_ConstantParameter: | ||
+ | SK_ConstantParameter | ||
+ | si SK_Constant: | ||
+ | SK_Constant | ||
+ | si variadic && SK_ParameterPack: | ||
+ | SK_ParameterPack | ||
+ | si pointeur && SK_PointerParameter: | ||
+ | SK_PointerParameter | ||
+ | si SK_Parameter: | ||
+ | SK_Parameter | ||
+ | fin | ||
+ | </ | ||
+ | template < | ||
+ | void fOo(const int *IiI, const short &ShorT, | ||
+ | int *JjJ, short SsS, Types... arGs); | ||
+ | </ | ||
+ | |< | ||
+ | variable: | ||
+ | si constexpr && SK_ConstexprVariable: | ||
+ | SK_ConstexprVariable | ||
+ | si const: | ||
+ | si static && membre && SK_ClassConstant: | ||
+ | SK_ClassConstant | ||
+ | si global && pointeur && SK_GlobalConstantPointer: | ||
+ | SK_GlobalConstantPointer | ||
+ | si global && SK_GlobalConstant: | ||
+ | SK_GlobalConstant | ||
+ | si local && static && SK_StaticConstant: | ||
+ | SK_StaticConstant | ||
+ | si local && pointeur && SK_LocalConstantPointer: | ||
+ | SK_LocalConstantPointer | ||
+ | si local && SK_LocalConstant: | ||
+ | SK_LocalConstant | ||
+ | // Plus restrictif que la condition précédente ?!? | ||
+ | si local && dans le bloc principal | ||
+ | de la fonction/ | ||
+ | SK_LocalConstant | ||
+ | si SK_Constant: | ||
+ | SK_Constant | ||
+ | fin | ||
+ | si static && membre && SK_ClassMember: | ||
+ | SK_ClassMember | ||
+ | si global && pointeur && SK_GlobalPointer: | ||
+ | SK_GlobalPointer | ||
+ | si global && SK_GlobalVariable: | ||
+ | SK_GlobalVariable | ||
+ | si local && static && SK_StaticVariable: | ||
+ | SK_StaticVariable | ||
+ | si local && pointeur && SK_LocalPointer: | ||
+ | SK_LocalPointer | ||
+ | si local && SK_LocalVariable: | ||
+ | SK_LocalVariable | ||
+ | // Plus restrictif que la condition précédente ?!? | ||
+ | si local && dans le bloc principal | ||
+ | de la fonction/ | ||
+ | SK_LocalVariable | ||
+ | si SK_Variable: | ||
+ | SK_Variable | ||
+ | fin | ||
+ | </ | ||
+ | constexpr int eE = 150; | ||
+ | |||
+ | class Cc { | ||
+ | static const int Ee = 150; | ||
+ | }; | ||
+ | |||
+ | const int *Jj = nullptr; | ||
+ | const int jJ = 0; | ||
+ | |||
+ | void fOo() { | ||
+ | static const int zZZz = 150; | ||
+ | const int *ZzzZ = nullptr; | ||
+ | { | ||
+ | const int ZZzz = 150; | ||
+ | } | ||
+ | const int ZZzZ = 150; | ||
+ | }; | ||
+ | |||
+ | class Cc2 { | ||
+ | static int Ee2 = 150; | ||
+ | }; | ||
+ | |||
+ | int *Jj2 = nullptr; | ||
+ | int jJ2 = 0; | ||
+ | |||
+ | void fOo2() { | ||
+ | static int zZZz2 = 150; | ||
+ | int *ZzzZ2 = nullptr; | ||
+ | { | ||
+ | int ZZzz2 = 150; | ||
+ | } | ||
+ | int ZZzZ2 = 150; | ||
+ | }; | ||
+ | </ | ||
+ | |< | ||
+ | méthode: | ||
+ | si override: | ||
+ | ignore | ||
+ | si constexpr && SK_ConstexprMethod: | ||
+ | SK_ConstexprMethod | ||
+ | si constexpr && SK_ConstexprFunction: | ||
+ | SK_ConstexprFunction | ||
+ | si static && SK_ClassMethod: | ||
+ | SK_ClassMethod | ||
+ | si virtual && SK_VirtualMethod: | ||
+ | SK_VirtualMethod | ||
+ | si private && SK_PrivateMethod: | ||
+ | SK_PrivateMethod | ||
+ | si protected && SK_ProtectedMethod: | ||
+ | SK_ProtectedMethod | ||
+ | si public && SK_PublicMethod: | ||
+ | SK_PublicMethod | ||
+ | si SK_Method: | ||
+ | SK_Method | ||
+ | si SK_Function: | ||
+ | SK_Function | ||
+ | ignore | ||
+ | </ | ||
+ | class A{ | ||
+ | public: | ||
+ | virtual void fOo()= 0; | ||
+ | }; | ||
+ | |||
+ | class B:public A{ | ||
+ | public: | ||
+ | void fOo() override; | ||
+ | |||
+ | constexpr int fOo2(); | ||
+ | static void fOo3(); | ||
+ | |||
+ | virtual void fOo4(); | ||
+ | |||
+ | private: | ||
+ | void fOo5(); | ||
+ | protected: | ||
+ | void fOo6(); | ||
+ | public: | ||
+ | void fOo7(); | ||
+ | }; | ||
+ | </ | ||
+ | |< | ||
+ | fonction: | ||
+ | si constexpr && SK_ConstexprFunction: | ||
+ | SK_ConstexprFunction | ||
+ | // C'est quoi une fonction non globale ? | ||
+ | si global && SK_GlobalFunction: | ||
+ | SK_GlobalFunction | ||
+ | si SK_Function: | ||
+ | SK_Function | ||
+ | ignore | ||
+ | </ | ||
+ | constexpr void b1r(); | ||
+ | void bAr(); | ||
+ | </ | ||
+ | |< | ||
+ | typename dans template: | ||
+ | si SK_TypeTemplateParameter: | ||
+ | SK_TypeTemplateParameter | ||
+ | si SK_TemplateParameter: | ||
+ | SK_TemplateParameter | ||
+ | ignore | ||
+ | |||
+ | value in template: | ||
+ | si SK_ValueTemplateParameter: | ||
+ | SK_ValueTemplateParameter | ||
+ | si SK_TemplateParameter: | ||
+ | SK_TemplateParameter | ||
+ | ignore | ||
+ | |||
+ | template < | ||
+ | si SK_TemplateTemplateParameter: | ||
+ | SK_TemplateTemplateParameter | ||
+ | si SK_TemplateParameter: | ||
+ | SK_TemplateParameter | ||
+ | ignore | ||
+ | </ | ||
+ | template< | ||
+ | template< | ||
+ | void FoBa(); | ||
+ | </ | ||
+ | |< | ||
+ | concept && SK_Concept: | ||
+ | SK_Concept</ | ||
+ | template< | ||
+ | concept ConCepT = std:: | ||
+ | </ | ||
+ | |< | ||
+ | define && SK_MacroDefinition: | ||
+ | SK_MacroDefinition</ | ||
+ | #define MaCrO | ||
+ | </ | ||
=====Extensions===== | =====Extensions===== | ||
Ligne 109: | Ligne 438: | ||
* Installation | * Installation | ||
- | Il suffit de copier | + | Il suffit de copier |
* Execution | * Execution | ||
<code bash> | <code bash> | ||
- | CTCACHE_CLANG_TIDY=/ | + | CTCACHE_CLANG_TIDY=/ |
</ | </ |
prog/clang-tidy.1711112286.txt.gz · Dernière modification : 2024/03/22 13:58 de root