1 .. title:: clang-tidy - readability-identifier-naming
3 readability-identifier-naming
4 =============================
6 Checks for identifiers naming style mismatch.
8 This check will try to enforce coding guidelines on the identifiers naming. It
9 supports one of the following casing types and tries to convert from one to
10 another if a mismatch is detected
18 - ``camel_Snake_Back``
19 - ``Camel_Snake_Case``
21 - ``Leading_upper_snake_case``
23 It also supports a fixed prefix and suffix that will be prepended or appended
24 to the identifiers, regardless of the casing.
26 Many configuration options are available, in order to be able to create
27 different rules for different kinds of identifiers. In general, the rules are
28 falling back to a more generic rule if the specific case is not configured.
30 The naming of virtual methods is reported where they occur in the base class,
31 but not where they are overridden, as it can't be fixed locally there.
32 This also applies for pseudo-override patterns like CRTP.
34 ``Leading_upper_snake_case`` is a naming convention where the first word is capitalized
35 followed by lower case word(s) separated by underscore(s) '_'. Examples include:
36 `Cap_snake_case`, `Cobra_case`, `Foo_bar_baz`, and `Master_copy_8gb`.
38 Hungarian notation can be customized using different *HungarianPrefix* settings.
39 The options and their corresponding values are:
41 - ``Off`` - the default setting
42 - ``On`` - example: ``int iVariable``
43 - ``LowerCase`` - example: ``int i_Variable``
44 - ``CamelCase`` - example: ``int IVariable``
49 The following options are described below:
51 - :option:`AbstractClassCase`, :option:`AbstractClassPrefix`, :option:`AbstractClassSuffix`, :option:`AbstractClassIgnoredRegexp`, :option:`AbstractClassHungarianPrefix`
52 - :option:`AggressiveDependentMemberLookup`
53 - :option:`CheckAnonFieldInParent`
54 - :option:`ClassCase`, :option:`ClassPrefix`, :option:`ClassSuffix`, :option:`ClassIgnoredRegexp`, :option:`ClassHungarianPrefix`
55 - :option:`ClassConstantCase`, :option:`ClassConstantPrefix`, :option:`ClassConstantSuffix`, :option:`ClassConstantIgnoredRegexp`, :option:`ClassConstantHungarianPrefix`
56 - :option:`ClassMemberCase`, :option:`ClassMemberPrefix`, :option:`ClassMemberSuffix`, :option:`ClassMemberIgnoredRegexp`, :option:`ClassMemberHungarianPrefix`
57 - :option:`ClassMethodCase`, :option:`ClassMethodPrefix`, :option:`ClassMethodSuffix`, :option:`ClassMethodIgnoredRegexp`
58 - :option:`ConceptCase`, :option:`ConceptPrefix`, :option:`ConceptSuffix`, :option:`ConceptIgnoredRegexp`
59 - :option:`ConstantCase`, :option:`ConstantPrefix`, :option:`ConstantSuffix`, :option:`ConstantIgnoredRegexp`, :option:`ConstantHungarianPrefix`
60 - :option:`ConstantMemberCase`, :option:`ConstantMemberPrefix`, :option:`ConstantMemberSuffix`, :option:`ConstantMemberIgnoredRegexp`, :option:`ConstantMemberHungarianPrefix`
61 - :option:`ConstantParameterCase`, :option:`ConstantParameterPrefix`, :option:`ConstantParameterSuffix`, :option:`ConstantParameterIgnoredRegexp`, :option:`ConstantParameterHungarianPrefix`
62 - :option:`ConstantPointerParameterCase`, :option:`ConstantPointerParameterPrefix`, :option:`ConstantPointerParameterSuffix`, :option:`ConstantPointerParameterIgnoredRegexp`, :option:`ConstantPointerParameterHungarianPrefix`
63 - :option:`ConstexprFunctionCase`, :option:`ConstexprFunctionPrefix`, :option:`ConstexprFunctionSuffix`, :option:`ConstexprFunctionIgnoredRegexp`
64 - :option:`ConstexprMethodCase`, :option:`ConstexprMethodPrefix`, :option:`ConstexprMethodSuffix`, :option:`ConstexprMethodIgnoredRegexp`
65 - :option:`ConstexprVariableCase`, :option:`ConstexprVariablePrefix`, :option:`ConstexprVariableSuffix`, :option:`ConstexprVariableIgnoredRegexp`, :option:`ConstexprVariableHungarianPrefix`
66 - :option:`EnumCase`, :option:`EnumPrefix`, :option:`EnumSuffix`, :option:`EnumIgnoredRegexp`
67 - :option:`EnumConstantCase`, :option:`EnumConstantPrefix`, :option:`EnumConstantSuffix`, :option:`EnumConstantIgnoredRegexp`, :option:`EnumConstantHungarianPrefix`
68 - :option:`FunctionCase`, :option:`FunctionPrefix`, :option:`FunctionSuffix`, :option:`FunctionIgnoredRegexp`
69 - :option:`GetConfigPerFile`
70 - :option:`GlobalConstantCase`, :option:`GlobalConstantPrefix`, :option:`GlobalConstantSuffix`, :option:`GlobalConstantIgnoredRegexp`, :option:`GlobalConstantHungarianPrefix`
71 - :option:`GlobalConstantPointerCase`, :option:`GlobalConstantPointerPrefix`, :option:`GlobalConstantPointerSuffix`, :option:`GlobalConstantPointerIgnoredRegexp`, :option:`GlobalConstantPointerHungarianPrefix`
72 - :option:`GlobalFunctionCase`, :option:`GlobalFunctionPrefix`, :option:`GlobalFunctionSuffix`, :option:`GlobalFunctionIgnoredRegexp`
73 - :option:`GlobalPointerCase`, :option:`GlobalPointerPrefix`, :option:`GlobalPointerSuffix`, :option:`GlobalPointerIgnoredRegexp`, :option:`GlobalPointerHungarianPrefix`
74 - :option:`GlobalVariableCase`, :option:`GlobalVariablePrefix`, :option:`GlobalVariableSuffix`, :option:`GlobalVariableIgnoredRegexp`, :option:`GlobalVariableHungarianPrefix`
75 - :option:`IgnoreMainLikeFunctions`
76 - :option:`InlineNamespaceCase`, :option:`InlineNamespacePrefix`, :option:`InlineNamespaceSuffix`, :option:`InlineNamespaceIgnoredRegexp`
77 - :option:`LocalConstantCase`, :option:`LocalConstantPrefix`, :option:`LocalConstantSuffix`, :option:`LocalConstantIgnoredRegexp`, :option:`LocalConstantHungarianPrefix`
78 - :option:`LocalConstantPointerCase`, :option:`LocalConstantPointerPrefix`, :option:`LocalConstantPointerSuffix`, :option:`LocalConstantPointerIgnoredRegexp`, :option:`LocalConstantPointerHungarianPrefix`
79 - :option:`LocalPointerCase`, :option:`LocalPointerPrefix`, :option:`LocalPointerSuffix`, :option:`LocalPointerIgnoredRegexp`, :option:`LocalPointerHungarianPrefix`
80 - :option:`LocalVariableCase`, :option:`LocalVariablePrefix`, :option:`LocalVariableSuffix`, :option:`LocalVariableIgnoredRegexp`, :option:`LocalVariableHungarianPrefix`
81 - :option:`MacroDefinitionCase`, :option:`MacroDefinitionPrefix`, :option:`MacroDefinitionSuffix`, :option:`MacroDefinitionIgnoredRegexp`
82 - :option:`MemberCase`, :option:`MemberPrefix`, :option:`MemberSuffix`, :option:`MemberIgnoredRegexp`, :option:`MemberHungarianPrefix`
83 - :option:`MethodCase`, :option:`MethodPrefix`, :option:`MethodSuffix`, :option:`MethodIgnoredRegexp`
84 - :option:`NamespaceCase`, :option:`NamespacePrefix`, :option:`NamespaceSuffix`, :option:`NamespaceIgnoredRegexp`
85 - :option:`ParameterCase`, :option:`ParameterPrefix`, :option:`ParameterSuffix`, :option:`ParameterIgnoredRegexp`, :option:`ParameterHungarianPrefix`
86 - :option:`ParameterPackCase`, :option:`ParameterPackPrefix`, :option:`ParameterPackSuffix`, :option:`ParameterPackIgnoredRegexp`
87 - :option:`PointerParameterCase`, :option:`PointerParameterPrefix`, :option:`PointerParameterSuffix`, :option:`PointerParameterIgnoredRegexp`, :option:`PointerParameterHungarianPrefix`
88 - :option:`PrivateMemberCase`, :option:`PrivateMemberPrefix`, :option:`PrivateMemberSuffix`, :option:`PrivateMemberIgnoredRegexp`, :option:`PrivateMemberHungarianPrefix`
89 - :option:`PrivateMethodCase`, :option:`PrivateMethodPrefix`, :option:`PrivateMethodSuffix`, :option:`PrivateMethodIgnoredRegexp`
90 - :option:`ProtectedMemberCase`, :option:`ProtectedMemberPrefix`, :option:`ProtectedMemberSuffix`, :option:`ProtectedMemberIgnoredRegexp`, :option:`ProtectedMemberHungarianPrefix`
91 - :option:`ProtectedMethodCase`, :option:`ProtectedMethodPrefix`, :option:`ProtectedMethodSuffix`, :option:`ProtectedMethodIgnoredRegexp`
92 - :option:`PublicMemberCase`, :option:`PublicMemberPrefix`, :option:`PublicMemberSuffix`, :option:`PublicMemberIgnoredRegexp`, :option:`PublicMemberHungarianPrefix`
93 - :option:`PublicMethodCase`, :option:`PublicMethodPrefix`, :option:`PublicMethodSuffix`, :option:`PublicMethodIgnoredRegexp`
94 - :option:`ScopedEnumConstantCase`, :option:`ScopedEnumConstantPrefix`, :option:`ScopedEnumConstantSuffix`, :option:`ScopedEnumConstantIgnoredRegexp`
95 - :option:`StaticConstantCase`, :option:`StaticConstantPrefix`, :option:`StaticConstantSuffix`, :option:`StaticConstantIgnoredRegexp`, :option:`StaticConstantHungarianPrefix`
96 - :option:`StaticVariableCase`, :option:`StaticVariablePrefix`, :option:`StaticVariableSuffix`, :option:`StaticVariableIgnoredRegexp`, :option:`StaticVariableHungarianPrefix`
97 - :option:`StructCase`, :option:`StructPrefix`, :option:`StructSuffix`, :option:`StructIgnoredRegexp`
98 - :option:`TemplateParameterCase`, :option:`TemplateParameterPrefix`, :option:`TemplateParameterSuffix`, :option:`TemplateParameterIgnoredRegexp`
99 - :option:`TemplateTemplateParameterCase`, :option:`TemplateTemplateParameterPrefix`, :option:`TemplateTemplateParameterSuffix`, :option:`TemplateTemplateParameterIgnoredRegexp`
100 - :option:`TypeAliasCase`, :option:`TypeAliasPrefix`, :option:`TypeAliasSuffix`, :option:`TypeAliasIgnoredRegexp`
101 - :option:`TypedefCase`, :option:`TypedefPrefix`, :option:`TypedefSuffix`, :option:`TypedefIgnoredRegexp`
102 - :option:`TypeTemplateParameterCase`, :option:`TypeTemplateParameterPrefix`, :option:`TypeTemplateParameterSuffix`, :option:`TypeTemplateParameterIgnoredRegexp`
103 - :option:`UnionCase`, :option:`UnionPrefix`, :option:`UnionSuffix`, :option:`UnionIgnoredRegexp`
104 - :option:`ValueTemplateParameterCase`, :option:`ValueTemplateParameterPrefix`, :option:`ValueTemplateParameterSuffix`, :option:`ValueTemplateParameterIgnoredRegexp`
105 - :option:`VariableCase`, :option:`VariablePrefix`, :option:`VariableSuffix`, :option:`VariableIgnoredRegexp`, :option:`VariableHungarianPrefix`
106 - :option:`VirtualMethodCase`, :option:`VirtualMethodPrefix`, :option:`VirtualMethodSuffix`, :option:`VirtualMethodIgnoredRegexp`
108 .. option:: AbstractClassCase
110 When defined, the check will ensure abstract class names conform to the
113 .. option:: AbstractClassPrefix
115 When defined, the check will ensure abstract class names will add the
116 prefixed with the given value (regardless of casing).
118 .. option:: AbstractClassIgnoredRegexp
120 Identifier naming checks won't be enforced for abstract class names
121 matching this regular expression.
123 .. option:: AbstractClassSuffix
125 When defined, the check will ensure abstract class names will add the
126 suffix with the given value (regardless of casing).
128 .. option:: AbstractClassHungarianPrefix
130 When enabled, the check ensures that the declared identifier will
131 have a Hungarian notation prefix based on the declared type.
133 For example using values of:
135 - AbstractClassCase of ``lower_case``
136 - AbstractClassPrefix of ``pre_``
137 - AbstractClassSuffix of ``_post``
138 - AbstractClassHungarianPrefix of ``On``
141 Identifies and/or transforms abstract class names as follows:
147 class ABSTRACT_CLASS {
156 class pre_abstract_class_post {
158 pre_abstract_class_post();
161 .. option:: AggressiveDependentMemberLookup
163 When set to `true` the check will look in dependent base classes for dependent
164 member references that need changing. This can lead to errors with template
165 specializations so the default value is `false`.
167 For example using values of:
169 - ClassMemberCase of ``lower_case``
175 template <typename T>
180 template <typename T>
181 struct Derived : Base<T> {
183 this->BadNamedMember = 0;
187 After if AggressiveDependentMemberLookup is `false`:
191 template <typename T>
196 template <typename T>
197 struct Derived : Base<T> {
199 this->BadNamedMember = 0;
203 After if AggressiveDependentMemberLookup is `true`:
207 template <typename T>
212 template <typename T>
213 struct Derived : Base<T> {
215 this->bad_named_member = 0;
219 .. option:: CheckAnonFieldInParent
221 When set to `true`, fields in anonymous records (i.e. anonymous
222 unions and structs) will be treated as names in the enclosing scope
223 rather than public members of the anonymous record for the purpose
238 If :option:`CheckAnonFieldInParent` is `false`, you may get warnings
239 that ``iv_`` and ``fv_`` are not coherent to public member names, because
240 ``iv_`` and ``fv_`` are public members of the anonymous union. When
241 :option:`CheckAnonFieldInParent` is `true`, ``iv_`` and ``fv_`` will be
242 treated as private data members of ``Foo`` for the purpose of name checking
243 and thus no warnings will be emitted.
245 .. option:: ClassCase
247 When defined, the check will ensure class names conform to the
250 .. option:: ClassPrefix
252 When defined, the check will ensure class names will add the
253 prefixed with the given value (regardless of casing).
255 .. option:: ClassIgnoredRegexp
257 Identifier naming checks won't be enforced for class names matching
258 this regular expression.
260 .. option:: ClassSuffix
262 When defined, the check will ensure class names will add the
263 suffix with the given value (regardless of casing).
265 .. option:: ClassHungarianPrefix
267 When enabled, the check ensures that the declared identifier will
268 have a Hungarian notation prefix based on the declared type.
270 For example using values of:
272 - ClassCase of ``lower_case``
273 - ClassPrefix of ``pre_``
274 - ClassSuffix of ``_post``
275 - ClassHungarianPrefix of ``On``
277 Identifies and/or transforms class names as follows:
299 .. option:: ClassConstantCase
301 When defined, the check will ensure class constant names conform to the
304 .. option:: ClassConstantPrefix
306 When defined, the check will ensure class constant names will add the
307 prefixed with the given value (regardless of casing).
309 .. option:: ClassConstantIgnoredRegexp
311 Identifier naming checks won't be enforced for class constant names
312 matching this regular expression.
314 .. option:: ClassConstantSuffix
316 When defined, the check will ensure class constant names will add the
317 suffix with the given value (regardless of casing).
319 .. option:: ClassConstantHungarianPrefix
321 When enabled, the check ensures that the declared identifier will
322 have a Hungarian notation prefix based on the declared type.
324 For example using values of:
326 - ClassConstantCase of ``lower_case``
327 - ClassConstantPrefix of ``pre_``
328 - ClassConstantSuffix of ``_post``
329 - ClassConstantHungarianPrefix of ``On``
331 Identifies and/or transforms class constant names as follows:
339 static const int CLASS_CONSTANT;
348 static const int pre_class_constant_post;
351 .. option:: ClassMemberCase
353 When defined, the check will ensure class member names conform to the
356 .. option:: ClassMemberPrefix
358 When defined, the check will ensure class member names will add the
359 prefixed with the given value (regardless of casing).
361 .. option:: ClassMemberIgnoredRegexp
363 Identifier naming checks won't be enforced for class member names
364 matching this regular expression.
366 .. option:: ClassMemberSuffix
368 When defined, the check will ensure class member names will add the
369 suffix with the given value (regardless of casing).
371 .. option:: ClassMemberHungarianPrefix
373 When enabled, the check ensures that the declared identifier will
374 have a Hungarian notation prefix based on the declared type.
376 For example using values of:
378 - ClassMemberCase of ``lower_case``
379 - ClassMemberPrefix of ``pre_``
380 - ClassMemberSuffix of ``_post``
381 - ClassMemberHungarianPrefix of ``On``
383 Identifies and/or transforms class member names as follows:
391 static int CLASS_CONSTANT;
400 static int pre_class_constant_post;
403 .. option:: ClassMethodCase
405 When defined, the check will ensure class method names conform to the
408 .. option:: ClassMethodPrefix
410 When defined, the check will ensure class method names will add the
411 prefixed with the given value (regardless of casing).
413 .. option:: ClassMethodIgnoredRegexp
415 Identifier naming checks won't be enforced for class method names
416 matching this regular expression.
418 .. option:: ClassMethodSuffix
420 When defined, the check will ensure class method names will add the
421 suffix with the given value (regardless of casing).
423 For example using values of:
425 - ClassMethodCase of ``lower_case``
426 - ClassMethodPrefix of ``pre_``
427 - ClassMethodSuffix of ``_post``
429 Identifies and/or transforms class method names as follows:
446 int pre_class_member_post();
449 .. option:: ConceptCase
451 When defined, the check will ensure concept names conform to the
454 .. option:: ConceptPrefix
456 When defined, the check will ensure concept names will add the
457 prefixed with the given value (regardless of casing).
459 .. option:: ConceptIgnoredRegexp
461 Identifier naming checks won't be enforced for concept names
462 matching this regular expression.
464 .. option:: ConceptSuffix
466 When defined, the check will ensure concept names will add the
467 suffix with the given value (regardless of casing).
469 For example using values of:
471 - ConceptCase of ``CamelCase``
472 - ConceptPrefix of ``Pre``
473 - ConceptSuffix of ``Post``
475 Identifies and/or transforms concept names as follows:
481 template<typename T> concept my_concept = requires (T t) { {t++}; };
487 template<typename T> concept PreMyConceptPost = requires (T t) { {t++}; };
489 .. option:: ConstantCase
491 When defined, the check will ensure constant names conform to the
494 .. option:: ConstantPrefix
496 When defined, the check will ensure constant names will add the
497 prefixed with the given value (regardless of casing).
499 .. option:: ConstantIgnoredRegexp
501 Identifier naming checks won't be enforced for constant names
502 matching this regular expression.
504 .. option:: ConstantSuffix
506 When defined, the check will ensure constant names will add the
507 suffix with the given value (regardless of casing).
509 .. option:: ConstantHungarianPrefix
511 When enabled, the check ensures that the declared identifier will
512 have a Hungarian notation prefix based on the declared type.
514 For example using values of:
516 - ConstantCase of ``lower_case``
517 - ConstantPrefix of ``pre_``
518 - ConstantSuffix of ``_post``
519 - ConstantHungarianPrefix of ``On``
521 Identifies and/or transforms constant names as follows:
527 void function() { unsigned const MyConst_array[] = {1, 2, 3}; }
533 void function() { unsigned const pre_myconst_array_post[] = {1, 2, 3}; }
535 .. option:: ConstantMemberCase
537 When defined, the check will ensure constant member names conform to the
540 .. option:: ConstantMemberPrefix
542 When defined, the check will ensure constant member names will add the
543 prefixed with the given value (regardless of casing).
545 .. option:: ConstantMemberIgnoredRegexp
547 Identifier naming checks won't be enforced for constant member names
548 matching this regular expression.
550 .. option:: ConstantMemberSuffix
552 When defined, the check will ensure constant member names will add the
553 suffix with the given value (regardless of casing).
555 .. option:: ConstantMemberHungarianPrefix
557 When enabled, the check ensures that the declared identifier will
558 have a Hungarian notation prefix based on the declared type.
560 For example using values of:
562 - ConstantMemberCase of ``lower_case``
563 - ConstantMemberPrefix of ``pre_``
564 - ConstantMemberSuffix of ``_post``
565 - ConstantMemberHungarianPrefix of ``On``
567 Identifies and/or transforms constant member names as follows:
574 char const MY_ConstMember_string[4] = "123";
582 char const pre_my_constmember_string_post[4] = "123";
585 .. option:: ConstantParameterCase
587 When defined, the check will ensure constant parameter names conform to the
590 .. option:: ConstantParameterPrefix
592 When defined, the check will ensure constant parameter names will add the
593 prefixed with the given value (regardless of casing).
595 .. option:: ConstantParameterIgnoredRegexp
597 Identifier naming checks won't be enforced for constant parameter names
598 matching this regular expression.
600 .. option:: ConstantParameterSuffix
602 When defined, the check will ensure constant parameter names will add the
603 suffix with the given value (regardless of casing).
605 .. option:: ConstantParameterHungarianPrefix
607 When enabled, the check ensures that the declared identifier will
608 have a Hungarian notation prefix based on the declared type.
610 For example using values of:
612 - ConstantParameterCase of ``lower_case``
613 - ConstantParameterPrefix of ``pre_``
614 - ConstantParameterSuffix of ``_post``
615 - ConstantParameterHungarianPrefix of ``On``
617 Identifies and/or transforms constant parameter names as follows:
623 void GLOBAL_FUNCTION(int PARAMETER_1, int const CONST_parameter);
629 void GLOBAL_FUNCTION(int PARAMETER_1, int const pre_const_parameter_post);
631 .. option:: ConstantPointerParameterCase
633 When defined, the check will ensure constant pointer parameter names conform to the
636 .. option:: ConstantPointerParameterPrefix
638 When defined, the check will ensure constant pointer parameter names will add the
639 prefixed with the given value (regardless of casing).
641 .. option:: ConstantPointerParameterIgnoredRegexp
643 Identifier naming checks won't be enforced for constant pointer parameter
644 names matching this regular expression.
646 .. option:: ConstantPointerParameterSuffix
648 When defined, the check will ensure constant pointer parameter names will add the
649 suffix with the given value (regardless of casing).
651 .. option:: ConstantPointerParameterHungarianPrefix
653 When enabled, the check ensures that the declared identifier will
654 have a Hungarian notation prefix based on the declared type.
656 For example using values of:
658 - ConstantPointerParameterCase of ``lower_case``
659 - ConstantPointerParameterPrefix of ``pre_``
660 - ConstantPointerParameterSuffix of ``_post``
661 - ConstantPointerParameterHungarianPrefix of ``On``
663 Identifies and/or transforms constant pointer parameter names as follows:
669 void GLOBAL_FUNCTION(int const *CONST_parameter);
675 void GLOBAL_FUNCTION(int const *pre_const_parameter_post);
677 .. option:: ConstexprFunctionCase
679 When defined, the check will ensure constexpr function names conform to the
682 .. option:: ConstexprFunctionPrefix
684 When defined, the check will ensure constexpr function names will add the
685 prefixed with the given value (regardless of casing).
687 .. option:: ConstexprFunctionIgnoredRegexp
689 Identifier naming checks won't be enforced for constexpr function names
690 matching this regular expression.
692 .. option:: ConstexprFunctionSuffix
694 When defined, the check will ensure constexpr function names will add the
695 suffix with the given value (regardless of casing).
697 For example using values of:
699 - ConstexprFunctionCase of ``lower_case``
700 - ConstexprFunctionPrefix of ``pre_``
701 - ConstexprFunctionSuffix of ``_post``
703 Identifies and/or transforms constexpr function names as follows:
709 constexpr int CE_function() { return 3; }
715 constexpr int pre_ce_function_post() { return 3; }
717 .. option:: ConstexprMethodCase
719 When defined, the check will ensure constexpr method names conform to the
722 .. option:: ConstexprMethodPrefix
724 When defined, the check will ensure constexpr method names will add the
725 prefixed with the given value (regardless of casing).
727 .. option:: ConstexprMethodIgnoredRegexp
729 Identifier naming checks won't be enforced for constexpr method names
730 matching this regular expression.
732 .. option:: ConstexprMethodSuffix
734 When defined, the check will ensure constexpr method names will add the
735 suffix with the given value (regardless of casing).
737 For example using values of:
739 - ConstexprMethodCase of ``lower_case``
740 - ConstexprMethodPrefix of ``pre_``
741 - ConstexprMethodSuffix of ``_post``
743 Identifies and/or transforms constexpr method names as follows:
751 constexpr int CST_expr_Method() { return 2; }
760 constexpr int pre_cst_expr_method_post() { return 2; }
763 .. option:: ConstexprVariableCase
765 When defined, the check will ensure constexpr variable names conform to the
768 .. option:: ConstexprVariablePrefix
770 When defined, the check will ensure constexpr variable names will add the
771 prefixed with the given value (regardless of casing).
773 .. option:: ConstexprVariableIgnoredRegexp
775 Identifier naming checks won't be enforced for constexpr variable names
776 matching this regular expression.
778 .. option:: ConstexprVariableSuffix
780 When defined, the check will ensure constexpr variable names will add the
781 suffix with the given value (regardless of casing).
783 .. option:: ConstexprVariableHungarianPrefix
785 When enabled, the check ensures that the declared identifier will
786 have a Hungarian notation prefix based on the declared type.
788 For example using values of:
790 - ConstexprVariableCase of ``lower_case``
791 - ConstexprVariablePrefix of ``pre_``
792 - ConstexprVariableSuffix of ``_post``
793 - ConstexprVariableHungarianPrefix of ``On``
795 Identifies and/or transforms constexpr variable names as follows:
801 constexpr int ConstExpr_variable = MyConstant;
807 constexpr int pre_constexpr_variable_post = MyConstant;
811 When defined, the check will ensure enumeration names conform to the
814 .. option:: EnumPrefix
816 When defined, the check will ensure enumeration names will add the
817 prefixed with the given value (regardless of casing).
819 .. option:: EnumIgnoredRegexp
821 Identifier naming checks won't be enforced for enumeration names
822 matching this regular expression.
824 .. option:: EnumSuffix
826 When defined, the check will ensure enumeration names will add the
827 suffix with the given value (regardless of casing).
829 For example using values of:
831 - EnumCase of ``lower_case``
832 - EnumPrefix of ``pre_``
833 - EnumSuffix of ``_post``
835 Identifies and/or transforms enumeration names as follows:
841 enum FOO { One, Two, Three };
847 enum pre_foo_post { One, Two, Three };
849 .. option:: EnumConstantCase
851 When defined, the check will ensure enumeration constant names conform to the
854 .. option:: EnumConstantPrefix
856 When defined, the check will ensure enumeration constant names will add the
857 prefixed with the given value (regardless of casing).
859 .. option:: EnumConstantIgnoredRegexp
861 Identifier naming checks won't be enforced for enumeration constant names
862 matching this regular expression.
864 .. option:: EnumConstantSuffix
866 When defined, the check will ensure enumeration constant names will add the
867 suffix with the given value (regardless of casing).
869 .. option:: EnumConstantHungarianPrefix
871 When enabled, the check ensures that the declared identifier will
872 have a Hungarian notation prefix based on the declared type.
874 For example using values of:
876 - EnumConstantCase of ``lower_case``
877 - EnumConstantPrefix of ``pre_``
878 - EnumConstantSuffix of ``_post``
879 - EnumConstantHungarianPrefix of ``On``
881 Identifies and/or transforms enumeration constant names as follows:
887 enum FOO { One, Two, Three };
893 enum FOO { pre_One_post, pre_Two_post, pre_Three_post };
895 .. option:: FunctionCase
897 When defined, the check will ensure function names conform to the
900 .. option:: FunctionPrefix
902 When defined, the check will ensure function names will add the
903 prefixed with the given value (regardless of casing).
905 .. option:: FunctionIgnoredRegexp
907 Identifier naming checks won't be enforced for function names
908 matching this regular expression.
910 .. option:: FunctionSuffix
912 When defined, the check will ensure function names will add the
913 suffix with the given value (regardless of casing).
915 For example using values of:
917 - FunctionCase of ``lower_case``
918 - FunctionPrefix of ``pre_``
919 - FunctionSuffix of ``_post``
921 Identifies and/or transforms function names as follows:
927 char MY_Function_string();
933 char pre_my_function_string_post();
935 .. option:: GetConfigPerFile
937 When `true` the check will look for the configuration for where an
938 identifier is declared. Useful for when included header files use a
940 Default value is `true`.
942 .. option:: GlobalConstantCase
944 When defined, the check will ensure global constant names conform to the
947 .. option:: GlobalConstantPrefix
949 When defined, the check will ensure global constant names will add the
950 prefixed with the given value (regardless of casing).
952 .. option:: GlobalConstantIgnoredRegexp
954 Identifier naming checks won't be enforced for global constant names
955 matching this regular expression.
957 .. option:: GlobalConstantSuffix
959 When defined, the check will ensure global constant names will add the
960 suffix with the given value (regardless of casing).
962 .. option:: GlobalConstantHungarianPrefix
964 When enabled, the check ensures that the declared identifier will
965 have a Hungarian notation prefix based on the declared type.
967 For example using values of:
969 - GlobalConstantCase of ``lower_case``
970 - GlobalConstantPrefix of ``pre_``
971 - GlobalConstantSuffix of ``_post``
972 - GlobalConstantHungarianPrefix of ``On``
974 Identifies and/or transforms global constant names as follows:
980 unsigned const MyConstGlobal_array[] = {1, 2, 3};
986 unsigned const pre_myconstglobal_array_post[] = {1, 2, 3};
988 .. option:: GlobalConstantPointerCase
990 When defined, the check will ensure global constant pointer names conform to the
993 .. option:: GlobalConstantPointerPrefix
995 When defined, the check will ensure global constant pointer names will add the
996 prefixed with the given value (regardless of casing).
998 .. option:: GlobalConstantPointerIgnoredRegexp
1000 Identifier naming checks won't be enforced for global constant pointer
1001 names matching this regular expression.
1003 .. option:: GlobalConstantPointerSuffix
1005 When defined, the check will ensure global constant pointer names will add the
1006 suffix with the given value (regardless of casing).
1008 .. option:: GlobalConstantPointerHungarianPrefix
1010 When enabled, the check ensures that the declared identifier will
1011 have a Hungarian notation prefix based on the declared type.
1013 For example using values of:
1015 - GlobalConstantPointerCase of ``lower_case``
1016 - GlobalConstantPointerPrefix of ``pre_``
1017 - GlobalConstantPointerSuffix of ``_post``
1018 - GlobalConstantPointerHungarianPrefix of ``On``
1020 Identifies and/or transforms global constant pointer names as follows:
1026 int *const MyConstantGlobalPointer = nullptr;
1032 int *const pre_myconstantglobalpointer_post = nullptr;
1034 .. option:: GlobalFunctionCase
1036 When defined, the check will ensure global function names conform to the
1039 .. option:: GlobalFunctionPrefix
1041 When defined, the check will ensure global function names will add the
1042 prefixed with the given value (regardless of casing).
1044 .. option:: GlobalFunctionIgnoredRegexp
1046 Identifier naming checks won't be enforced for global function names
1047 matching this regular expression.
1049 .. option:: GlobalFunctionSuffix
1051 When defined, the check will ensure global function names will add the
1052 suffix with the given value (regardless of casing).
1054 For example using values of:
1056 - GlobalFunctionCase of ``lower_case``
1057 - GlobalFunctionPrefix of ``pre_``
1058 - GlobalFunctionSuffix of ``_post``
1060 Identifies and/or transforms global function names as follows:
1066 void GLOBAL_FUNCTION(int PARAMETER_1, int const CONST_parameter);
1072 void pre_global_function_post(int PARAMETER_1, int const CONST_parameter);
1074 .. option:: GlobalPointerCase
1076 When defined, the check will ensure global pointer names conform to the
1079 .. option:: GlobalPointerPrefix
1081 When defined, the check will ensure global pointer names will add the
1082 prefixed with the given value (regardless of casing).
1084 .. option:: GlobalPointerIgnoredRegexp
1086 Identifier naming checks won't be enforced for global pointer names
1087 matching this regular expression.
1089 .. option:: GlobalPointerSuffix
1091 When defined, the check will ensure global pointer names will add the
1092 suffix with the given value (regardless of casing).
1094 .. option:: GlobalPointerHungarianPrefix
1096 When enabled, the check ensures that the declared identifier will
1097 have a Hungarian notation prefix based on the declared type.
1099 For example using values of:
1101 - GlobalPointerCase of ``lower_case``
1102 - GlobalPointerPrefix of ``pre_``
1103 - GlobalPointerSuffix of ``_post``
1104 - GlobalPointerHungarianPrefix of ``On``
1106 Identifies and/or transforms global pointer names as follows:
1118 int *pre_global3_post;
1120 .. option:: GlobalVariableCase
1122 When defined, the check will ensure global variable names conform to the
1125 .. option:: GlobalVariablePrefix
1127 When defined, the check will ensure global variable names will add the
1128 prefixed with the given value (regardless of casing).
1130 .. option:: GlobalVariableIgnoredRegexp
1132 Identifier naming checks won't be enforced for global variable names
1133 matching this regular expression.
1135 .. option:: GlobalVariableSuffix
1137 When defined, the check will ensure global variable names will add the
1138 suffix with the given value (regardless of casing).
1140 .. option:: GlobalVariableHungarianPrefix
1142 When enabled, the check ensures that the declared identifier will
1143 have a Hungarian notation prefix based on the declared type.
1145 For example using values of:
1147 - GlobalVariableCase of ``lower_case``
1148 - GlobalVariablePrefix of ``pre_``
1149 - GlobalVariableSuffix of ``_post``
1150 - GlobalVariableHungarianPrefix of ``On``
1152 Identifies and/or transforms global variable names as follows:
1164 int pre_global3_post;
1166 .. option:: IgnoreMainLikeFunctions
1168 When set to `true` functions that have a similar signature to ``main`` or
1169 ``wmain`` won't enforce checks on the names of their parameters.
1170 Default value is `false`.
1172 .. option:: InlineNamespaceCase
1174 When defined, the check will ensure inline namespaces names conform to the
1177 .. option:: InlineNamespacePrefix
1179 When defined, the check will ensure inline namespaces names will add the
1180 prefixed with the given value (regardless of casing).
1182 .. option:: InlineNamespaceIgnoredRegexp
1184 Identifier naming checks won't be enforced for inline namespaces names
1185 matching this regular expression.
1187 .. option:: InlineNamespaceSuffix
1189 When defined, the check will ensure inline namespaces names will add the
1190 suffix with the given value (regardless of casing).
1192 For example using values of:
1194 - InlineNamespaceCase of ``lower_case``
1195 - InlineNamespacePrefix of ``pre_``
1196 - InlineNamespaceSuffix of ``_post``
1198 Identifies and/or transforms inline namespaces names as follows:
1205 inline namespace InlineNamespace {
1208 } // namespace FOO_NS
1215 inline namespace pre_inlinenamespace_post {
1218 } // namespace FOO_NS
1220 .. option:: LocalConstantCase
1222 When defined, the check will ensure local constant names conform to the
1225 .. option:: LocalConstantPrefix
1227 When defined, the check will ensure local constant names will add the
1228 prefixed with the given value (regardless of casing).
1230 .. option:: LocalConstantIgnoredRegexp
1232 Identifier naming checks won't be enforced for local constant names
1233 matching this regular expression.
1235 .. option:: LocalConstantSuffix
1237 When defined, the check will ensure local constant names will add the
1238 suffix with the given value (regardless of casing).
1240 .. option:: LocalConstantHungarianPrefix
1242 When enabled, the check ensures that the declared identifier will
1243 have a Hungarian notation prefix based on the declared type.
1245 For example using values of:
1247 - LocalConstantCase of ``lower_case``
1248 - LocalConstantPrefix of ``pre_``
1249 - LocalConstantSuffix of ``_post``
1250 - LocalConstantHungarianPrefix of ``On``
1252 Identifies and/or transforms local constant names as follows:
1258 void foo() { int const local_Constant = 3; }
1264 void foo() { int const pre_local_constant_post = 3; }
1266 .. option:: LocalConstantPointerCase
1268 When defined, the check will ensure local constant pointer names conform to the
1271 .. option:: LocalConstantPointerPrefix
1273 When defined, the check will ensure local constant pointer names will add the
1274 prefixed with the given value (regardless of casing).
1276 .. option:: LocalConstantPointerIgnoredRegexp
1278 Identifier naming checks won't be enforced for local constant pointer names
1279 matching this regular expression.
1281 .. option:: LocalConstantPointerSuffix
1283 When defined, the check will ensure local constant pointer names will add the
1284 suffix with the given value (regardless of casing).
1286 .. option:: LocalConstantPointerHungarianPrefix
1288 When enabled, the check ensures that the declared identifier will
1289 have a Hungarian notation prefix based on the declared type.
1291 For example using values of:
1293 - LocalConstantPointerCase of ``lower_case``
1294 - LocalConstantPointerPrefix of ``pre_``
1295 - LocalConstantPointerSuffix of ``_post``
1296 - LocalConstantPointerHungarianPrefix of ``On``
1298 Identifies and/or transforms local constant pointer names as follows:
1304 void foo() { int const *local_Constant = 3; }
1310 void foo() { int const *pre_local_constant_post = 3; }
1312 .. option:: LocalPointerCase
1314 When defined, the check will ensure local pointer names conform to the
1317 .. option:: LocalPointerPrefix
1319 When defined, the check will ensure local pointer names will add the
1320 prefixed with the given value (regardless of casing).
1322 .. option:: LocalPointerIgnoredRegexp
1324 Identifier naming checks won't be enforced for local pointer names
1325 matching this regular expression.
1327 .. option:: LocalPointerSuffix
1329 When defined, the check will ensure local pointer names will add the
1330 suffix with the given value (regardless of casing).
1332 .. option:: LocalPointerHungarianPrefix
1334 When enabled, the check ensures that the declared identifier will
1335 have a Hungarian notation prefix based on the declared type.
1337 For example using values of:
1339 - LocalPointerCase of ``lower_case``
1340 - LocalPointerPrefix of ``pre_``
1341 - LocalPointerSuffix of ``_post``
1342 - LocalPointerHungarianPrefix of ``On``
1344 Identifies and/or transforms local pointer names as follows:
1350 void foo() { int *local_Constant; }
1356 void foo() { int *pre_local_constant_post; }
1358 .. option:: LocalVariableCase
1360 When defined, the check will ensure local variable names conform to the
1363 .. option:: LocalVariablePrefix
1365 When defined, the check will ensure local variable names will add the
1366 prefixed with the given value (regardless of casing).
1368 .. option:: LocalVariableIgnoredRegexp
1370 Identifier naming checks won't be enforced for local variable names
1371 matching this regular expression.
1373 For example using values of:
1375 - LocalVariableCase of ``CamelCase``
1376 - LocalVariableIgnoredRegexp of ``\w{1,2}``
1378 Will exclude variables with a length less than or equal to 2 from the
1379 camel case check applied to other variables.
1381 .. option:: LocalVariableSuffix
1383 When defined, the check will ensure local variable names will add the
1384 suffix with the given value (regardless of casing).
1386 .. option:: LocalVariableHungarianPrefix
1388 When enabled, the check ensures that the declared identifier will
1389 have a Hungarian notation prefix based on the declared type.
1391 For example using values of:
1393 - LocalVariableCase of ``lower_case``
1394 - LocalVariablePrefix of ``pre_``
1395 - LocalVariableSuffix of ``_post``
1396 - LocalVariableHungarianPrefix of ``On``
1398 Identifies and/or transforms local variable names as follows:
1404 void foo() { int local_Constant; }
1410 void foo() { int pre_local_constant_post; }
1412 .. option:: MacroDefinitionCase
1414 When defined, the check will ensure macro definitions conform to the
1417 .. option:: MacroDefinitionPrefix
1419 When defined, the check will ensure macro definitions will add the
1420 prefixed with the given value (regardless of casing).
1422 .. option:: MacroDefinitionIgnoredRegexp
1424 Identifier naming checks won't be enforced for macro definitions
1425 matching this regular expression.
1427 .. option:: MacroDefinitionSuffix
1429 When defined, the check will ensure macro definitions will add the
1430 suffix with the given value (regardless of casing).
1432 For example using values of:
1434 - MacroDefinitionCase of ``lower_case``
1435 - MacroDefinitionPrefix of ``pre_``
1436 - MacroDefinitionSuffix of ``_post``
1438 Identifies and/or transforms macro definitions as follows:
1444 #define MY_MacroDefinition
1450 #define pre_my_macro_definition_post
1452 Note: This will not warn on builtin macros or macros defined on the command line
1453 using the ``-D`` flag.
1455 .. option:: MemberCase
1457 When defined, the check will ensure member names conform to the
1460 .. option:: MemberPrefix
1462 When defined, the check will ensure member names will add the
1463 prefixed with the given value (regardless of casing).
1465 .. option:: MemberIgnoredRegexp
1467 Identifier naming checks won't be enforced for member names
1468 matching this regular expression.
1470 .. option:: MemberSuffix
1472 When defined, the check will ensure member names will add the
1473 suffix with the given value (regardless of casing).
1475 .. option:: MemberHungarianPrefix
1477 When enabled, the check ensures that the declared identifier will
1478 have a Hungarian notation prefix based on the declared type.
1480 For example using values of:
1482 - MemberCase of ``lower_case``
1483 - MemberPrefix of ``pre_``
1484 - MemberSuffix of ``_post``
1485 - MemberHungarianPrefix of ``On``
1487 Identifies and/or transforms member names as follows:
1494 char MY_ConstMember_string[4];
1502 char pre_my_constmember_string_post[4];
1505 .. option:: MethodCase
1507 When defined, the check will ensure method names conform to the
1510 .. option:: MethodPrefix
1512 When defined, the check will ensure method names will add the
1513 prefixed with the given value (regardless of casing).
1515 .. option:: MethodIgnoredRegexp
1517 Identifier naming checks won't be enforced for method names
1518 matching this regular expression.
1520 .. option:: MethodSuffix
1522 When defined, the check will ensure method names will add the
1523 suffix with the given value (regardless of casing).
1525 For example using values of:
1527 - MethodCase of ``lower_case``
1528 - MethodPrefix of ``pre_``
1529 - MethodSuffix of ``_post``
1531 Identifies and/or transforms method names as follows:
1538 char MY_Method_string();
1546 char pre_my_method_string_post();
1549 .. option:: NamespaceCase
1551 When defined, the check will ensure namespace names conform to the
1554 .. option:: NamespacePrefix
1556 When defined, the check will ensure namespace names will add the
1557 prefixed with the given value (regardless of casing).
1559 .. option:: NamespaceIgnoredRegexp
1561 Identifier naming checks won't be enforced for namespace names
1562 matching this regular expression.
1564 .. option:: NamespaceSuffix
1566 When defined, the check will ensure namespace names will add the
1567 suffix with the given value (regardless of casing).
1569 For example using values of:
1571 - NamespaceCase of ``lower_case``
1572 - NamespacePrefix of ``pre_``
1573 - NamespaceSuffix of ``_post``
1575 Identifies and/or transforms namespace names as follows:
1589 namespace pre_foo_ns_post {
1593 .. option:: ParameterCase
1595 When defined, the check will ensure parameter names conform to the
1598 .. option:: ParameterPrefix
1600 When defined, the check will ensure parameter names will add the
1601 prefixed with the given value (regardless of casing).
1603 .. option:: ParameterIgnoredRegexp
1605 Identifier naming checks won't be enforced for parameter names
1606 matching this regular expression.
1608 .. option:: ParameterSuffix
1610 When defined, the check will ensure parameter names will add the
1611 suffix with the given value (regardless of casing).
1613 .. option:: ParameterHungarianPrefix
1615 When enabled, the check ensures that the declared identifier will
1616 have a Hungarian notation prefix based on the declared type.
1618 For example using values of:
1620 - ParameterCase of ``lower_case``
1621 - ParameterPrefix of ``pre_``
1622 - ParameterSuffix of ``_post``
1623 - ParameterHungarianPrefix of ``On``
1625 Identifies and/or transforms parameter names as follows:
1631 void GLOBAL_FUNCTION(int PARAMETER_1, int const CONST_parameter);
1637 void GLOBAL_FUNCTION(int pre_parameter_post, int const CONST_parameter);
1639 .. option:: ParameterPackCase
1641 When defined, the check will ensure parameter pack names conform to the
1644 .. option:: ParameterPackPrefix
1646 When defined, the check will ensure parameter pack names will add the
1647 prefixed with the given value (regardless of casing).
1649 .. option:: ParameterPackIgnoredRegexp
1651 Identifier naming checks won't be enforced for parameter pack names
1652 matching this regular expression.
1654 .. option:: ParameterPackSuffix
1656 When defined, the check will ensure parameter pack names will add the
1657 suffix with the given value (regardless of casing).
1659 For example using values of:
1661 - ParameterPackCase of ``lower_case``
1662 - ParameterPackPrefix of ``pre_``
1663 - ParameterPackSuffix of ``_post``
1665 Identifies and/or transforms parameter pack names as follows:
1671 template <typename... TYPE_parameters> {
1672 void FUNCTION(int... TYPE_parameters);
1679 template <typename... TYPE_parameters> {
1680 void FUNCTION(int... pre_type_parameters_post);
1683 .. option:: PointerParameterCase
1685 When defined, the check will ensure pointer parameter names conform to the
1688 .. option:: PointerParameterPrefix
1690 When defined, the check will ensure pointer parameter names will add the
1691 prefixed with the given value (regardless of casing).
1693 .. option:: PointerParameterIgnoredRegexp
1695 Identifier naming checks won't be enforced for pointer parameter names
1696 matching this regular expression.
1698 .. option:: PointerParameterSuffix
1700 When defined, the check will ensure pointer parameter names will add the
1701 suffix with the given value (regardless of casing).
1703 .. option:: PointerParameterHungarianPrefix
1705 When enabled, the check ensures that the declared identifier will
1706 have a Hungarian notation prefix based on the declared type.
1708 For example using values of:
1710 - PointerParameterCase of ``lower_case``
1711 - PointerParameterPrefix of ``pre_``
1712 - PointerParameterSuffix of ``_post``
1713 - PointerParameterHungarianPrefix of ``On``
1715 Identifies and/or transforms pointer parameter names as follows:
1721 void FUNCTION(int *PARAMETER);
1727 void FUNCTION(int *pre_parameter_post);
1729 .. option:: PrivateMemberCase
1731 When defined, the check will ensure private member names conform to the
1734 .. option:: PrivateMemberPrefix
1736 When defined, the check will ensure private member names will add the
1737 prefixed with the given value (regardless of casing).
1739 .. option:: PrivateMemberIgnoredRegexp
1741 Identifier naming checks won't be enforced for private member names
1742 matching this regular expression.
1744 .. option:: PrivateMemberSuffix
1746 When defined, the check will ensure private member names will add the
1747 suffix with the given value (regardless of casing).
1749 .. option:: PrivateMemberHungarianPrefix
1751 When enabled, the check ensures that the declared identifier will
1752 have a Hungarian notation prefix based on the declared type.
1754 For example using values of:
1756 - PrivateMemberCase of ``lower_case``
1757 - PrivateMemberPrefix of ``pre_``
1758 - PrivateMemberSuffix of ``_post``
1759 - PrivateMemberHungarianPrefix of ``On``
1761 Identifies and/or transforms private member names as follows:
1769 int Member_Variable;
1778 int pre_member_variable_post;
1781 .. option:: PrivateMethodCase
1783 When defined, the check will ensure private method names conform to the
1786 .. option:: PrivateMethodPrefix
1788 When defined, the check will ensure private method names will add the
1789 prefixed with the given value (regardless of casing).
1791 .. option:: PrivateMethodIgnoredRegexp
1793 Identifier naming checks won't be enforced for private method names
1794 matching this regular expression.
1796 .. option:: PrivateMethodSuffix
1798 When defined, the check will ensure private method names will add the
1799 suffix with the given value (regardless of casing).
1801 For example using values of:
1803 - PrivateMethodCase of ``lower_case``
1804 - PrivateMethodPrefix of ``pre_``
1805 - PrivateMethodSuffix of ``_post``
1807 Identifies and/or transforms private method names as follows:
1815 int Member_Method();
1824 int pre_member_method_post();
1827 .. option:: ProtectedMemberCase
1829 When defined, the check will ensure protected member names conform to the
1832 .. option:: ProtectedMemberPrefix
1834 When defined, the check will ensure protected member names will add the
1835 prefixed with the given value (regardless of casing).
1837 .. option:: ProtectedMemberIgnoredRegexp
1839 Identifier naming checks won't be enforced for protected member names
1840 matching this regular expression.
1842 .. option:: ProtectedMemberSuffix
1844 When defined, the check will ensure protected member names will add the
1845 suffix with the given value (regardless of casing).
1847 .. option:: ProtectedMemberHungarianPrefix
1849 When enabled, the check ensures that the declared identifier will
1850 have a Hungarian notation prefix based on the declared type.
1852 For example using values of:
1854 - ProtectedMemberCase of ``lower_case``
1855 - ProtectedMemberPrefix of ``pre_``
1856 - ProtectedMemberSuffix of ``_post``
1857 - ProtectedMemberHungarianPrefix of ``On``
1859 Identifies and/or transforms protected member names as follows:
1867 int Member_Variable;
1876 int pre_member_variable_post;
1879 .. option:: ProtectedMethodCase
1881 When defined, the check will ensure protected method names conform to the
1884 .. option:: ProtectedMethodPrefix
1886 When defined, the check will ensure protected method names will add the
1887 prefixed with the given value (regardless of casing).
1889 .. option:: ProtectedMethodIgnoredRegexp
1891 Identifier naming checks won't be enforced for protected method names
1892 matching this regular expression.
1894 .. option:: ProtectedMethodSuffix
1896 When defined, the check will ensure protected method names will add the
1897 suffix with the given value (regardless of casing).
1899 For example using values of:
1901 - ProtectedMethodCase of ``lower_case``
1902 - ProtectedMethodPrefix of ``pre_``
1903 - ProtectedMethodSuffix of ``_post``
1905 Identifies and/or transforms protect method names as follows:
1913 int Member_Method();
1922 int pre_member_method_post();
1925 .. option:: PublicMemberCase
1927 When defined, the check will ensure public member names conform to the
1930 .. option:: PublicMemberPrefix
1932 When defined, the check will ensure public member names will add the
1933 prefixed with the given value (regardless of casing).
1935 .. option:: PublicMemberIgnoredRegexp
1937 Identifier naming checks won't be enforced for public member names
1938 matching this regular expression.
1940 .. option:: PublicMemberSuffix
1942 When defined, the check will ensure public member names will add the
1943 suffix with the given value (regardless of casing).
1945 .. option:: PublicMemberHungarianPrefix
1947 When enabled, the check ensures that the declared identifier will
1948 have a Hungarian notation prefix based on the declared type.
1950 For example using values of:
1952 - PublicMemberCase of ``lower_case``
1953 - PublicMemberPrefix of ``pre_``
1954 - PublicMemberSuffix of ``_post``
1955 - PublicMemberHungarianPrefix of ``On``
1957 Identifies and/or transforms public member names as follows:
1965 int Member_Variable;
1974 int pre_member_variable_post;
1977 .. option:: PublicMethodCase
1979 When defined, the check will ensure public method names conform to the
1982 .. option:: PublicMethodPrefix
1984 When defined, the check will ensure public method names will add the
1985 prefixed with the given value (regardless of casing).
1987 .. option:: PublicMethodIgnoredRegexp
1989 Identifier naming checks won't be enforced for public method names
1990 matching this regular expression.
1992 .. option:: PublicMethodSuffix
1994 When defined, the check will ensure public method names will add the
1995 suffix with the given value (regardless of casing).
1997 For example using values of:
1999 - PublicMethodCase of ``lower_case``
2000 - PublicMethodPrefix of ``pre_``
2001 - PublicMethodSuffix of ``_post``
2003 Identifies and/or transforms public method names as follows:
2011 int Member_Method();
2020 int pre_member_method_post();
2023 .. option:: ScopedEnumConstantCase
2025 When defined, the check will ensure scoped enum constant names conform to
2026 the selected casing.
2028 .. option:: ScopedEnumConstantPrefix
2030 When defined, the check will ensure scoped enum constant names will add the
2031 prefixed with the given value (regardless of casing).
2033 .. option:: ScopedEnumConstantIgnoredRegexp
2035 Identifier naming checks won't be enforced for scoped enum constant names
2036 matching this regular expression.
2038 .. option:: ScopedEnumConstantSuffix
2040 When defined, the check will ensure scoped enum constant names will add the
2041 suffix with the given value (regardless of casing).
2043 .. option:: ScopedEnumConstantHungarianPrefix
2045 When enabled, the check ensures that the declared identifier will
2046 have a Hungarian notation prefix based on the declared type.
2048 For example using values of:
2050 - ScopedEnumConstantCase of ``lower_case``
2051 - ScopedEnumConstantPrefix of ``pre_``
2052 - ScopedEnumConstantSuffix of ``_post``
2053 - ScopedEnumConstantHungarianPrefix of ``On``
2055 Identifies and/or transforms enumeration constant names as follows:
2061 enum class FOO { One, Two, Three };
2067 enum class FOO { pre_One_post, pre_Two_post, pre_Three_post };
2069 .. option:: StaticConstantCase
2071 When defined, the check will ensure static constant names conform to the
2074 .. option:: StaticConstantPrefix
2076 When defined, the check will ensure static constant names will add the
2077 prefixed with the given value (regardless of casing).
2079 .. option:: StaticConstantIgnoredRegexp
2081 Identifier naming checks won't be enforced for static constant names
2082 matching this regular expression.
2084 .. option:: StaticConstantSuffix
2086 When defined, the check will ensure static constant names will add the
2087 suffix with the given value (regardless of casing).
2089 .. option:: StaticConstantHungarianPrefix
2091 When enabled, the check ensures that the declared identifier will
2092 have a Hungarian notation prefix based on the declared type.
2094 For example using values of:
2096 - StaticConstantCase of ``lower_case``
2097 - StaticConstantPrefix of ``pre_``
2098 - StaticConstantSuffix of ``_post``
2099 - StaticConstantHungarianPrefix of ``On``
2101 Identifies and/or transforms static constant names as follows:
2107 static unsigned const MyConstStatic_array[] = {1, 2, 3};
2113 static unsigned const pre_myconststatic_array_post[] = {1, 2, 3};
2115 .. option:: StaticVariableCase
2117 When defined, the check will ensure static variable names conform to the
2120 .. option:: StaticVariablePrefix
2122 When defined, the check will ensure static variable names will add the
2123 prefixed with the given value (regardless of casing).
2125 .. option:: StaticVariableIgnoredRegexp
2127 Identifier naming checks won't be enforced for static variable names
2128 matching this regular expression.
2130 .. option:: StaticVariableSuffix
2132 When defined, the check will ensure static variable names will add the
2133 suffix with the given value (regardless of casing).
2135 .. option:: StaticVariableHungarianPrefix
2137 When enabled, the check ensures that the declared identifier will
2138 have a Hungarian notation prefix based on the declared type.
2140 For example using values of:
2142 - StaticVariableCase of ``lower_case``
2143 - StaticVariablePrefix of ``pre_``
2144 - StaticVariableSuffix of ``_post``
2145 - StaticVariableHungarianPrefix of ``On``
2147 Identifies and/or transforms static variable names as follows:
2153 static unsigned MyStatic_array[] = {1, 2, 3};
2159 static unsigned pre_mystatic_array_post[] = {1, 2, 3};
2161 .. option:: StructCase
2163 When defined, the check will ensure struct names conform to the
2166 .. option:: StructPrefix
2168 When defined, the check will ensure struct names will add the
2169 prefixed with the given value (regardless of casing).
2171 .. option:: StructIgnoredRegexp
2173 Identifier naming checks won't be enforced for struct names
2174 matching this regular expression.
2176 .. option:: StructSuffix
2178 When defined, the check will ensure struct names will add the
2179 suffix with the given value (regardless of casing).
2181 For example using values of:
2183 - StructCase of ``lower_case``
2184 - StructPrefix of ``pre_``
2185 - StructSuffix of ``_post``
2187 Identifies and/or transforms struct names as follows:
2202 struct pre_foo_post {
2207 .. option:: TemplateParameterCase
2209 When defined, the check will ensure template parameter names conform to the
2212 .. option:: TemplateParameterPrefix
2214 When defined, the check will ensure template parameter names will add the
2215 prefixed with the given value (regardless of casing).
2217 .. option:: TemplateParameterIgnoredRegexp
2219 Identifier naming checks won't be enforced for template parameter names
2220 matching this regular expression.
2222 .. option:: TemplateParameterSuffix
2224 When defined, the check will ensure template parameter names will add the
2225 suffix with the given value (regardless of casing).
2227 For example using values of:
2229 - TemplateParameterCase of ``lower_case``
2230 - TemplateParameterPrefix of ``pre_``
2231 - TemplateParameterSuffix of ``_post``
2233 Identifies and/or transforms template parameter names as follows:
2239 template <typename T> class Foo {};
2245 template <typename pre_t_post> class Foo {};
2247 .. option:: TemplateTemplateParameterCase
2249 When defined, the check will ensure template template parameter names conform to the
2252 .. option:: TemplateTemplateParameterPrefix
2254 When defined, the check will ensure template template parameter names will add the
2255 prefixed with the given value (regardless of casing).
2257 .. option:: TemplateTemplateParameterIgnoredRegexp
2259 Identifier naming checks won't be enforced for template template parameter
2260 names matching this regular expression.
2262 .. option:: TemplateTemplateParameterSuffix
2264 When defined, the check will ensure template template parameter names will add the
2265 suffix with the given value (regardless of casing).
2267 For example using values of:
2269 - TemplateTemplateParameterCase of ``lower_case``
2270 - TemplateTemplateParameterPrefix of ``pre_``
2271 - TemplateTemplateParameterSuffix of ``_post``
2273 Identifies and/or transforms template template parameter names as follows:
2279 template <template <typename> class TPL_parameter, int COUNT_params,
2280 typename... TYPE_parameters>
2286 template <template <typename> class pre_tpl_parameter_post, int COUNT_params,
2287 typename... TYPE_parameters>
2289 .. option:: TypeAliasCase
2291 When defined, the check will ensure type alias names conform to the
2294 .. option:: TypeAliasPrefix
2296 When defined, the check will ensure type alias names will add the
2297 prefixed with the given value (regardless of casing).
2299 .. option:: TypeAliasIgnoredRegexp
2301 Identifier naming checks won't be enforced for type alias names
2302 matching this regular expression.
2304 .. option:: TypeAliasSuffix
2306 When defined, the check will ensure type alias names will add the
2307 suffix with the given value (regardless of casing).
2309 For example using values of:
2311 - TypeAliasCase of ``lower_case``
2312 - TypeAliasPrefix of ``pre_``
2313 - TypeAliasSuffix of ``_post``
2315 Identifies and/or transforms type alias names as follows:
2321 using MY_STRUCT_TYPE = my_structure;
2327 using pre_my_struct_type_post = my_structure;
2329 .. option:: TypedefCase
2331 When defined, the check will ensure typedef names conform to the
2334 .. option:: TypedefPrefix
2336 When defined, the check will ensure typedef names will add the
2337 prefixed with the given value (regardless of casing).
2339 .. option:: TypedefIgnoredRegexp
2341 Identifier naming checks won't be enforced for typedef names
2342 matching this regular expression.
2344 .. option:: TypedefSuffix
2346 When defined, the check will ensure typedef names will add the
2347 suffix with the given value (regardless of casing).
2349 For example using values of:
2351 - TypedefCase of ``lower_case``
2352 - TypedefPrefix of ``pre_``
2353 - TypedefSuffix of ``_post``
2355 Identifies and/or transforms typedef names as follows:
2367 typedef int pre_myint_post;
2369 .. option:: TypeTemplateParameterCase
2371 When defined, the check will ensure type template parameter names conform to the
2374 .. option:: TypeTemplateParameterPrefix
2376 When defined, the check will ensure type template parameter names will add the
2377 prefixed with the given value (regardless of casing).
2379 .. option:: TypeTemplateParameterIgnoredRegexp
2381 Identifier naming checks won't be enforced for type template names
2382 matching this regular expression.
2384 .. option:: TypeTemplateParameterSuffix
2386 When defined, the check will ensure type template parameter names will add the
2387 suffix with the given value (regardless of casing).
2389 For example using values of:
2391 - TypeTemplateParameterCase of ``lower_case``
2392 - TypeTemplateParameterPrefix of ``pre_``
2393 - TypeTemplateParameterSuffix of ``_post``
2395 Identifies and/or transforms type template parameter names as follows:
2401 template <template <typename> class TPL_parameter, int COUNT_params,
2402 typename... TYPE_parameters>
2408 template <template <typename> class TPL_parameter, int COUNT_params,
2409 typename... pre_type_parameters_post>
2411 .. option:: UnionCase
2413 When defined, the check will ensure union names conform to the
2416 .. option:: UnionPrefix
2418 When defined, the check will ensure union names will add the
2419 prefixed with the given value (regardless of casing).
2421 .. option:: UnionIgnoredRegexp
2423 Identifier naming checks won't be enforced for union names
2424 matching this regular expression.
2426 .. option:: UnionSuffix
2428 When defined, the check will ensure union names will add the
2429 suffix with the given value (regardless of casing).
2431 For example using values of:
2433 - UnionCase of ``lower_case``
2434 - UnionPrefix of ``pre_``
2435 - UnionSuffix of ``_post``
2437 Identifies and/or transforms union names as follows:
2452 union pre_foo_post {
2457 .. option:: ValueTemplateParameterCase
2459 When defined, the check will ensure value template parameter names conform to the
2462 .. option:: ValueTemplateParameterPrefix
2464 When defined, the check will ensure value template parameter names will add the
2465 prefixed with the given value (regardless of casing).
2467 .. option:: ValueTemplateParameterIgnoredRegexp
2469 Identifier naming checks won't be enforced for value template parameter
2470 names matching this regular expression.
2472 .. option:: ValueTemplateParameterSuffix
2474 When defined, the check will ensure value template parameter names will add the
2475 suffix with the given value (regardless of casing).
2477 For example using values of:
2479 - ValueTemplateParameterCase of ``lower_case``
2480 - ValueTemplateParameterPrefix of ``pre_``
2481 - ValueTemplateParameterSuffix of ``_post``
2483 Identifies and/or transforms value template parameter names as follows:
2489 template <template <typename> class TPL_parameter, int COUNT_params,
2490 typename... TYPE_parameters>
2496 template <template <typename> class TPL_parameter, int pre_count_params_post,
2497 typename... TYPE_parameters>
2499 .. option:: VariableCase
2501 When defined, the check will ensure variable names conform to the
2504 .. option:: VariablePrefix
2506 When defined, the check will ensure variable names will add the
2507 prefixed with the given value (regardless of casing).
2509 .. option:: VariableIgnoredRegexp
2511 Identifier naming checks won't be enforced for variable names
2512 matching this regular expression.
2514 .. option:: VariableSuffix
2516 When defined, the check will ensure variable names will add the
2517 suffix with the given value (regardless of casing).
2519 .. option:: VariableHungarianPrefix
2521 When enabled, the check ensures that the declared identifier will
2522 have a Hungarian notation prefix based on the declared type.
2524 For example using values of:
2526 - VariableCase of ``lower_case``
2527 - VariablePrefix of ``pre_``
2528 - VariableSuffix of ``_post``
2529 - VariableHungarianPrefix of ``On``
2531 Identifies and/or transforms variable names as follows:
2537 unsigned MyVariable;
2543 unsigned pre_myvariable_post;
2545 .. option:: VirtualMethodCase
2547 When defined, the check will ensure virtual method names conform to the
2550 .. option:: VirtualMethodPrefix
2552 When defined, the check will ensure virtual method names will add the
2553 prefixed with the given value (regardless of casing).
2555 .. option:: VirtualMethodIgnoredRegexp
2557 Identifier naming checks won't be enforced for virtual method names
2558 matching this regular expression.
2560 .. option:: VirtualMethodSuffix
2562 When defined, the check will ensure virtual method names will add the
2563 suffix with the given value (regardless of casing).
2565 For example using values of:
2567 - VirtualMethodCase of ``lower_case``
2568 - VirtualMethodPrefix of ``pre_``
2569 - VirtualMethodSuffix of ``_post``
2571 Identifies and/or transforms virtual method names as follows:
2579 virtual int MemberFunction();
2588 virtual int pre_member_function_post();
2592 The default mapping table of Hungarian Notation
2593 -----------------------------------------------
2595 In Hungarian notation, a variable name starts with a group of lower-case
2596 letters which are mnemonics for the type or purpose of that variable, followed
2597 by whatever name the programmer has chosen; this last part is sometimes
2598 distinguished as the given name. The first character of the given name can be
2599 capitalized to separate it from the type indicators (see also CamelCase).
2600 Otherwise the case of this character denotes scope.
2602 The following table is the default mapping table of Hungarian Notation which
2603 maps Decl to its prefix string. You can also have your own style in config file.
2605 ================= ============== ====================== ============== ============== ==============
2606 Primitive Type Microsoft Type
2607 ----------------- -------------- ---------------------- -------------- -------------- --------------
2608 Type Prefix Type Prefix Type Prefix
2609 ================= ============== ====================== ============== ============== ==============
2610 int8_t i8 signed int si BOOL b
2611 int16_t i16 signed short ss BOOLEAN b
2612 int32_t i32 signed short int ssi BYTE by
2613 int64_t i64 signed long long int slli CHAR c
2614 uint8_t u8 signed long long sll UCHAR uc
2615 uint16_t u16 signed long int sli SHORT s
2616 uint32_t u32 signed long sl USHORT us
2617 uint64_t u64 signed s WORD w
2618 char8_t c8 unsigned long long int ulli DWORD dw
2619 char16_t c16 unsigned long long ull DWORD32 dw32
2620 char32_t c32 unsigned long int uli DWORD64 dw64
2621 float f unsigned long ul LONG l
2622 double d unsigned short int usi ULONG ul
2623 char c unsigned short us ULONG32 ul32
2624 bool b unsigned int ui ULONG64 ul64
2625 _Bool b unsigned char uc ULONGLONG ull
2626 int i unsigned u HANDLE h
2627 size_t n long long int lli INT i
2628 short s long double ld INT8 i8
2629 signed i long long ll INT16 i16
2630 unsigned u long int li INT32 i32
2631 long l long l INT64 i64
2632 long long ll ptrdiff_t p UINT ui
2633 unsigned long ul void *none* UINT8 u8
2634 long double ld UINT16 u16
2635 ptrdiff_t p UINT32 u32
2636 wchar_t wc UINT64 u64
2637 short int si PVOID p
2639 ================= ============== ====================== ============== ============== ==============
2641 **There are more trivial options for Hungarian Notation:**
2643 **HungarianNotation.General.***
2644 Options are not belonging to any specific Decl.
2646 **HungarianNotation.CString.***
2647 Options for NULL-terminated string.
2649 **HungarianNotation.DerivedType.***
2650 Options for derived types.
2652 **HungarianNotation.PrimitiveType.***
2653 Options for primitive types.
2655 **HungarianNotation.UserDefinedType.***
2656 Options for user-defined types.
2659 Options for Hungarian Notation
2660 ------------------------------
2662 - :option:`HungarianNotation.General.TreatStructAsClass`
2664 - :option:`HungarianNotation.DerivedType.Array`
2665 - :option:`HungarianNotation.DerivedType.Pointer`
2666 - :option:`HungarianNotation.DerivedType.FunctionPointer`
2668 - :option:`HungarianNotation.CString.CharPointer`
2669 - :option:`HungarianNotation.CString.CharArray`
2670 - :option:`HungarianNotation.CString.WideCharPointer`
2671 - :option:`HungarianNotation.CString.WideCharArray`
2673 - :option:`HungarianNotation.PrimitiveType.*`
2674 - :option:`HungarianNotation.UserDefinedType.*`
2676 .. option:: HungarianNotation.General.TreatStructAsClass
2678 When defined, the check will treat naming of struct as a class.
2679 The default value is `false`.
2681 .. option:: HungarianNotation.DerivedType.Array
2683 When defined, the check will ensure variable name will add the prefix with
2684 the given string. The default prefix is `a`.
2686 .. option:: HungarianNotation.DerivedType.Pointer
2688 When defined, the check will ensure variable name will add the prefix with
2689 the given string. The default prefix is `p`.
2691 .. option:: HungarianNotation.DerivedType.FunctionPointer
2693 When defined, the check will ensure variable name will add the prefix with
2694 the given string. The default prefix is `fn`.
2702 int DataArray[2] = {0};
2705 void *DataBuffer = NULL;
2708 typedef void (*FUNC_PTR)();
2709 FUNC_PTR FuncPtr = NULL;
2716 int aDataArray[2] = {0};
2719 void *pDataBuffer = NULL;
2722 typedef void (*FUNC_PTR)();
2723 FUNC_PTR fnFuncPtr = NULL;
2726 .. option:: HungarianNotation.CString.CharPointer
2728 When defined, the check will ensure variable name will add the prefix with
2729 the given string. The default prefix is `sz`.
2731 .. option:: HungarianNotation.CString.CharArray
2733 When defined, the check will ensure variable name will add the prefix with
2734 the given string. The default prefix is `sz`.
2736 .. option:: HungarianNotation.CString.WideCharPointer
2738 When defined, the check will ensure variable name will add the prefix with
2739 the given string. The default prefix is `wsz`.
2741 .. option:: HungarianNotation.CString.WideCharArray
2743 When defined, the check will ensure variable name will add the prefix with
2744 the given string. The default prefix is `wsz`.
2752 const char *NamePtr = "Name";
2755 const char NameArray[] = "Name";
2758 const wchar_t *WideNamePtr = L"Name";
2761 const wchar_t WideNameArray[] = L"Name";
2768 const char *szNamePtr = "Name";
2771 const char szNameArray[] = "Name";
2774 const wchar_t *wszWideNamePtr = L"Name";
2777 const wchar_t wszWideNameArray[] = L"Name";
2780 .. option:: HungarianNotation.PrimitiveType.*
2782 When defined, the check will ensure variable name of involved primitive
2783 types will add the prefix with the given string. The default prefixes are
2784 defined in the default mapping table.
2786 .. option:: HungarianNotation.UserDefinedType.*
2788 When defined, the check will ensure variable name of involved primitive
2789 types will add the prefix with the given string. The default prefixes are
2790 defined in the default mapping table.
2798 int16_t ValueI16 = 0;
2799 int32_t ValueI32 = 0;
2800 int64_t ValueI64 = 0;
2801 uint8_t ValueU8 = 0;
2802 uint16_t ValueU16 = 0;
2803 uint32_t ValueU32 = 0;
2804 uint64_t ValueU64 = 0;
2805 float ValueFloat = 0.0;
2806 double ValueDouble = 0.0;
2807 ULONG ValueUlong = 0;
2808 DWORD ValueDword = 0;
2814 int8_t i8ValueI8 = 0;
2815 int16_t i16ValueI16 = 0;
2816 int32_t i32ValueI32 = 0;
2817 int64_t i64ValueI64 = 0;
2818 uint8_t u8ValueU8 = 0;
2819 uint16_t u16ValueU16 = 0;
2820 uint32_t u32ValueU32 = 0;
2821 uint64_t u64ValueU64 = 0;
2822 float fValueFloat = 0.0;
2823 double dValueDouble = 0.0;
2824 ULONG ulValueUlong = 0;
2825 DWORD dwValueDword = 0;