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 08:18] – [readability-identifier-naming] : fin 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: |
- | si (option CheckAnonFieldInParent && struct/ | + | |
- | Appliquer les règles ci-dessous en considérant le private/ | + | |
- | si (const) | + | |
- | si (defined(ConstantMember)) | + | |
- | => ConstantMember | + | |
- | si (defined(Constant)) | + | |
- | => Constant | + | |
- | si (private && defined(PrivateMember)) | + | |
- | => PrivateMember | + | |
- | si (protected && defined(ProtectedMember)) | + | |
- | => ProtectedMember | + | |
- | si (public && defined(PublicMember)) | + | |
- | => PublicMember | + | |
- | si (defined(Member)) | + | |
- | => Member | + | |
- | | + | |
- | si (paramètre d'une fonction) | + | protected: |
- | | + | |
- | => ConstexprVariable | + | |
- | si (const) | + | |
- | si (pointer && defined(ConstantPointerParameter)) | + | |
- | => ConstantPointerParameter | + | |
- | si (defined(ConstantParameter)) | + | |
- | => ConstantParameter | + | |
- | si (defined(Constant)) | + | |
- | => Constant | + | |
- | si (variadic && defined(ParameterPack)) | + | |
- | => ParameterPack | + | |
- | si (pointer && defined(PointerParameter)) | + | |
- | => PointerParameter | + | |
- | si (defined(Parameter)) | + | |
- | => Parameter | + | |
- | => Ignore | + | |
- | si (variable) | + | public: |
- | si (constexpr && | + | float FloaT; |
- | | + | }</ |
- | si (const) | + | |< |
- | si (static && | + | paramètre: |
- | | + | // Possible en C++ ?!? |
- | si (global && | + | |
- | | + | SK_ConstexprVariable |
- | si (global && | + | si const: |
- | | + | si pointeur && SK_ConstantPointerParameter: |
- | si (local && static && | + | SK_ConstantPointerParameter |
- | | + | si SK_ConstantParameter: |
- | si (local && | + | SK_ConstantParameter |
- | | + | si SK_Constant: |
- | si (local && | + | SK_Constant |
- | | + | si variadic && SK_ParameterPack: |
- | si (defined(Constant)) | + | SK_ParameterPack |
- | | + | si pointeur && SK_PointerParameter: |
- | + | SK_PointerParameter | |
- | si (static && | + | si SK_Parameter: |
- | | + | SK_Parameter |
- | si (global && | + | fin |
- | | + | </ |
- | si (global && | + | template < |
- | | + | void fOo(const int *IiI, const short & |
- | si (local && static && | + | int *JjJ, short SsS, Types... arGs); |
- | | + | </ |
- | si (local && | + | |< |
- | | + | variable: |
- | si (local && | + | si constexpr && |
- | | + | |
- | si (defined(Variable)) | + | si const: |
- | | + | si static && |
- | | + | |
+ | si global && | ||
+ | | ||
+ | si global && | ||
+ | | ||
+ | si local && static && | ||
+ | | ||
+ | si local && | ||
+ | | ||
+ | si local && | ||
+ | | ||
+ | // Plus restrictif que la condition précédente ?!? | ||
+ | si local && dans le bloc principal | ||
+ | | ||
+ | SK_LocalConstant | ||
+ | | ||
+ | SK_Constant | ||
+ | fin | ||
+ | si static && | ||
+ | | ||
+ | si global && | ||
+ | | ||
+ | si global && | ||
+ | | ||
+ | si local && static && | ||
+ | | ||
+ | si local && | ||
+ | | ||
+ | si local && | ||
+ | | ||
+ | // Plus restrictif que la condition précédente ?!? | ||
+ | si local && dans le bloc principal | ||
+ | | ||
+ | SK_LocalVariable | ||
+ | | ||
+ | SK_Variable | ||
+ | fin | ||
+ | </code>|<code cpp> | ||
+ | constexpr int eE = 150; | ||
- | si (methode) | + | class Cc { |
- | | + | static |
- | => Ignore | + | }; |
- | si (constexpr && defined(ConstexprMethod)) | + | |
- | => ConstexprMethod | + | |
- | si (constexpr && defined(ConstexprFunction)) | + | |
- | => ConstexprFunction | + | |
- | si (static | + | |
- | | + | |
- | si (virtual && defined(VirtualMethod)) | + | |
- | => VirtualMethod | + | |
- | si (private && defined(PrivateMethod)) | + | |
- | => PrivateMethod | + | |
- | si (protected && defined(ProtectedMethod)) | + | |
- | => ProtectedMethod | + | |
- | si (public && defined(PublicMethod)) | + | |
- | => PublicMethod | + | |
- | si (defined(Method)) | + | |
- | => Method | + | |
- | si (defined(Function)) | + | |
- | => Function | + | |
- | => Ignore | + | |
- | si (fonction) | + | const int *Jj = nullptr; |
- | si (constexpr && defined(ConstexprFunction)) | + | const int jJ = 0; |
- | | + | |
- | si (global && defined(GlobalFunction)) | + | |
- | => GlobalFunction | + | |
- | si (defined(Function)) | + | |
- | => Function | + | |
- | si (typename in template) | + | void fOo() { |
- | | + | |
- | => TypeTemplateParameter | + | const int *ZzzZ = nullptr; |
- | | + | |
- | => TemplateParameter | + | |
- | => Ignore | + | |
+ | const int ZZzZ = 150; | ||
+ | }; | ||
- | si (value in template) | + | class Cc2 { |
- | | + | |
- | | + | }; |
- | si (defined(TemplateParameter)) | + | |
- | => TemplateParameter | + | |
- | => Ignore | + | |
- | si (template < | + | int *Jj2 = nullptr; |
- | si (defined(TemplateTemplateParameter)) | + | int jJ2 = 0; |
- | => TemplateTemplateParameter | + | |
- | si (defined(TemplateParameter)) | + | |
- | | + | |
- | => Ignore | + | |
- | si (concept && defined(Concept)) | + | void fOo2() { |
- | => Concept | + | |
+ | int *ZzzZ2 = nullptr; | ||
+ | { | ||
+ | int ZZzz2 = 150; | ||
+ | } | ||
+ | int ZZzZ2 = 150; | ||
+ | }; | ||
+ | </code>| | ||
+ | |< | ||
+ | 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; | ||
+ | }; | ||
- | => Ignore | + | 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 | ||
+ | </ | ||
+ | |< | ||
+ | define && SK_MacroDefinition: | ||
+ | SK_MacroDefinition</ | ||
+ | #define MaCrO | ||
+ | </ | ||
=====Extensions===== | =====Extensions===== |
prog/clang-tidy.1733383120.txt.gz · Dernière modification : 2024/12/05 08:18 de root