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/12/05 00:09] – [readability-identifier-naming] : détail de l'algo root | prog:clang-tidy [2024/12/23 09:44] (Version actuelle) – [readability-identifier-naming] : précision sur GlobalFunction root | ||
---|---|---|---|
Ligne 85: | Ligne 85: | ||
Ci-dessous, '' | Ci-dessous, '' | ||
- | < | + | | Algo | Exemple | |
- | si (variable | + | |< |
- | | + | variable |
+ | 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_Namespace | ||
+ | fin | ||
+ | </code>|<code cpp> | ||
+ | inline namespace NAMEsPACE {} | ||
- | si (typedef | + | namespace nAMEPACE {} |
- | | + | </ |
+ | |< | ||
+ | enum: | ||
+ | | ||
+ | SK_Enum | ||
+ | | ||
- | si (using | + | field in enum: |
- | | + | |
+ | SK_ScopedEnumConstant | ||
+ | | ||
+ | SK_EnumConstant | ||
+ | si SK_Constant: | ||
+ | SK_Constant | ||
+ | fin</ | ||
+ | enum eNUM { EnuM_CONST }; | ||
- | si (namespace) | + | enum class eNUM { ENUM_Const }; |
- | si (namespace est inline) | + | </ |
- | | + | |< |
+ | union ou struct ou class: | ||
+ | | ||
+ | SK_AbstractClass | ||
+ | si 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 | ||
+ | </code>|<code cpp> | ||
+ | class ABStract { | ||
+ | virtual fOo() = 0; | ||
+ | }; | ||
- | si defined(Namespace) | + | struct STRuct {}; |
- | => | + | |
- | si (enum && defined(Enum)) | + | class ClAsS {}; |
- | => Enum | + | |
- | si (valeur d'un enum) | + | union UnIon {}; |
- | si (enum class && defined(ScopedEnumConstant)) | + | |
- | => ScopedEnumConstant | + | |
- | si (defined(EnumConstant)) | + | |
- | => EnumConstant | + | |
- | si (defined(Constant)) | + | |
- | => Constant | + | |
- | => Ignore | + | |
- | si (union ou struct ou class) | + | enum class eNUM {}; |
- | si (abstract (au moins une méthode virtuelle pure) && | + | </ |
- | | + | |< |
- | si (struct && defined(Struct)) | + | membre d'une classe: |
- | | + | si CheckAnonFieldInParent |
- | si (struct | + | |
- | | + | considérant le private/ |
- | si (class | + | si const: |
- | | + | |
- | si (class | + | SK_ConstantMember |
- | | + | si SK_Constant: |
- | si (union && defined(Union)) | + | SK_Constant |
- | | + | si private |
- | | + | |
- | => Enum | + | si protected |
- | | + | |
+ | si public | ||
+ | | ||
+ | si SK_Member: | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | class { | ||
+ | | ||
- | si (membre d'une classe) | + | private: |
- | | + | |
- | Appliquer les règles ci-dessous en considérant le private/ | + | |
+ | 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===== |
prog/clang-tidy.1733353745.txt.gz · Dernière modification : 2024/12/05 00:09 de root