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``,
22 It also supports a fixed prefix and suffix that will be prepended or appended
23 to the identifiers, regardless of the casing.
25 Many configuration options are available, in order to be able to create
26 different rules for different kinds of identifiers. In general, the rules are
27 falling back to a more generic rule if the specific case is not configured.
29 The naming of virtual methods is reported where they occur in the base class,
30 but not where they are overridden, as it can't be fixed locally there.
31 This also applies for pseudo-override patterns like CRTP.
36 The following options are described below:
38 - :option:`AbstractClassCase`, :option:`AbstractClassPrefix`, :option:`AbstractClassSuffix`, :option:`AbstractClassIgnoredRegexp`, :option:`AbstractClassHungarianPrefix`
39 - :option:`AggressiveDependentMemberLookup`
40 - :option:`ClassCase`, :option:`ClassPrefix`, :option:`ClassSuffix`, :option:`ClassIgnoredRegexp`, :option:`ClassHungarianPrefix`
41 - :option:`ClassConstantCase`, :option:`ClassConstantPrefix`, :option:`ClassConstantSuffix`, :option:`ClassConstantIgnoredRegexp`, :option:`ClassConstantHungarianPrefix`
42 - :option:`ClassMemberCase`, :option:`ClassMemberPrefix`, :option:`ClassMemberSuffix`, :option:`ClassMemberIgnoredRegexp`, :option:`ClassMemberHungarianPrefix`
43 - :option:`ClassMethodCase`, :option:`ClassMethodPrefix`, :option:`ClassMethodSuffix`, :option:`ClassMethodIgnoredRegexp`
44 - :option:`ConstantCase`, :option:`ConstantPrefix`, :option:`ConstantSuffix`, :option:`ConstantIgnoredRegexp`, :option:`ConstantHungarianPrefix`
45 - :option:`ConstantMemberCase`, :option:`ConstantMemberPrefix`, :option:`ConstantMemberSuffix`, :option:`ConstantMemberIgnoredRegexp`, :option:`ConstantMemberHungarianPrefix`
46 - :option:`ConstantParameterCase`, :option:`ConstantParameterPrefix`, :option:`ConstantParameterSuffix`, :option:`ConstantParameterIgnoredRegexp`, :option:`ConstantParameterHungarianPrefix`
47 - :option:`ConstantPointerParameterCase`, :option:`ConstantPointerParameterPrefix`, :option:`ConstantPointerParameterSuffix`, :option:`ConstantPointerParameterIgnoredRegexp`, :option:`ConstantPointerParameterHungarianPrefix`
48 - :option:`ConstexprFunctionCase`, :option:`ConstexprFunctionPrefix`, :option:`ConstexprFunctionSuffix`, :option:`ConstexprFunctionIgnoredRegexp`
49 - :option:`ConstexprMethodCase`, :option:`ConstexprMethodPrefix`, :option:`ConstexprMethodSuffix`, :option:`ConstexprMethodIgnoredRegexp`
50 - :option:`ConstexprVariableCase`, :option:`ConstexprVariablePrefix`, :option:`ConstexprVariableSuffix`, :option:`ConstexprVariableIgnoredRegexp`, :option:`ConstexprVariableHungarianPrefix`
51 - :option:`EnumCase`, :option:`EnumPrefix`, :option:`EnumSuffix`, :option:`EnumIgnoredRegexp`
52 - :option:`EnumConstantCase`, :option:`EnumConstantPrefix`, :option:`EnumConstantSuffix`, :option:`EnumConstantIgnoredRegexp`, :option:`EnumConstantHungarianPrefix`
53 - :option:`FunctionCase`, :option:`FunctionPrefix`, :option:`FunctionSuffix`, :option:`FunctionIgnoredRegexp`
54 - :option:`GetConfigPerFile`
55 - :option:`GlobalConstantCase`, :option:`GlobalConstantPrefix`, :option:`GlobalConstantSuffix`, :option:`GlobalConstantIgnoredRegexp`, :option:`GlobalConstantHungarianPrefix`
56 - :option:`GlobalConstantPointerCase`, :option:`GlobalConstantPointerPrefix`, :option:`GlobalConstantPointerSuffix`, :option:`GlobalConstantPointerIgnoredRegexp`, :option:`GlobalConstantPointerHungarianPrefix`
57 - :option:`GlobalFunctionCase`, :option:`GlobalFunctionPrefix`, :option:`GlobalFunctionSuffix`, :option:`GlobalFunctionIgnoredRegexp`
58 - :option:`GlobalPointerCase`, :option:`GlobalPointerPrefix`, :option:`GlobalPointerSuffix`, :option:`GlobalPointerIgnoredRegexp`, :option:`GlobalPointerHungarianPrefix`
59 - :option:`GlobalVariableCase`, :option:`GlobalVariablePrefix`, :option:`GlobalVariableSuffix`, :option:`GlobalVariableIgnoredRegexp`, :option:`GlobalVariableHungarianPrefix`
60 - :option:`IgnoreMainLikeFunctions`
61 - :option:`InlineNamespaceCase`, :option:`InlineNamespacePrefix`, :option:`InlineNamespaceSuffix`, :option:`InlineNamespaceIgnoredRegexp`
62 - :option:`LocalConstantCase`, :option:`LocalConstantPrefix`, :option:`LocalConstantSuffix`, :option:`LocalConstantIgnoredRegexp`, :option:`LocalConstantHungarianPrefix`
63 - :option:`LocalConstantPointerCase`, :option:`LocalConstantPointerPrefix`, :option:`LocalConstantPointerSuffix`, :option:`LocalConstantPointerIgnoredRegexp`, :option:`LocalConstantPointerHungarianPrefix`
64 - :option:`LocalPointerCase`, :option:`LocalPointerPrefix`, :option:`LocalPointerSuffix`, :option:`LocalPointerIgnoredRegexp`, :option:`LocalPointerHungarianPrefix`
65 - :option:`LocalVariableCase`, :option:`LocalVariablePrefix`, :option:`LocalVariableSuffix`, :option:`LocalVariableIgnoredRegexp`, :option:`LocalVariableHungarianPrefix`
66 - :option:`MacroDefinitionCase`, :option:`MacroDefinitionPrefix`, :option:`MacroDefinitionSuffix`, :option:`MacroDefinitionIgnoredRegexp`
67 - :option:`MemberCase`, :option:`MemberPrefix`, :option:`MemberSuffix`, :option:`MemberIgnoredRegexp`, :option:`MemberHungarianPrefix`
68 - :option:`MethodCase`, :option:`MethodPrefix`, :option:`MethodSuffix`, :option:`MethodIgnoredRegexp`
69 - :option:`NamespaceCase`, :option:`NamespacePrefix`, :option:`NamespaceSuffix`, :option:`NamespaceIgnoredRegexp`
70 - :option:`ParameterCase`, :option:`ParameterPrefix`, :option:`ParameterSuffix`, :option:`ParameterIgnoredRegexp`, :option:`ParameterHungarianPrefix`
71 - :option:`ParameterPackCase`, :option:`ParameterPackPrefix`, :option:`ParameterPackSuffix`, :option:`ParameterPackIgnoredRegexp`
72 - :option:`PointerParameterCase`, :option:`PointerParameterPrefix`, :option:`PointerParameterSuffix`, :option:`PointerParameterIgnoredRegexp`, :option:`PointerParameterHungarianPrefix`
73 - :option:`PrivateMemberCase`, :option:`PrivateMemberPrefix`, :option:`PrivateMemberSuffix`, :option:`PrivateMemberIgnoredRegexp`, :option:`PrivateMemberHungarianPrefix`
74 - :option:`PrivateMethodCase`, :option:`PrivateMethodPrefix`, :option:`PrivateMethodSuffix`, :option:`PrivateMethodIgnoredRegexp`
75 - :option:`ProtectedMemberCase`, :option:`ProtectedMemberPrefix`, :option:`ProtectedMemberSuffix`, :option:`ProtectedMemberIgnoredRegexp`, :option:`ProtectedMemberHungarianPrefix`
76 - :option:`ProtectedMethodCase`, :option:`ProtectedMethodPrefix`, :option:`ProtectedMethodSuffix`, :option:`ProtectedMethodIgnoredRegexp`
77 - :option:`PublicMemberCase`, :option:`PublicMemberPrefix`, :option:`PublicMemberSuffix`, :option:`PublicMemberIgnoredRegexp`, :option:`PublicMemberHungarianPrefix`
78 - :option:`PublicMethodCase`, :option:`PublicMethodPrefix`, :option:`PublicMethodSuffix`, :option:`PublicMethodIgnoredRegexp`
79 - :option:`ScopedEnumConstantCase`, :option:`ScopedEnumConstantPrefix`, :option:`ScopedEnumConstantSuffix`, :option:`ScopedEnumConstantIgnoredRegexp`
80 - :option:`StaticConstantCase`, :option:`StaticConstantPrefix`, :option:`StaticConstantSuffix`, :option:`StaticConstantIgnoredRegexp`, :option:`StaticConstantHungarianPrefix`
81 - :option:`StaticVariableCase`, :option:`StaticVariablePrefix`, :option:`StaticVariableSuffix`, :option:`StaticVariableIgnoredRegexp`, :option:`StaticVariableHungarianPrefix`
82 - :option:`StructCase`, :option:`StructPrefix`, :option:`StructSuffix`, :option:`StructIgnoredRegexp`
83 - :option:`TemplateParameterCase`, :option:`TemplateParameterPrefix`, :option:`TemplateParameterSuffix`, :option:`TemplateParameterIgnoredRegexp`
84 - :option:`TemplateTemplateParameterCase`, :option:`TemplateTemplateParameterPrefix`, :option:`TemplateTemplateParameterSuffix`, :option:`TemplateTemplateParameterIgnoredRegexp`
85 - :option:`TypeAliasCase`, :option:`TypeAliasPrefix`, :option:`TypeAliasSuffix`, :option:`TypeAliasIgnoredRegexp`
86 - :option:`TypedefCase`, :option:`TypedefPrefix`, :option:`TypedefSuffix`, :option:`TypedefIgnoredRegexp`
87 - :option:`TypeTemplateParameterCase`, :option:`TypeTemplateParameterPrefix`, :option:`TypeTemplateParameterSuffix`, :option:`TypeTemplateParameterIgnoredRegexp`
88 - :option:`UnionCase`, :option:`UnionPrefix`, :option:`UnionSuffix`, :option:`UnionIgnoredRegexp`
89 - :option:`ValueTemplateParameterCase`, :option:`ValueTemplateParameterPrefix`, :option:`ValueTemplateParameterSuffix`, :option:`ValueTemplateParameterIgnoredRegexp`
90 - :option:`VariableCase`, :option:`VariablePrefix`, :option:`VariableSuffix`, :option:`VariableIgnoredRegexp`, :option:`VariableHungarianPrefix`
91 - :option:`VirtualMethodCase`, :option:`VirtualMethodPrefix`, :option:`VirtualMethodSuffix`, :option:`VirtualMethodIgnoredRegexp`
93 .. option:: AbstractClassCase
95 When defined, the check will ensure abstract class names conform to the
98 .. option:: AbstractClassPrefix
100 When defined, the check will ensure abstract class names will add the
101 prefixed with the given value (regardless of casing).
103 .. option:: AbstractClassIgnoredRegexp
105 Identifier naming checks won't be enforced for abstract class names
106 matching this regular expression.
108 .. option:: AbstractClassSuffix
110 When defined, the check will ensure abstract class names will add the
111 suffix with the given value (regardless of casing).
113 .. option:: AbstractClassHungarianPrefix
115 When enabled, the check ensures that the declared identifier will
116 have a Hungarian notation prefix based on the declared type.
118 For example using values of:
120 - AbstractClassCase of ``lower_case``
121 - AbstractClassPrefix of ``pre_``
122 - AbstractClassSuffix of ``_post``
123 - AbstractClassHungarianPrefix of ``On``
126 Identifies and/or transforms abstract class names as follows:
132 class ABSTRACT_CLASS {
141 class pre_abstract_class_post {
143 pre_abstract_class_post();
146 .. option:: AggressiveDependentMemberLookup
148 When set to `true` the check will look in dependent base classes for dependent
149 member references that need changing. This can lead to errors with template
150 specializations so the default value is `false`.
152 For example using values of:
154 - ClassMemberCase of ``lower_case``
160 template <typename T>
165 template <typename T>
166 struct Derived : Base<T> {
168 this->BadNamedMember = 0;
172 After if AggressiveDependentMemberLookup is `false`:
176 template <typename T>
181 template <typename T>
182 struct Derived : Base<T> {
184 this->BadNamedMember = 0;
188 After if AggressiveDependentMemberLookup is `true`:
192 template <typename T>
197 template <typename T>
198 struct Derived : Base<T> {
200 this->bad_named_member = 0;
204 .. option:: ClassCase
206 When defined, the check will ensure class names conform to the
209 .. option:: ClassPrefix
211 When defined, the check will ensure class names will add the
212 prefixed with the given value (regardless of casing).
214 .. option:: ClassIgnoredRegexp
216 Identifier naming checks won't be enforced for class names matching
217 this regular expression.
219 .. option:: ClassSuffix
221 When defined, the check will ensure class names will add the
222 suffix with the given value (regardless of casing).
224 .. option:: ClassHungarianPrefix
226 When enabled, the check ensures that the declared identifier will
227 have a Hungarian notation prefix based on the declared type.
229 For example using values of:
231 - ClassCase of ``lower_case``
232 - ClassPrefix of ``pre_``
233 - ClassSuffix of ``_post``
234 - ClassHungarianPrefix of ``On``
236 Identifies and/or transforms class names as follows:
258 .. option:: ClassConstantCase
260 When defined, the check will ensure class constant names conform to the
263 .. option:: ClassConstantPrefix
265 When defined, the check will ensure class constant names will add the
266 prefixed with the given value (regardless of casing).
268 .. option:: ClassConstantIgnoredRegexp
270 Identifier naming checks won't be enforced for class constant names
271 matching this regular expression.
273 .. option:: ClassConstantSuffix
275 When defined, the check will ensure class constant names will add the
276 suffix with the given value (regardless of casing).
278 .. option:: ClassConstantHungarianPrefix
280 When enabled, the check ensures that the declared identifier will
281 have a Hungarian notation prefix based on the declared type.
283 For example using values of:
285 - ClassConstantCase of ``lower_case``
286 - ClassConstantPrefix of ``pre_``
287 - ClassConstantSuffix of ``_post``
288 - ClassConstantHungarianPrefix of ``On``
290 Identifies and/or transforms class constant names as follows:
298 static const int CLASS_CONSTANT;
307 static const int pre_class_constant_post;
310 .. option:: ClassMemberCase
312 When defined, the check will ensure class member names conform to the
315 .. option:: ClassMemberPrefix
317 When defined, the check will ensure class member names will add the
318 prefixed with the given value (regardless of casing).
320 .. option:: ClassMemberIgnoredRegexp
322 Identifier naming checks won't be enforced for class member names
323 matching this regular expression.
325 .. option:: ClassMemberSuffix
327 When defined, the check will ensure class member names will add the
328 suffix with the given value (regardless of casing).
330 .. option:: ClassMemberHungarianPrefix
332 When enabled, the check ensures that the declared identifier will
333 have a Hungarian notation prefix based on the declared type.
335 For example using values of:
337 - ClassMemberCase of ``lower_case``
338 - ClassMemberPrefix of ``pre_``
339 - ClassMemberSuffix of ``_post``
340 - ClassMemberHungarianPrefix of ``On``
342 Identifies and/or transforms class member names as follows:
350 static int CLASS_CONSTANT;
359 static int pre_class_constant_post;
362 .. option:: ClassMethodCase
364 When defined, the check will ensure class method names conform to the
367 .. option:: ClassMethodPrefix
369 When defined, the check will ensure class method names will add the
370 prefixed with the given value (regardless of casing).
372 .. option:: ClassMethodIgnoredRegexp
374 Identifier naming checks won't be enforced for class method names
375 matching this regular expression.
377 .. option:: ClassMethodSuffix
379 When defined, the check will ensure class method names will add the
380 suffix with the given value (regardless of casing).
382 For example using values of:
384 - ClassMethodCase of ``lower_case``
385 - ClassMethodPrefix of ``pre_``
386 - ClassMethodSuffix of ``_post``
388 Identifies and/or transforms class method names as follows:
405 int pre_class_member_post();
408 .. option:: ConstantCase
410 When defined, the check will ensure constant names conform to the
413 .. option:: ConstantPrefix
415 When defined, the check will ensure constant names will add the
416 prefixed with the given value (regardless of casing).
418 .. option:: ConstantIgnoredRegexp
420 Identifier naming checks won't be enforced for constant names
421 matching this regular expression.
423 .. option:: ConstantSuffix
425 When defined, the check will ensure constant names will add the
426 suffix with the given value (regardless of casing).
428 .. option:: ConstantHungarianPrefix
430 When enabled, the check ensures that the declared identifier will
431 have a Hungarian notation prefix based on the declared type.
433 For example using values of:
435 - ConstantCase of ``lower_case``
436 - ConstantPrefix of ``pre_``
437 - ConstantSuffix of ``_post``
438 - ConstantHungarianPrefix of ``On``
440 Identifies and/or transforms constant names as follows:
446 void function() { unsigned const MyConst_array[] = {1, 2, 3}; }
452 void function() { unsigned const pre_myconst_array_post[] = {1, 2, 3}; }
454 .. option:: ConstantMemberCase
456 When defined, the check will ensure constant member names conform to the
459 .. option:: ConstantMemberPrefix
461 When defined, the check will ensure constant member names will add the
462 prefixed with the given value (regardless of casing).
464 .. option:: ConstantMemberIgnoredRegexp
466 Identifier naming checks won't be enforced for constant member names
467 matching this regular expression.
469 .. option:: ConstantMemberSuffix
471 When defined, the check will ensure constant member names will add the
472 suffix with the given value (regardless of casing).
474 .. option:: ConstantMemberHungarianPrefix
476 When enabled, the check ensures that the declared identifier will
477 have a Hungarian notation prefix based on the declared type.
479 For example using values of:
481 - ConstantMemberCase of ``lower_case``
482 - ConstantMemberPrefix of ``pre_``
483 - ConstantMemberSuffix of ``_post``
484 - ConstantMemberHungarianPrefix of ``On``
486 Identifies and/or transforms constant member names as follows:
493 char const MY_ConstMember_string[4] = "123";
501 char const pre_my_constmember_string_post[4] = "123";
504 .. option:: ConstantParameterCase
506 When defined, the check will ensure constant parameter names conform to the
509 .. option:: ConstantParameterPrefix
511 When defined, the check will ensure constant parameter names will add the
512 prefixed with the given value (regardless of casing).
514 .. option:: ConstantParameterIgnoredRegexp
516 Identifier naming checks won't be enforced for constant parameter names
517 matching this regular expression.
519 .. option:: ConstantParameterSuffix
521 When defined, the check will ensure constant parameter names will add the
522 suffix with the given value (regardless of casing).
524 .. option:: ConstantParameterHungarianPrefix
526 When enabled, the check ensures that the declared identifier will
527 have a Hungarian notation prefix based on the declared type.
529 For example using values of:
531 - ConstantParameterCase of ``lower_case``
532 - ConstantParameterPrefix of ``pre_``
533 - ConstantParameterSuffix of ``_post``
534 - ConstantParameterHungarianPrefix of ``On``
536 Identifies and/or transforms constant parameter names as follows:
542 void GLOBAL_FUNCTION(int PARAMETER_1, int const CONST_parameter);
548 void GLOBAL_FUNCTION(int PARAMETER_1, int const pre_const_parameter_post);
550 .. option:: ConstantPointerParameterCase
552 When defined, the check will ensure constant pointer parameter names conform to the
555 .. option:: ConstantPointerParameterPrefix
557 When defined, the check will ensure constant pointer parameter names will add the
558 prefixed with the given value (regardless of casing).
560 .. option:: ConstantPointerParameterIgnoredRegexp
562 Identifier naming checks won't be enforced for constant pointer parameter
563 names matching this regular expression.
565 .. option:: ConstantPointerParameterSuffix
567 When defined, the check will ensure constant pointer parameter names will add the
568 suffix with the given value (regardless of casing).
570 .. option:: ConstantPointerParameterHungarianPrefix
572 When enabled, the check ensures that the declared identifier will
573 have a Hungarian notation prefix based on the declared type.
575 For example using values of:
577 - ConstantPointerParameterCase of ``lower_case``
578 - ConstantPointerParameterPrefix of ``pre_``
579 - ConstantPointerParameterSuffix of ``_post``
580 - ConstantPointerParameterHungarianPrefix of ``On``
582 Identifies and/or transforms constant pointer parameter names as follows:
588 void GLOBAL_FUNCTION(int const *CONST_parameter);
594 void GLOBAL_FUNCTION(int const *pre_const_parameter_post);
596 .. option:: ConstexprFunctionCase
598 When defined, the check will ensure constexpr function names conform to the
601 .. option:: ConstexprFunctionPrefix
603 When defined, the check will ensure constexpr function names will add the
604 prefixed with the given value (regardless of casing).
606 .. option:: ConstexprFunctionIgnoredRegexp
608 Identifier naming checks won't be enforced for constexpr function names
609 matching this regular expression.
611 .. option:: ConstexprFunctionSuffix
613 When defined, the check will ensure constexpr function names will add the
614 suffix with the given value (regardless of casing).
616 For example using values of:
618 - ConstexprFunctionCase of ``lower_case``
619 - ConstexprFunctionPrefix of ``pre_``
620 - ConstexprFunctionSuffix of ``_post``
622 Identifies and/or transforms constexpr function names as follows:
628 constexpr int CE_function() { return 3; }
634 constexpr int pre_ce_function_post() { return 3; }
636 .. option:: ConstexprMethodCase
638 When defined, the check will ensure constexpr method names conform to the
641 .. option:: ConstexprMethodPrefix
643 When defined, the check will ensure constexpr method names will add the
644 prefixed with the given value (regardless of casing).
646 .. option:: ConstexprMethodIgnoredRegexp
648 Identifier naming checks won't be enforced for constexpr method names
649 matching this regular expression.
651 .. option:: ConstexprMethodSuffix
653 When defined, the check will ensure constexpr method names will add the
654 suffix with the given value (regardless of casing).
656 For example using values of:
658 - ConstexprMethodCase of ``lower_case``
659 - ConstexprMethodPrefix of ``pre_``
660 - ConstexprMethodSuffix of ``_post``
662 Identifies and/or transforms constexpr method names as follows:
670 constexpr int CST_expr_Method() { return 2; }
679 constexpr int pre_cst_expr_method_post() { return 2; }
682 .. option:: ConstexprVariableCase
684 When defined, the check will ensure constexpr variable names conform to the
687 .. option:: ConstexprVariablePrefix
689 When defined, the check will ensure constexpr variable names will add the
690 prefixed with the given value (regardless of casing).
692 .. option:: ConstexprVariableIgnoredRegexp
694 Identifier naming checks won't be enforced for constexpr variable names
695 matching this regular expression.
697 .. option:: ConstexprVariableSuffix
699 When defined, the check will ensure constexpr variable names will add the
700 suffix with the given value (regardless of casing).
702 .. option:: ConstexprVariableHungarianPrefix
704 When enabled, the check ensures that the declared identifier will
705 have a Hungarian notation prefix based on the declared type.
707 For example using values of:
709 - ConstexprVariableCase of ``lower_case``
710 - ConstexprVariablePrefix of ``pre_``
711 - ConstexprVariableSuffix of ``_post``
712 - ConstexprVariableHungarianPrefix of ``On``
714 Identifies and/or transforms constexpr variable names as follows:
720 constexpr int ConstExpr_variable = MyConstant;
726 constexpr int pre_constexpr_variable_post = MyConstant;
730 When defined, the check will ensure enumeration names conform to the
733 .. option:: EnumPrefix
735 When defined, the check will ensure enumeration names will add the
736 prefixed with the given value (regardless of casing).
738 .. option:: EnumIgnoredRegexp
740 Identifier naming checks won't be enforced for enumeration names
741 matching this regular expression.
743 .. option:: EnumSuffix
745 When defined, the check will ensure enumeration names will add the
746 suffix with the given value (regardless of casing).
748 For example using values of:
750 - EnumCase of ``lower_case``
751 - EnumPrefix of ``pre_``
752 - EnumSuffix of ``_post``
754 Identifies and/or transforms enumeration names as follows:
760 enum FOO { One, Two, Three };
766 enum pre_foo_post { One, Two, Three };
768 .. option:: EnumConstantCase
770 When defined, the check will ensure enumeration constant names conform to the
773 .. option:: EnumConstantPrefix
775 When defined, the check will ensure enumeration constant names will add the
776 prefixed with the given value (regardless of casing).
778 .. option:: EnumConstantIgnoredRegexp
780 Identifier naming checks won't be enforced for enumeration constant names
781 matching this regular expression.
783 .. option:: EnumConstantSuffix
785 When defined, the check will ensure enumeration constant names will add the
786 suffix with the given value (regardless of casing).
788 .. option:: EnumConstantHungarianPrefix
790 When enabled, the check ensures that the declared identifier will
791 have a Hungarian notation prefix based on the declared type.
793 For example using values of:
795 - EnumConstantCase of ``lower_case``
796 - EnumConstantPrefix of ``pre_``
797 - EnumConstantSuffix of ``_post``
798 - EnumConstantHungarianPrefix of ``On``
800 Identifies and/or transforms enumeration constant names as follows:
806 enum FOO { One, Two, Three };
812 enum FOO { pre_One_post, pre_Two_post, pre_Three_post };
814 .. option:: FunctionCase
816 When defined, the check will ensure function names conform to the
819 .. option:: FunctionPrefix
821 When defined, the check will ensure function names will add the
822 prefixed with the given value (regardless of casing).
824 .. option:: FunctionIgnoredRegexp
826 Identifier naming checks won't be enforced for function names
827 matching this regular expression.
829 .. option:: FunctionSuffix
831 When defined, the check will ensure function names will add the
832 suffix with the given value (regardless of casing).
834 For example using values of:
836 - FunctionCase of ``lower_case``
837 - FunctionPrefix of ``pre_``
838 - FunctionSuffix of ``_post``
840 Identifies and/or transforms function names as follows:
846 char MY_Function_string();
852 char pre_my_function_string_post();
854 .. option:: GetConfigPerFile
856 When `true` the check will look for the configuration for where an
857 identifier is declared. Useful for when included header files use a
859 Default value is `true`.
861 .. option:: GlobalConstantCase
863 When defined, the check will ensure global constant names conform to the
866 .. option:: GlobalConstantPrefix
868 When defined, the check will ensure global constant names will add the
869 prefixed with the given value (regardless of casing).
871 .. option:: GlobalConstantIgnoredRegexp
873 Identifier naming checks won't be enforced for global constant names
874 matching this regular expression.
876 .. option:: GlobalConstantSuffix
878 When defined, the check will ensure global constant names will add the
879 suffix with the given value (regardless of casing).
881 .. option:: GlobalConstantHungarianPrefix
883 When enabled, the check ensures that the declared identifier will
884 have a Hungarian notation prefix based on the declared type.
886 For example using values of:
888 - GlobalConstantCase of ``lower_case``
889 - GlobalConstantPrefix of ``pre_``
890 - GlobalConstantSuffix of ``_post``
891 - GlobalConstantHungarianPrefix of ``On``
893 Identifies and/or transforms global constant names as follows:
899 unsigned const MyConstGlobal_array[] = {1, 2, 3};
905 unsigned const pre_myconstglobal_array_post[] = {1, 2, 3};
907 .. option:: GlobalConstantPointerCase
909 When defined, the check will ensure global constant pointer names conform to the
912 .. option:: GlobalConstantPointerPrefix
914 When defined, the check will ensure global constant pointer names will add the
915 prefixed with the given value (regardless of casing).
917 .. option:: GlobalConstantPointerIgnoredRegexp
919 Identifier naming checks won't be enforced for global constant pointer
920 names matching this regular expression.
922 .. option:: GlobalConstantPointerSuffix
924 When defined, the check will ensure global constant pointer names will add the
925 suffix with the given value (regardless of casing).
927 .. option:: GlobalConstantPointerHungarianPrefix
929 When enabled, the check ensures that the declared identifier will
930 have a Hungarian notation prefix based on the declared type.
932 For example using values of:
934 - GlobalConstantPointerCase of ``lower_case``
935 - GlobalConstantPointerPrefix of ``pre_``
936 - GlobalConstantPointerSuffix of ``_post``
937 - GlobalConstantPointerHungarianPrefix of ``On``
939 Identifies and/or transforms global constant pointer names as follows:
945 int *const MyConstantGlobalPointer = nullptr;
951 int *const pre_myconstantglobalpointer_post = nullptr;
953 .. option:: GlobalFunctionCase
955 When defined, the check will ensure global function names conform to the
958 .. option:: GlobalFunctionPrefix
960 When defined, the check will ensure global function names will add the
961 prefixed with the given value (regardless of casing).
963 .. option:: GlobalFunctionIgnoredRegexp
965 Identifier naming checks won't be enforced for global function names
966 matching this regular expression.
968 .. option:: GlobalFunctionSuffix
970 When defined, the check will ensure global function names will add the
971 suffix with the given value (regardless of casing).
973 For example using values of:
975 - GlobalFunctionCase of ``lower_case``
976 - GlobalFunctionPrefix of ``pre_``
977 - GlobalFunctionSuffix of ``_post``
979 Identifies and/or transforms global function names as follows:
985 void GLOBAL_FUNCTION(int PARAMETER_1, int const CONST_parameter);
991 void pre_global_function_post(int PARAMETER_1, int const CONST_parameter);
993 .. option:: GlobalPointerCase
995 When defined, the check will ensure global pointer names conform to the
998 .. option:: GlobalPointerPrefix
1000 When defined, the check will ensure global pointer names will add the
1001 prefixed with the given value (regardless of casing).
1003 .. option:: GlobalPointerIgnoredRegexp
1005 Identifier naming checks won't be enforced for global pointer names
1006 matching this regular expression.
1008 .. option:: GlobalPointerSuffix
1010 When defined, the check will ensure global pointer names will add the
1011 suffix with the given value (regardless of casing).
1013 .. option:: GlobalPointerHungarianPrefix
1015 When enabled, the check ensures that the declared identifier will
1016 have a Hungarian notation prefix based on the declared type.
1018 For example using values of:
1020 - GlobalPointerCase of ``lower_case``
1021 - GlobalPointerPrefix of ``pre_``
1022 - GlobalPointerSuffix of ``_post``
1023 - GlobalPointerHungarianPrefix of ``On``
1025 Identifies and/or transforms global pointer names as follows:
1037 int *pre_global3_post;
1039 .. option:: GlobalVariableCase
1041 When defined, the check will ensure global variable names conform to the
1044 .. option:: GlobalVariablePrefix
1046 When defined, the check will ensure global variable names will add the
1047 prefixed with the given value (regardless of casing).
1049 .. option:: GlobalVariableIgnoredRegexp
1051 Identifier naming checks won't be enforced for global variable names
1052 matching this regular expression.
1054 .. option:: GlobalVariableSuffix
1056 When defined, the check will ensure global variable names will add the
1057 suffix with the given value (regardless of casing).
1059 .. option:: GlobalVariableHungarianPrefix
1061 When enabled, the check ensures that the declared identifier will
1062 have a Hungarian notation prefix based on the declared type.
1064 For example using values of:
1066 - GlobalVariableCase of ``lower_case``
1067 - GlobalVariablePrefix of ``pre_``
1068 - GlobalVariableSuffix of ``_post``
1069 - GlobalVariableHungarianPrefix of ``On``
1071 Identifies and/or transforms global variable names as follows:
1083 int pre_global3_post;
1085 .. option:: IgnoreMainLikeFunctions
1087 When set to `true` functions that have a similar signature to ``main`` or
1088 ``wmain`` won't enforce checks on the names of their parameters.
1089 Default value is `false`.
1091 .. option:: InlineNamespaceCase
1093 When defined, the check will ensure inline namespaces names conform to the
1096 .. option:: InlineNamespacePrefix
1098 When defined, the check will ensure inline namespaces names will add the
1099 prefixed with the given value (regardless of casing).
1101 .. option:: InlineNamespaceIgnoredRegexp
1103 Identifier naming checks won't be enforced for inline namespaces names
1104 matching this regular expression.
1106 .. option:: InlineNamespaceSuffix
1108 When defined, the check will ensure inline namespaces names will add the
1109 suffix with the given value (regardless of casing).
1111 For example using values of:
1113 - InlineNamespaceCase of ``lower_case``
1114 - InlineNamespacePrefix of ``pre_``
1115 - InlineNamespaceSuffix of ``_post``
1117 Identifies and/or transforms inline namespaces names as follows:
1124 inline namespace InlineNamespace {
1127 } // namespace FOO_NS
1134 inline namespace pre_inlinenamespace_post {
1137 } // namespace FOO_NS
1139 .. option:: LocalConstantCase
1141 When defined, the check will ensure local constant names conform to the
1144 .. option:: LocalConstantPrefix
1146 When defined, the check will ensure local constant names will add the
1147 prefixed with the given value (regardless of casing).
1149 .. option:: LocalConstantIgnoredRegexp
1151 Identifier naming checks won't be enforced for local constant names
1152 matching this regular expression.
1154 .. option:: LocalConstantSuffix
1156 When defined, the check will ensure local constant names will add the
1157 suffix with the given value (regardless of casing).
1159 .. option:: LocalConstantHungarianPrefix
1161 When enabled, the check ensures that the declared identifier will
1162 have a Hungarian notation prefix based on the declared type.
1164 For example using values of:
1166 - LocalConstantCase of ``lower_case``
1167 - LocalConstantPrefix of ``pre_``
1168 - LocalConstantSuffix of ``_post``
1169 - LocalConstantHungarianPrefix of ``On``
1171 Identifies and/or transforms local constant names as follows:
1177 void foo() { int const local_Constant = 3; }
1183 void foo() { int const pre_local_constant_post = 3; }
1185 .. option:: LocalConstantPointerCase
1187 When defined, the check will ensure local constant pointer names conform to the
1190 .. option:: LocalConstantPointerPrefix
1192 When defined, the check will ensure local constant pointer names will add the
1193 prefixed with the given value (regardless of casing).
1195 .. option:: LocalConstantPointerIgnoredRegexp
1197 Identifier naming checks won't be enforced for local constant pointer names
1198 matching this regular expression.
1200 .. option:: LocalConstantPointerSuffix
1202 When defined, the check will ensure local constant pointer names will add the
1203 suffix with the given value (regardless of casing).
1205 .. option:: LocalConstantPointerHungarianPrefix
1207 When enabled, the check ensures that the declared identifier will
1208 have a Hungarian notation prefix based on the declared type.
1210 For example using values of:
1212 - LocalConstantPointerCase of ``lower_case``
1213 - LocalConstantPointerPrefix of ``pre_``
1214 - LocalConstantPointerSuffix of ``_post``
1215 - LocalConstantPointerHungarianPrefix of ``On``
1217 Identifies and/or transforms local constant pointer names as follows:
1223 void foo() { int const *local_Constant = 3; }
1229 void foo() { int const *pre_local_constant_post = 3; }
1231 .. option:: LocalPointerCase
1233 When defined, the check will ensure local pointer names conform to the
1236 .. option:: LocalPointerPrefix
1238 When defined, the check will ensure local pointer names will add the
1239 prefixed with the given value (regardless of casing).
1241 .. option:: LocalPointerIgnoredRegexp
1243 Identifier naming checks won't be enforced for local pointer names
1244 matching this regular expression.
1246 .. option:: LocalPointerSuffix
1248 When defined, the check will ensure local pointer names will add the
1249 suffix with the given value (regardless of casing).
1251 .. option:: LocalPointerHungarianPrefix
1253 When enabled, the check ensures that the declared identifier will
1254 have a Hungarian notation prefix based on the declared type.
1256 For example using values of:
1258 - LocalPointerCase of ``lower_case``
1259 - LocalPointerPrefix of ``pre_``
1260 - LocalPointerSuffix of ``_post``
1261 - LocalPointerHungarianPrefix of ``On``
1263 Identifies and/or transforms local pointer names as follows:
1269 void foo() { int *local_Constant; }
1275 void foo() { int *pre_local_constant_post; }
1277 .. option:: LocalVariableCase
1279 When defined, the check will ensure local variable names conform to the
1282 .. option:: LocalVariablePrefix
1284 When defined, the check will ensure local variable names will add the
1285 prefixed with the given value (regardless of casing).
1287 .. option:: LocalVariableIgnoredRegexp
1289 Identifier naming checks won't be enforced for local variable names
1290 matching this regular expression.
1292 For example using values of:
1294 - LocalVariableCase of ``CamelCase``
1295 - LocalVariableIgnoredRegexp of ``\w{1,2}``
1297 Will exclude variables with a length less than or equal to 2 from the
1298 camel case check applied to other variables.
1300 .. option:: LocalVariableSuffix
1302 When defined, the check will ensure local variable names will add the
1303 suffix with the given value (regardless of casing).
1305 .. option:: LocalVariableHungarianPrefix
1307 When enabled, the check ensures that the declared identifier will
1308 have a Hungarian notation prefix based on the declared type.
1310 For example using values of:
1312 - LocalVariableCase of ``lower_case``
1313 - LocalVariablePrefix of ``pre_``
1314 - LocalVariableSuffix of ``_post``
1315 - LocalVariableHungarianPrefix of ``On``
1317 Identifies and/or transforms local variable names as follows:
1323 void foo() { int local_Constant; }
1329 void foo() { int pre_local_constant_post; }
1331 .. option:: MacroDefinitionCase
1333 When defined, the check will ensure macro definitions conform to the
1336 .. option:: MacroDefinitionPrefix
1338 When defined, the check will ensure macro definitions will add the
1339 prefixed with the given value (regardless of casing).
1341 .. option:: MacroDefinitionIgnoredRegexp
1343 Identifier naming checks won't be enforced for macro definitions
1344 matching this regular expression.
1346 .. option:: MacroDefinitionSuffix
1348 When defined, the check will ensure macro definitions will add the
1349 suffix with the given value (regardless of casing).
1351 For example using values of:
1353 - MacroDefinitionCase of ``lower_case``
1354 - MacroDefinitionPrefix of ``pre_``
1355 - MacroDefinitionSuffix of ``_post``
1357 Identifies and/or transforms macro definitions as follows:
1363 #define MY_MacroDefinition
1369 #define pre_my_macro_definition_post
1371 Note: This will not warn on builtin macros or macros defined on the command line
1372 using the ``-D`` flag.
1374 .. option:: MemberCase
1376 When defined, the check will ensure member names conform to the
1379 .. option:: MemberPrefix
1381 When defined, the check will ensure member names will add the
1382 prefixed with the given value (regardless of casing).
1384 .. option:: MemberIgnoredRegexp
1386 Identifier naming checks won't be enforced for member names
1387 matching this regular expression.
1389 .. option:: MemberSuffix
1391 When defined, the check will ensure member names will add the
1392 suffix with the given value (regardless of casing).
1394 .. option:: MemberHungarianPrefix
1396 When enabled, the check ensures that the declared identifier will
1397 have a Hungarian notation prefix based on the declared type.
1399 For example using values of:
1401 - MemberCase of ``lower_case``
1402 - MemberPrefix of ``pre_``
1403 - MemberSuffix of ``_post``
1404 - MemberHungarianPrefix of ``On``
1406 Identifies and/or transforms member names as follows:
1413 char MY_ConstMember_string[4];
1421 char pre_my_constmember_string_post[4];
1424 .. option:: MethodCase
1426 When defined, the check will ensure method names conform to the
1429 .. option:: MethodPrefix
1431 When defined, the check will ensure method names will add the
1432 prefixed with the given value (regardless of casing).
1434 .. option:: MethodIgnoredRegexp
1436 Identifier naming checks won't be enforced for method names
1437 matching this regular expression.
1439 .. option:: MethodSuffix
1441 When defined, the check will ensure method names will add the
1442 suffix with the given value (regardless of casing).
1444 For example using values of:
1446 - MethodCase of ``lower_case``
1447 - MethodPrefix of ``pre_``
1448 - MethodSuffix of ``_post``
1450 Identifies and/or transforms method names as follows:
1457 char MY_Method_string();
1465 char pre_my_method_string_post();
1468 .. option:: NamespaceCase
1470 When defined, the check will ensure namespace names conform to the
1473 .. option:: NamespacePrefix
1475 When defined, the check will ensure namespace names will add the
1476 prefixed with the given value (regardless of casing).
1478 .. option:: NamespaceIgnoredRegexp
1480 Identifier naming checks won't be enforced for namespace names
1481 matching this regular expression.
1483 .. option:: NamespaceSuffix
1485 When defined, the check will ensure namespace names will add the
1486 suffix with the given value (regardless of casing).
1488 For example using values of:
1490 - NamespaceCase of ``lower_case``
1491 - NamespacePrefix of ``pre_``
1492 - NamespaceSuffix of ``_post``
1494 Identifies and/or transforms namespace names as follows:
1508 namespace pre_foo_ns_post {
1512 .. option:: ParameterCase
1514 When defined, the check will ensure parameter names conform to the
1517 .. option:: ParameterPrefix
1519 When defined, the check will ensure parameter names will add the
1520 prefixed with the given value (regardless of casing).
1522 .. option:: ParameterIgnoredRegexp
1524 Identifier naming checks won't be enforced for parameter names
1525 matching this regular expression.
1527 .. option:: ParameterSuffix
1529 When defined, the check will ensure parameter names will add the
1530 suffix with the given value (regardless of casing).
1532 .. option:: ParameterHungarianPrefix
1534 When enabled, the check ensures that the declared identifier will
1535 have a Hungarian notation prefix based on the declared type.
1537 For example using values of:
1539 - ParameterCase of ``lower_case``
1540 - ParameterPrefix of ``pre_``
1541 - ParameterSuffix of ``_post``
1542 - ParameterHungarianPrefix of ``On``
1544 Identifies and/or transforms parameter names as follows:
1550 void GLOBAL_FUNCTION(int PARAMETER_1, int const CONST_parameter);
1556 void GLOBAL_FUNCTION(int pre_parameter_post, int const CONST_parameter);
1558 .. option:: ParameterPackCase
1560 When defined, the check will ensure parameter pack names conform to the
1563 .. option:: ParameterPackPrefix
1565 When defined, the check will ensure parameter pack names will add the
1566 prefixed with the given value (regardless of casing).
1568 .. option:: ParameterPackIgnoredRegexp
1570 Identifier naming checks won't be enforced for parameter pack names
1571 matching this regular expression.
1573 .. option:: ParameterPackSuffix
1575 When defined, the check will ensure parameter pack names will add the
1576 suffix with the given value (regardless of casing).
1578 For example using values of:
1580 - ParameterPackCase of ``lower_case``
1581 - ParameterPackPrefix of ``pre_``
1582 - ParameterPackSuffix of ``_post``
1584 Identifies and/or transforms parameter pack names as follows:
1590 template <typename... TYPE_parameters> {
1591 void FUNCTION(int... TYPE_parameters);
1598 template <typename... TYPE_parameters> {
1599 void FUNCTION(int... pre_type_parameters_post);
1602 .. option:: PointerParameterCase
1604 When defined, the check will ensure pointer parameter names conform to the
1607 .. option:: PointerParameterPrefix
1609 When defined, the check will ensure pointer parameter names will add the
1610 prefixed with the given value (regardless of casing).
1612 .. option:: PointerParameterIgnoredRegexp
1614 Identifier naming checks won't be enforced for pointer parameter names
1615 matching this regular expression.
1617 .. option:: PointerParameterSuffix
1619 When defined, the check will ensure pointer parameter names will add the
1620 suffix with the given value (regardless of casing).
1622 .. option:: PointerParameterHungarianPrefix
1624 When enabled, the check ensures that the declared identifier will
1625 have a Hungarian notation prefix based on the declared type.
1627 For example using values of:
1629 - PointerParameterCase of ``lower_case``
1630 - PointerParameterPrefix of ``pre_``
1631 - PointerParameterSuffix of ``_post``
1632 - PointerParameterHungarianPrefix of ``On``
1634 Identifies and/or transforms pointer parameter names as follows:
1640 void FUNCTION(int *PARAMETER);
1646 void FUNCTION(int *pre_parameter_post);
1648 .. option:: PrivateMemberCase
1650 When defined, the check will ensure private member names conform to the
1653 .. option:: PrivateMemberPrefix
1655 When defined, the check will ensure private member names will add the
1656 prefixed with the given value (regardless of casing).
1658 .. option:: PrivateMemberIgnoredRegexp
1660 Identifier naming checks won't be enforced for private member names
1661 matching this regular expression.
1663 .. option:: PrivateMemberSuffix
1665 When defined, the check will ensure private member names will add the
1666 suffix with the given value (regardless of casing).
1668 .. option:: PrivateMemberHungarianPrefix
1670 When enabled, the check ensures that the declared identifier will
1671 have a Hungarian notation prefix based on the declared type.
1673 For example using values of:
1675 - PrivateMemberCase of ``lower_case``
1676 - PrivateMemberPrefix of ``pre_``
1677 - PrivateMemberSuffix of ``_post``
1678 - PrivateMemberHungarianPrefix of ``On``
1680 Identifies and/or transforms private member names as follows:
1688 int Member_Variable;
1697 int pre_member_variable_post;
1700 .. option:: PrivateMethodCase
1702 When defined, the check will ensure private method names conform to the
1705 .. option:: PrivateMethodPrefix
1707 When defined, the check will ensure private method names will add the
1708 prefixed with the given value (regardless of casing).
1710 .. option:: PrivateMethodIgnoredRegexp
1712 Identifier naming checks won't be enforced for private method names
1713 matching this regular expression.
1715 .. option:: PrivateMethodSuffix
1717 When defined, the check will ensure private method names will add the
1718 suffix with the given value (regardless of casing).
1720 For example using values of:
1722 - PrivateMethodCase of ``lower_case``
1723 - PrivateMethodPrefix of ``pre_``
1724 - PrivateMethodSuffix of ``_post``
1726 Identifies and/or transforms private method names as follows:
1734 int Member_Method();
1743 int pre_member_method_post();
1746 .. option:: ProtectedMemberCase
1748 When defined, the check will ensure protected member names conform to the
1751 .. option:: ProtectedMemberPrefix
1753 When defined, the check will ensure protected member names will add the
1754 prefixed with the given value (regardless of casing).
1756 .. option:: ProtectedMemberIgnoredRegexp
1758 Identifier naming checks won't be enforced for protected member names
1759 matching this regular expression.
1761 .. option:: ProtectedMemberSuffix
1763 When defined, the check will ensure protected member names will add the
1764 suffix with the given value (regardless of casing).
1766 .. option:: ProtectedMemberHungarianPrefix
1768 When enabled, the check ensures that the declared identifier will
1769 have a Hungarian notation prefix based on the declared type.
1771 For example using values of:
1773 - ProtectedMemberCase of ``lower_case``
1774 - ProtectedMemberPrefix of ``pre_``
1775 - ProtectedMemberSuffix of ``_post``
1776 - ProtectedMemberHungarianPrefix of ``On``
1778 Identifies and/or transforms protected member names as follows:
1786 int Member_Variable;
1795 int pre_member_variable_post;
1798 .. option:: ProtectedMethodCase
1800 When defined, the check will ensure protected method names conform to the
1803 .. option:: ProtectedMethodPrefix
1805 When defined, the check will ensure protected method names will add the
1806 prefixed with the given value (regardless of casing).
1808 .. option:: ProtectedMethodIgnoredRegexp
1810 Identifier naming checks won't be enforced for protected method names
1811 matching this regular expression.
1813 .. option:: ProtectedMethodSuffix
1815 When defined, the check will ensure protected method names will add the
1816 suffix with the given value (regardless of casing).
1818 For example using values of:
1820 - ProtectedMethodCase of ``lower_case``
1821 - ProtectedMethodPrefix of ``pre_``
1822 - ProtectedMethodSuffix of ``_post``
1824 Identifies and/or transforms protect method names as follows:
1832 int Member_Method();
1841 int pre_member_method_post();
1844 .. option:: PublicMemberCase
1846 When defined, the check will ensure public member names conform to the
1849 .. option:: PublicMemberPrefix
1851 When defined, the check will ensure public member names will add the
1852 prefixed with the given value (regardless of casing).
1854 .. option:: PublicMemberIgnoredRegexp
1856 Identifier naming checks won't be enforced for public member names
1857 matching this regular expression.
1859 .. option:: PublicMemberSuffix
1861 When defined, the check will ensure public member names will add the
1862 suffix with the given value (regardless of casing).
1864 .. option:: PublicMemberHungarianPrefix
1866 When enabled, the check ensures that the declared identifier will
1867 have a Hungarian notation prefix based on the declared type.
1869 For example using values of:
1871 - PublicMemberCase of ``lower_case``
1872 - PublicMemberPrefix of ``pre_``
1873 - PublicMemberSuffix of ``_post``
1874 - PublicMemberHungarianPrefix of ``On``
1876 Identifies and/or transforms public member names as follows:
1884 int Member_Variable;
1893 int pre_member_variable_post;
1896 .. option:: PublicMethodCase
1898 When defined, the check will ensure public method names conform to the
1901 .. option:: PublicMethodPrefix
1903 When defined, the check will ensure public method names will add the
1904 prefixed with the given value (regardless of casing).
1906 .. option:: PublicMethodIgnoredRegexp
1908 Identifier naming checks won't be enforced for public method names
1909 matching this regular expression.
1911 .. option:: PublicMethodSuffix
1913 When defined, the check will ensure public method names will add the
1914 suffix with the given value (regardless of casing).
1916 For example using values of:
1918 - PublicMethodCase of ``lower_case``
1919 - PublicMethodPrefix of ``pre_``
1920 - PublicMethodSuffix of ``_post``
1922 Identifies and/or transforms public method names as follows:
1930 int Member_Method();
1939 int pre_member_method_post();
1942 .. option:: ScopedEnumConstantCase
1944 When defined, the check will ensure scoped enum constant names conform to
1945 the selected casing.
1947 .. option:: ScopedEnumConstantPrefix
1949 When defined, the check will ensure scoped enum constant names will add the
1950 prefixed with the given value (regardless of casing).
1952 .. option:: ScopedEnumConstantIgnoredRegexp
1954 Identifier naming checks won't be enforced for scoped enum constant names
1955 matching this regular expression.
1957 .. option:: ScopedEnumConstantSuffix
1959 When defined, the check will ensure scoped enum constant names will add the
1960 suffix with the given value (regardless of casing).
1962 .. option:: ScopedEnumConstantHungarianPrefix
1964 When enabled, the check ensures that the declared identifier will
1965 have a Hungarian notation prefix based on the declared type.
1967 For example using values of:
1969 - ScopedEnumConstantCase of ``lower_case``
1970 - ScopedEnumConstantPrefix of ``pre_``
1971 - ScopedEnumConstantSuffix of ``_post``
1972 - ScopedEnumConstantHungarianPrefix of ``On``
1974 Identifies and/or transforms enumeration constant names as follows:
1980 enum class FOO { One, Two, Three };
1986 enum class FOO { pre_One_post, pre_Two_post, pre_Three_post };
1988 .. option:: StaticConstantCase
1990 When defined, the check will ensure static constant names conform to the
1993 .. option:: StaticConstantPrefix
1995 When defined, the check will ensure static constant names will add the
1996 prefixed with the given value (regardless of casing).
1998 .. option:: StaticConstantIgnoredRegexp
2000 Identifier naming checks won't be enforced for static constant names
2001 matching this regular expression.
2003 .. option:: StaticConstantSuffix
2005 When defined, the check will ensure static constant names will add the
2006 suffix with the given value (regardless of casing).
2008 .. option:: StaticConstantHungarianPrefix
2010 When enabled, the check ensures that the declared identifier will
2011 have a Hungarian notation prefix based on the declared type.
2013 For example using values of:
2015 - StaticConstantCase of ``lower_case``
2016 - StaticConstantPrefix of ``pre_``
2017 - StaticConstantSuffix of ``_post``
2018 - StaticConstantHungarianPrefix of ``On``
2020 Identifies and/or transforms static constant names as follows:
2026 static unsigned const MyConstStatic_array[] = {1, 2, 3};
2032 static unsigned const pre_myconststatic_array_post[] = {1, 2, 3};
2034 .. option:: StaticVariableCase
2036 When defined, the check will ensure static variable names conform to the
2039 .. option:: StaticVariablePrefix
2041 When defined, the check will ensure static variable names will add the
2042 prefixed with the given value (regardless of casing).
2044 .. option:: StaticVariableIgnoredRegexp
2046 Identifier naming checks won't be enforced for static variable names
2047 matching this regular expression.
2049 .. option:: StaticVariableSuffix
2051 When defined, the check will ensure static variable names will add the
2052 suffix with the given value (regardless of casing).
2054 .. option:: StaticVariableHungarianPrefix
2056 When enabled, the check ensures that the declared identifier will
2057 have a Hungarian notation prefix based on the declared type.
2059 For example using values of:
2061 - StaticVariableCase of ``lower_case``
2062 - StaticVariablePrefix of ``pre_``
2063 - StaticVariableSuffix of ``_post``
2064 - StaticVariableHungarianPrefix of ``On``
2066 Identifies and/or transforms static variable names as follows:
2072 static unsigned MyStatic_array[] = {1, 2, 3};
2078 static unsigned pre_mystatic_array_post[] = {1, 2, 3};
2080 .. option:: StructCase
2082 When defined, the check will ensure struct names conform to the
2085 .. option:: StructPrefix
2087 When defined, the check will ensure struct names will add the
2088 prefixed with the given value (regardless of casing).
2090 .. option:: StructIgnoredRegexp
2092 Identifier naming checks won't be enforced for struct names
2093 matching this regular expression.
2095 .. option:: StructSuffix
2097 When defined, the check will ensure struct names will add the
2098 suffix with the given value (regardless of casing).
2100 For example using values of:
2102 - StructCase of ``lower_case``
2103 - StructPrefix of ``pre_``
2104 - StructSuffix of ``_post``
2106 Identifies and/or transforms struct names as follows:
2121 struct pre_foo_post {
2126 .. option:: TemplateParameterCase
2128 When defined, the check will ensure template parameter names conform to the
2131 .. option:: TemplateParameterPrefix
2133 When defined, the check will ensure template parameter names will add the
2134 prefixed with the given value (regardless of casing).
2136 .. option:: TemplateParameterIgnoredRegexp
2138 Identifier naming checks won't be enforced for template parameter names
2139 matching this regular expression.
2141 .. option:: TemplateParameterSuffix
2143 When defined, the check will ensure template parameter names will add the
2144 suffix with the given value (regardless of casing).
2146 For example using values of:
2148 - TemplateParameterCase of ``lower_case``
2149 - TemplateParameterPrefix of ``pre_``
2150 - TemplateParameterSuffix of ``_post``
2152 Identifies and/or transforms template parameter names as follows:
2158 template <typename T> class Foo {};
2164 template <typename pre_t_post> class Foo {};
2166 .. option:: TemplateTemplateParameterCase
2168 When defined, the check will ensure template template parameter names conform to the
2171 .. option:: TemplateTemplateParameterPrefix
2173 When defined, the check will ensure template template parameter names will add the
2174 prefixed with the given value (regardless of casing).
2176 .. option:: TemplateTemplateParameterIgnoredRegexp
2178 Identifier naming checks won't be enforced for template template parameter
2179 names matching this regular expression.
2181 .. option:: TemplateTemplateParameterSuffix
2183 When defined, the check will ensure template template parameter names will add the
2184 suffix with the given value (regardless of casing).
2186 For example using values of:
2188 - TemplateTemplateParameterCase of ``lower_case``
2189 - TemplateTemplateParameterPrefix of ``pre_``
2190 - TemplateTemplateParameterSuffix of ``_post``
2192 Identifies and/or transforms template template parameter names as follows:
2198 template <template <typename> class TPL_parameter, int COUNT_params,
2199 typename... TYPE_parameters>
2205 template <template <typename> class pre_tpl_parameter_post, int COUNT_params,
2206 typename... TYPE_parameters>
2208 .. option:: TypeAliasCase
2210 When defined, the check will ensure type alias names conform to the
2213 .. option:: TypeAliasPrefix
2215 When defined, the check will ensure type alias names will add the
2216 prefixed with the given value (regardless of casing).
2218 .. option:: TypeAliasIgnoredRegexp
2220 Identifier naming checks won't be enforced for type alias names
2221 matching this regular expression.
2223 .. option:: TypeAliasSuffix
2225 When defined, the check will ensure type alias names will add the
2226 suffix with the given value (regardless of casing).
2228 For example using values of:
2230 - TypeAliasCase of ``lower_case``
2231 - TypeAliasPrefix of ``pre_``
2232 - TypeAliasSuffix of ``_post``
2234 Identifies and/or transforms type alias names as follows:
2240 using MY_STRUCT_TYPE = my_structure;
2246 using pre_my_struct_type_post = my_structure;
2248 .. option:: TypedefCase
2250 When defined, the check will ensure typedef names conform to the
2253 .. option:: TypedefPrefix
2255 When defined, the check will ensure typedef names will add the
2256 prefixed with the given value (regardless of casing).
2258 .. option:: TypedefIgnoredRegexp
2260 Identifier naming checks won't be enforced for typedef names
2261 matching this regular expression.
2263 .. option:: TypedefSuffix
2265 When defined, the check will ensure typedef names will add the
2266 suffix with the given value (regardless of casing).
2268 For example using values of:
2270 - TypedefCase of ``lower_case``
2271 - TypedefPrefix of ``pre_``
2272 - TypedefSuffix of ``_post``
2274 Identifies and/or transforms typedef names as follows:
2286 typedef int pre_myint_post;
2288 .. option:: TypeTemplateParameterCase
2290 When defined, the check will ensure type template parameter names conform to the
2293 .. option:: TypeTemplateParameterPrefix
2295 When defined, the check will ensure type template parameter names will add the
2296 prefixed with the given value (regardless of casing).
2298 .. option:: TypeTemplateParameterIgnoredRegexp
2300 Identifier naming checks won't be enforced for type template names
2301 matching this regular expression.
2303 .. option:: TypeTemplateParameterSuffix
2305 When defined, the check will ensure type template parameter names will add the
2306 suffix with the given value (regardless of casing).
2308 For example using values of:
2310 - TypeTemplateParameterCase of ``lower_case``
2311 - TypeTemplateParameterPrefix of ``pre_``
2312 - TypeTemplateParameterSuffix of ``_post``
2314 Identifies and/or transforms type template parameter names as follows:
2320 template <template <typename> class TPL_parameter, int COUNT_params,
2321 typename... TYPE_parameters>
2327 template <template <typename> class TPL_parameter, int COUNT_params,
2328 typename... pre_type_parameters_post>
2330 .. option:: UnionCase
2332 When defined, the check will ensure union names conform to the
2335 .. option:: UnionPrefix
2337 When defined, the check will ensure union names will add the
2338 prefixed with the given value (regardless of casing).
2340 .. option:: UnionIgnoredRegexp
2342 Identifier naming checks won't be enforced for union names
2343 matching this regular expression.
2345 .. option:: UnionSuffix
2347 When defined, the check will ensure union names will add the
2348 suffix with the given value (regardless of casing).
2350 For example using values of:
2352 - UnionCase of ``lower_case``
2353 - UnionPrefix of ``pre_``
2354 - UnionSuffix of ``_post``
2356 Identifies and/or transforms union names as follows:
2371 union pre_foo_post {
2376 .. option:: ValueTemplateParameterCase
2378 When defined, the check will ensure value template parameter names conform to the
2381 .. option:: ValueTemplateParameterPrefix
2383 When defined, the check will ensure value template parameter names will add the
2384 prefixed with the given value (regardless of casing).
2386 .. option:: ValueTemplateParameterIgnoredRegexp
2388 Identifier naming checks won't be enforced for value template parameter
2389 names matching this regular expression.
2391 .. option:: ValueTemplateParameterSuffix
2393 When defined, the check will ensure value template parameter names will add the
2394 suffix with the given value (regardless of casing).
2396 For example using values of:
2398 - ValueTemplateParameterCase of ``lower_case``
2399 - ValueTemplateParameterPrefix of ``pre_``
2400 - ValueTemplateParameterSuffix of ``_post``
2402 Identifies and/or transforms value template parameter names as follows:
2408 template <template <typename> class TPL_parameter, int COUNT_params,
2409 typename... TYPE_parameters>
2415 template <template <typename> class TPL_parameter, int pre_count_params_post,
2416 typename... TYPE_parameters>
2418 .. option:: VariableCase
2420 When defined, the check will ensure variable names conform to the
2423 .. option:: VariablePrefix
2425 When defined, the check will ensure variable names will add the
2426 prefixed with the given value (regardless of casing).
2428 .. option:: VariableIgnoredRegexp
2430 Identifier naming checks won't be enforced for variable names
2431 matching this regular expression.
2433 .. option:: VariableSuffix
2435 When defined, the check will ensure variable names will add the
2436 suffix with the given value (regardless of casing).
2438 .. option:: VariableHungarianPrefix
2440 When enabled, the check ensures that the declared identifier will
2441 have a Hungarian notation prefix based on the declared type.
2443 For example using values of:
2445 - VariableCase of ``lower_case``
2446 - VariablePrefix of ``pre_``
2447 - VariableSuffix of ``_post``
2448 - VariableHungarianPrefix of ``On``
2450 Identifies and/or transforms variable names as follows:
2456 unsigned MyVariable;
2462 unsigned pre_myvariable_post;
2464 .. option:: VirtualMethodCase
2466 When defined, the check will ensure virtual method names conform to the
2469 .. option:: VirtualMethodPrefix
2471 When defined, the check will ensure virtual method names will add the
2472 prefixed with the given value (regardless of casing).
2474 .. option:: VirtualMethodIgnoredRegexp
2476 Identifier naming checks won't be enforced for virtual method names
2477 matching this regular expression.
2479 .. option:: VirtualMethodSuffix
2481 When defined, the check will ensure virtual method names will add the
2482 suffix with the given value (regardless of casing).
2484 For example using values of:
2486 - VirtualMethodCase of ``lower_case``
2487 - VirtualMethodPrefix of ``pre_``
2488 - VirtualMethodSuffix of ``_post``
2490 Identifies and/or transforms virtual method names as follows:
2498 virtual int MemberFunction();
2507 virtual int pre_member_function_post();
2511 The default mapping table of Hungarian Notation
2512 -----------------------------------------------
2514 In Hungarian notation, a variable name starts with a group of lower-case
2515 letters which are mnemonics for the type or purpose of that variable, followed
2516 by whatever name the programmer has chosen; this last part is sometimes
2517 distinguished as the given name. The first character of the given name can be
2518 capitalized to separate it from the type indicators (see also CamelCase).
2519 Otherwise the case of this character denotes scope.
2521 The following table is the default mapping table of Hungarian Notation which
2522 maps Decl to its prefix string. You can also have your own style in config file.
2524 ================= ============== ====================== ============== =========== ==============
2525 Primitive Types Microsoft data types
2526 ---------------------------------------------------------------------- --------------------------
2527 Type Prefix Type Prefix Type Prefix
2528 ================= ============== ====================== ============== =========== ==============
2529 int8_t i8 signed int si BOOL b
2530 int16_t i16 signed short ss BOOLEAN b
2531 int32_t i32 signed short int ssi BYTE by
2532 int64_t i64 signed long long int slli CHAR c
2533 uint8_t u8 signed long long sll UCHAR uc
2534 uint16_t u16 signed long int sli SHORT s
2535 uint32_t u32 signed long sl USHORT us
2536 uint64_t u64 signed s WORD w
2537 char8_t c8 unsigned long long int ulli DWORD dw
2538 char16_t c16 unsigned long long ull DWORD32 dw32
2539 char32_t c32 unsigned long int uli DWORD64 dw64
2540 float f unsigned long ul LONG l
2541 double d unsigned short int usi ULONG ul
2542 char c unsigned short us ULONG32 ul32
2543 bool b unsigned int ui ULONG64 ul64
2544 _Bool b unsigned u ULONGLONG ull
2545 int i long long int lli HANDLE h
2546 size_t n long double ld INT i
2547 short s long long ll INT8 i8
2548 signed i long int li INT16 i16
2549 unsigned u long l INT32 i32
2550 long l ptrdiff_t p INT64 i64
2551 long long ll UINT ui
2552 unsigned long ul UINT8 u8
2553 long double ld UINT16 u16
2554 ptrdiff_t p UINT32 u32
2555 wchar_t wc UINT64 u64
2556 short int si PVOID p
2558 ================= ============== ====================== ============== =========== ==============
2560 **There are more trivial options for Hungarian Notation:**
2562 **HungarianNotation.General.***
2563 Options are not belonging to any specific Decl.
2565 **HungarianNotation.CString.***
2566 Options for NULL-terminated string.
2568 **HungarianNotation.DerivedType.***
2569 Options for derived types.
2571 **HungarianNotation.PrimitiveType.***
2572 Options for primitive types.
2574 **HungarianNotation.UserDefinedType.***
2575 Options for user-defined types.
2578 Options for Hungarian Notation
2579 ------------------------------
2581 - :option:`HungarianNotation.General.TreatStructAsClass`
2583 - :option:`HungarianNotation.DerivedType.Array`
2584 - :option:`HungarianNotation.DerivedType.Pointer`
2585 - :option:`HungarianNotation.DerivedType.FunctionPointer`
2587 - :option:`HungarianNotation.CString.CharPrinter`
2588 - :option:`HungarianNotation.CString.CharArray`
2589 - :option:`HungarianNotation.CString.WideCharPrinter`
2590 - :option:`HungarianNotation.CString.WideCharArray`
2592 - :option:`HungarianNotation.PrimitiveType.*`
2593 - :option:`HungarianNotation.UserDefinedType.*`
2595 .. option:: HungarianNotation.General.TreatStructAsClass
2597 When defined, the check will treat naming of struct as a class.
2598 The default value is `false`.
2600 .. option:: HungarianNotation.DerivedType.Array
2602 When defined, the check will ensure variable name will add the prefix with
2603 the given string. The default prefix is `a`.
2605 .. option:: HungarianNotation.DerivedType.Pointer
2607 When defined, the check will ensure variable name will add the prefix with
2608 the given string. The default prefix is `p`.
2610 .. option:: HungarianNotation.DerivedType.FunctionPointer
2612 When defined, the check will ensure variable name will add the prefix with
2613 the given string. The default prefix is `fn`.
2621 int DataArray[2] = {0};
2624 void *DataBuffer = NULL;
2627 typedef void (*FUNC_PTR)();
2628 FUNC_PTR FuncPtr = NULL;
2635 int aDataArray[2] = {0};
2638 void *pDataBuffer = NULL;
2641 typedef void (*FUNC_PTR)();
2642 FUNC_PTR fnFuncPtr = NULL;
2645 .. option:: HungarianNotation.CString.CharPrinter
2647 When defined, the check will ensure variable name will add the prefix with
2648 the given string. The default prefix is `sz`.
2650 .. option:: HungarianNotation.CString.CharArray
2652 When defined, the check will ensure variable name will add the prefix with
2653 the given string. The default prefix is `sz`.
2655 .. option:: HungarianNotation.CString.WideCharPrinter
2657 When defined, the check will ensure variable name will add the prefix with
2658 the given string. The default prefix is `wsz`.
2660 .. option:: HungarianNotation.CString.WideCharArray
2662 When defined, the check will ensure variable name will add the prefix with
2663 the given string. The default prefix is `wsz`.
2671 const char *NamePtr = "Name";
2674 const char NameArray[] = "Name";
2677 const wchar_t *WideNamePtr = L"Name";
2680 const wchar_t WideNameArray[] = L"Name";
2687 const char *szNamePtr = "Name";
2690 const char szNameArray[] = "Name";
2693 const wchar_t *wszWideNamePtr = L"Name";
2696 const wchar_t wszWideNameArray[] = L"Name";
2699 .. option:: HungarianNotation.PrimitiveType.*
2701 When defined, the check will ensure variable name of involved primitive
2702 types will add the prefix with the given string. The default prefixes are
2703 defined in the default mapping table.
2705 .. option:: HungarianNotation.UserDefinedType.*
2707 When defined, the check will ensure variable name of involved primitive
2708 types will add the prefix with the given string. The default prefixes are
2709 defined in the default mapping table.
2717 int16_t ValueI16 = 0;
2718 int32_t ValueI32 = 0;
2719 int64_t ValueI64 = 0;
2720 uint8_t ValueU8 = 0;
2721 uint16_t ValueU16 = 0;
2722 uint32_t ValueU32 = 0;
2723 uint64_t ValueU64 = 0;
2724 float ValueFloat = 0.0;
2725 double ValueDouble = 0.0;
2726 ULONG ValueUlong = 0;
2727 DWORD ValueDword = 0;
2733 int8_t i8ValueI8 = 0;
2734 int16_t i16ValueI16 = 0;
2735 int32_t i32ValueI32 = 0;
2736 int64_t i64ValueI64 = 0;
2737 uint8_t u8ValueU8 = 0;
2738 uint16_t u16ValueU16 = 0;
2739 uint32_t u32ValueU32 = 0;
2740 uint64_t u64ValueU64 = 0;
2741 float fValueFloat = 0.0;
2742 double dValueDouble = 0.0;
2743 ULONG ulValueUlong = 0;
2744 DWORD dwValueDword = 0;