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) seperated by underscore(s) '_'. Examples include:
36 Cap_snake_case, Cobra_case, Foo_bar_baz, and Master_copy_8gb.
41 The following options are described below:
43 - :option:`AbstractClassCase`, :option:`AbstractClassPrefix`, :option:`AbstractClassSuffix`, :option:`AbstractClassIgnoredRegexp`, :option:`AbstractClassHungarianPrefix`
44 - :option:`AggressiveDependentMemberLookup`
45 - :option:`ClassCase`, :option:`ClassPrefix`, :option:`ClassSuffix`, :option:`ClassIgnoredRegexp`, :option:`ClassHungarianPrefix`
46 - :option:`ClassConstantCase`, :option:`ClassConstantPrefix`, :option:`ClassConstantSuffix`, :option:`ClassConstantIgnoredRegexp`, :option:`ClassConstantHungarianPrefix`
47 - :option:`ClassMemberCase`, :option:`ClassMemberPrefix`, :option:`ClassMemberSuffix`, :option:`ClassMemberIgnoredRegexp`, :option:`ClassMemberHungarianPrefix`
48 - :option:`ClassMethodCase`, :option:`ClassMethodPrefix`, :option:`ClassMethodSuffix`, :option:`ClassMethodIgnoredRegexp`
49 - :option:`ConstantCase`, :option:`ConstantPrefix`, :option:`ConstantSuffix`, :option:`ConstantIgnoredRegexp`, :option:`ConstantHungarianPrefix`
50 - :option:`ConstantMemberCase`, :option:`ConstantMemberPrefix`, :option:`ConstantMemberSuffix`, :option:`ConstantMemberIgnoredRegexp`, :option:`ConstantMemberHungarianPrefix`
51 - :option:`ConstantParameterCase`, :option:`ConstantParameterPrefix`, :option:`ConstantParameterSuffix`, :option:`ConstantParameterIgnoredRegexp`, :option:`ConstantParameterHungarianPrefix`
52 - :option:`ConstantPointerParameterCase`, :option:`ConstantPointerParameterPrefix`, :option:`ConstantPointerParameterSuffix`, :option:`ConstantPointerParameterIgnoredRegexp`, :option:`ConstantPointerParameterHungarianPrefix`
53 - :option:`ConstexprFunctionCase`, :option:`ConstexprFunctionPrefix`, :option:`ConstexprFunctionSuffix`, :option:`ConstexprFunctionIgnoredRegexp`
54 - :option:`ConstexprMethodCase`, :option:`ConstexprMethodPrefix`, :option:`ConstexprMethodSuffix`, :option:`ConstexprMethodIgnoredRegexp`
55 - :option:`ConstexprVariableCase`, :option:`ConstexprVariablePrefix`, :option:`ConstexprVariableSuffix`, :option:`ConstexprVariableIgnoredRegexp`, :option:`ConstexprVariableHungarianPrefix`
56 - :option:`EnumCase`, :option:`EnumPrefix`, :option:`EnumSuffix`, :option:`EnumIgnoredRegexp`
57 - :option:`EnumConstantCase`, :option:`EnumConstantPrefix`, :option:`EnumConstantSuffix`, :option:`EnumConstantIgnoredRegexp`, :option:`EnumConstantHungarianPrefix`
58 - :option:`FunctionCase`, :option:`FunctionPrefix`, :option:`FunctionSuffix`, :option:`FunctionIgnoredRegexp`
59 - :option:`GetConfigPerFile`
60 - :option:`GlobalConstantCase`, :option:`GlobalConstantPrefix`, :option:`GlobalConstantSuffix`, :option:`GlobalConstantIgnoredRegexp`, :option:`GlobalConstantHungarianPrefix`
61 - :option:`GlobalConstantPointerCase`, :option:`GlobalConstantPointerPrefix`, :option:`GlobalConstantPointerSuffix`, :option:`GlobalConstantPointerIgnoredRegexp`, :option:`GlobalConstantPointerHungarianPrefix`
62 - :option:`GlobalFunctionCase`, :option:`GlobalFunctionPrefix`, :option:`GlobalFunctionSuffix`, :option:`GlobalFunctionIgnoredRegexp`
63 - :option:`GlobalPointerCase`, :option:`GlobalPointerPrefix`, :option:`GlobalPointerSuffix`, :option:`GlobalPointerIgnoredRegexp`, :option:`GlobalPointerHungarianPrefix`
64 - :option:`GlobalVariableCase`, :option:`GlobalVariablePrefix`, :option:`GlobalVariableSuffix`, :option:`GlobalVariableIgnoredRegexp`, :option:`GlobalVariableHungarianPrefix`
65 - :option:`IgnoreMainLikeFunctions`
66 - :option:`InlineNamespaceCase`, :option:`InlineNamespacePrefix`, :option:`InlineNamespaceSuffix`, :option:`InlineNamespaceIgnoredRegexp`
67 - :option:`LocalConstantCase`, :option:`LocalConstantPrefix`, :option:`LocalConstantSuffix`, :option:`LocalConstantIgnoredRegexp`, :option:`LocalConstantHungarianPrefix`
68 - :option:`LocalConstantPointerCase`, :option:`LocalConstantPointerPrefix`, :option:`LocalConstantPointerSuffix`, :option:`LocalConstantPointerIgnoredRegexp`, :option:`LocalConstantPointerHungarianPrefix`
69 - :option:`LocalPointerCase`, :option:`LocalPointerPrefix`, :option:`LocalPointerSuffix`, :option:`LocalPointerIgnoredRegexp`, :option:`LocalPointerHungarianPrefix`
70 - :option:`LocalVariableCase`, :option:`LocalVariablePrefix`, :option:`LocalVariableSuffix`, :option:`LocalVariableIgnoredRegexp`, :option:`LocalVariableHungarianPrefix`
71 - :option:`MacroDefinitionCase`, :option:`MacroDefinitionPrefix`, :option:`MacroDefinitionSuffix`, :option:`MacroDefinitionIgnoredRegexp`
72 - :option:`MemberCase`, :option:`MemberPrefix`, :option:`MemberSuffix`, :option:`MemberIgnoredRegexp`, :option:`MemberHungarianPrefix`
73 - :option:`MethodCase`, :option:`MethodPrefix`, :option:`MethodSuffix`, :option:`MethodIgnoredRegexp`
74 - :option:`NamespaceCase`, :option:`NamespacePrefix`, :option:`NamespaceSuffix`, :option:`NamespaceIgnoredRegexp`
75 - :option:`ParameterCase`, :option:`ParameterPrefix`, :option:`ParameterSuffix`, :option:`ParameterIgnoredRegexp`, :option:`ParameterHungarianPrefix`
76 - :option:`ParameterPackCase`, :option:`ParameterPackPrefix`, :option:`ParameterPackSuffix`, :option:`ParameterPackIgnoredRegexp`
77 - :option:`PointerParameterCase`, :option:`PointerParameterPrefix`, :option:`PointerParameterSuffix`, :option:`PointerParameterIgnoredRegexp`, :option:`PointerParameterHungarianPrefix`
78 - :option:`PrivateMemberCase`, :option:`PrivateMemberPrefix`, :option:`PrivateMemberSuffix`, :option:`PrivateMemberIgnoredRegexp`, :option:`PrivateMemberHungarianPrefix`
79 - :option:`PrivateMethodCase`, :option:`PrivateMethodPrefix`, :option:`PrivateMethodSuffix`, :option:`PrivateMethodIgnoredRegexp`
80 - :option:`ProtectedMemberCase`, :option:`ProtectedMemberPrefix`, :option:`ProtectedMemberSuffix`, :option:`ProtectedMemberIgnoredRegexp`, :option:`ProtectedMemberHungarianPrefix`
81 - :option:`ProtectedMethodCase`, :option:`ProtectedMethodPrefix`, :option:`ProtectedMethodSuffix`, :option:`ProtectedMethodIgnoredRegexp`
82 - :option:`PublicMemberCase`, :option:`PublicMemberPrefix`, :option:`PublicMemberSuffix`, :option:`PublicMemberIgnoredRegexp`, :option:`PublicMemberHungarianPrefix`
83 - :option:`PublicMethodCase`, :option:`PublicMethodPrefix`, :option:`PublicMethodSuffix`, :option:`PublicMethodIgnoredRegexp`
84 - :option:`ScopedEnumConstantCase`, :option:`ScopedEnumConstantPrefix`, :option:`ScopedEnumConstantSuffix`, :option:`ScopedEnumConstantIgnoredRegexp`
85 - :option:`StaticConstantCase`, :option:`StaticConstantPrefix`, :option:`StaticConstantSuffix`, :option:`StaticConstantIgnoredRegexp`, :option:`StaticConstantHungarianPrefix`
86 - :option:`StaticVariableCase`, :option:`StaticVariablePrefix`, :option:`StaticVariableSuffix`, :option:`StaticVariableIgnoredRegexp`, :option:`StaticVariableHungarianPrefix`
87 - :option:`StructCase`, :option:`StructPrefix`, :option:`StructSuffix`, :option:`StructIgnoredRegexp`
88 - :option:`TemplateParameterCase`, :option:`TemplateParameterPrefix`, :option:`TemplateParameterSuffix`, :option:`TemplateParameterIgnoredRegexp`
89 - :option:`TemplateTemplateParameterCase`, :option:`TemplateTemplateParameterPrefix`, :option:`TemplateTemplateParameterSuffix`, :option:`TemplateTemplateParameterIgnoredRegexp`
90 - :option:`TypeAliasCase`, :option:`TypeAliasPrefix`, :option:`TypeAliasSuffix`, :option:`TypeAliasIgnoredRegexp`
91 - :option:`TypedefCase`, :option:`TypedefPrefix`, :option:`TypedefSuffix`, :option:`TypedefIgnoredRegexp`
92 - :option:`TypeTemplateParameterCase`, :option:`TypeTemplateParameterPrefix`, :option:`TypeTemplateParameterSuffix`, :option:`TypeTemplateParameterIgnoredRegexp`
93 - :option:`UnionCase`, :option:`UnionPrefix`, :option:`UnionSuffix`, :option:`UnionIgnoredRegexp`
94 - :option:`ValueTemplateParameterCase`, :option:`ValueTemplateParameterPrefix`, :option:`ValueTemplateParameterSuffix`, :option:`ValueTemplateParameterIgnoredRegexp`
95 - :option:`VariableCase`, :option:`VariablePrefix`, :option:`VariableSuffix`, :option:`VariableIgnoredRegexp`, :option:`VariableHungarianPrefix`
96 - :option:`VirtualMethodCase`, :option:`VirtualMethodPrefix`, :option:`VirtualMethodSuffix`, :option:`VirtualMethodIgnoredRegexp`
98 .. option:: AbstractClassCase
100 When defined, the check will ensure abstract class names conform to the
103 .. option:: AbstractClassPrefix
105 When defined, the check will ensure abstract class names will add the
106 prefixed with the given value (regardless of casing).
108 .. option:: AbstractClassIgnoredRegexp
110 Identifier naming checks won't be enforced for abstract class names
111 matching this regular expression.
113 .. option:: AbstractClassSuffix
115 When defined, the check will ensure abstract class names will add the
116 suffix with the given value (regardless of casing).
118 .. option:: AbstractClassHungarianPrefix
120 When enabled, the check ensures that the declared identifier will
121 have a Hungarian notation prefix based on the declared type.
123 For example using values of:
125 - AbstractClassCase of ``lower_case``
126 - AbstractClassPrefix of ``pre_``
127 - AbstractClassSuffix of ``_post``
128 - AbstractClassHungarianPrefix of ``On``
131 Identifies and/or transforms abstract class names as follows:
137 class ABSTRACT_CLASS {
146 class pre_abstract_class_post {
148 pre_abstract_class_post();
151 .. option:: AggressiveDependentMemberLookup
153 When set to `true` the check will look in dependent base classes for dependent
154 member references that need changing. This can lead to errors with template
155 specializations so the default value is `false`.
157 For example using values of:
159 - ClassMemberCase of ``lower_case``
165 template <typename T>
170 template <typename T>
171 struct Derived : Base<T> {
173 this->BadNamedMember = 0;
177 After if AggressiveDependentMemberLookup is `false`:
181 template <typename T>
186 template <typename T>
187 struct Derived : Base<T> {
189 this->BadNamedMember = 0;
193 After if AggressiveDependentMemberLookup is `true`:
197 template <typename T>
202 template <typename T>
203 struct Derived : Base<T> {
205 this->bad_named_member = 0;
209 .. option:: ClassCase
211 When defined, the check will ensure class names conform to the
214 .. option:: ClassPrefix
216 When defined, the check will ensure class names will add the
217 prefixed with the given value (regardless of casing).
219 .. option:: ClassIgnoredRegexp
221 Identifier naming checks won't be enforced for class names matching
222 this regular expression.
224 .. option:: ClassSuffix
226 When defined, the check will ensure class names will add the
227 suffix with the given value (regardless of casing).
229 .. option:: ClassHungarianPrefix
231 When enabled, the check ensures that the declared identifier will
232 have a Hungarian notation prefix based on the declared type.
234 For example using values of:
236 - ClassCase of ``lower_case``
237 - ClassPrefix of ``pre_``
238 - ClassSuffix of ``_post``
239 - ClassHungarianPrefix of ``On``
241 Identifies and/or transforms class names as follows:
263 .. option:: ClassConstantCase
265 When defined, the check will ensure class constant names conform to the
268 .. option:: ClassConstantPrefix
270 When defined, the check will ensure class constant names will add the
271 prefixed with the given value (regardless of casing).
273 .. option:: ClassConstantIgnoredRegexp
275 Identifier naming checks won't be enforced for class constant names
276 matching this regular expression.
278 .. option:: ClassConstantSuffix
280 When defined, the check will ensure class constant names will add the
281 suffix with the given value (regardless of casing).
283 .. option:: ClassConstantHungarianPrefix
285 When enabled, the check ensures that the declared identifier will
286 have a Hungarian notation prefix based on the declared type.
288 For example using values of:
290 - ClassConstantCase of ``lower_case``
291 - ClassConstantPrefix of ``pre_``
292 - ClassConstantSuffix of ``_post``
293 - ClassConstantHungarianPrefix of ``On``
295 Identifies and/or transforms class constant names as follows:
303 static const int CLASS_CONSTANT;
312 static const int pre_class_constant_post;
315 .. option:: ClassMemberCase
317 When defined, the check will ensure class member names conform to the
320 .. option:: ClassMemberPrefix
322 When defined, the check will ensure class member names will add the
323 prefixed with the given value (regardless of casing).
325 .. option:: ClassMemberIgnoredRegexp
327 Identifier naming checks won't be enforced for class member names
328 matching this regular expression.
330 .. option:: ClassMemberSuffix
332 When defined, the check will ensure class member names will add the
333 suffix with the given value (regardless of casing).
335 .. option:: ClassMemberHungarianPrefix
337 When enabled, the check ensures that the declared identifier will
338 have a Hungarian notation prefix based on the declared type.
340 For example using values of:
342 - ClassMemberCase of ``lower_case``
343 - ClassMemberPrefix of ``pre_``
344 - ClassMemberSuffix of ``_post``
345 - ClassMemberHungarianPrefix of ``On``
347 Identifies and/or transforms class member names as follows:
355 static int CLASS_CONSTANT;
364 static int pre_class_constant_post;
367 .. option:: ClassMethodCase
369 When defined, the check will ensure class method names conform to the
372 .. option:: ClassMethodPrefix
374 When defined, the check will ensure class method names will add the
375 prefixed with the given value (regardless of casing).
377 .. option:: ClassMethodIgnoredRegexp
379 Identifier naming checks won't be enforced for class method names
380 matching this regular expression.
382 .. option:: ClassMethodSuffix
384 When defined, the check will ensure class method names will add the
385 suffix with the given value (regardless of casing).
387 For example using values of:
389 - ClassMethodCase of ``lower_case``
390 - ClassMethodPrefix of ``pre_``
391 - ClassMethodSuffix of ``_post``
393 Identifies and/or transforms class method names as follows:
410 int pre_class_member_post();
413 .. option:: ConstantCase
415 When defined, the check will ensure constant names conform to the
418 .. option:: ConstantPrefix
420 When defined, the check will ensure constant names will add the
421 prefixed with the given value (regardless of casing).
423 .. option:: ConstantIgnoredRegexp
425 Identifier naming checks won't be enforced for constant names
426 matching this regular expression.
428 .. option:: ConstantSuffix
430 When defined, the check will ensure constant names will add the
431 suffix with the given value (regardless of casing).
433 .. option:: ConstantHungarianPrefix
435 When enabled, the check ensures that the declared identifier will
436 have a Hungarian notation prefix based on the declared type.
438 For example using values of:
440 - ConstantCase of ``lower_case``
441 - ConstantPrefix of ``pre_``
442 - ConstantSuffix of ``_post``
443 - ConstantHungarianPrefix of ``On``
445 Identifies and/or transforms constant names as follows:
451 void function() { unsigned const MyConst_array[] = {1, 2, 3}; }
457 void function() { unsigned const pre_myconst_array_post[] = {1, 2, 3}; }
459 .. option:: ConstantMemberCase
461 When defined, the check will ensure constant member names conform to the
464 .. option:: ConstantMemberPrefix
466 When defined, the check will ensure constant member names will add the
467 prefixed with the given value (regardless of casing).
469 .. option:: ConstantMemberIgnoredRegexp
471 Identifier naming checks won't be enforced for constant member names
472 matching this regular expression.
474 .. option:: ConstantMemberSuffix
476 When defined, the check will ensure constant member names will add the
477 suffix with the given value (regardless of casing).
479 .. option:: ConstantMemberHungarianPrefix
481 When enabled, the check ensures that the declared identifier will
482 have a Hungarian notation prefix based on the declared type.
484 For example using values of:
486 - ConstantMemberCase of ``lower_case``
487 - ConstantMemberPrefix of ``pre_``
488 - ConstantMemberSuffix of ``_post``
489 - ConstantMemberHungarianPrefix of ``On``
491 Identifies and/or transforms constant member names as follows:
498 char const MY_ConstMember_string[4] = "123";
506 char const pre_my_constmember_string_post[4] = "123";
509 .. option:: ConstantParameterCase
511 When defined, the check will ensure constant parameter names conform to the
514 .. option:: ConstantParameterPrefix
516 When defined, the check will ensure constant parameter names will add the
517 prefixed with the given value (regardless of casing).
519 .. option:: ConstantParameterIgnoredRegexp
521 Identifier naming checks won't be enforced for constant parameter names
522 matching this regular expression.
524 .. option:: ConstantParameterSuffix
526 When defined, the check will ensure constant parameter names will add the
527 suffix with the given value (regardless of casing).
529 .. option:: ConstantParameterHungarianPrefix
531 When enabled, the check ensures that the declared identifier will
532 have a Hungarian notation prefix based on the declared type.
534 For example using values of:
536 - ConstantParameterCase of ``lower_case``
537 - ConstantParameterPrefix of ``pre_``
538 - ConstantParameterSuffix of ``_post``
539 - ConstantParameterHungarianPrefix of ``On``
541 Identifies and/or transforms constant parameter names as follows:
547 void GLOBAL_FUNCTION(int PARAMETER_1, int const CONST_parameter);
553 void GLOBAL_FUNCTION(int PARAMETER_1, int const pre_const_parameter_post);
555 .. option:: ConstantPointerParameterCase
557 When defined, the check will ensure constant pointer parameter names conform to the
560 .. option:: ConstantPointerParameterPrefix
562 When defined, the check will ensure constant pointer parameter names will add the
563 prefixed with the given value (regardless of casing).
565 .. option:: ConstantPointerParameterIgnoredRegexp
567 Identifier naming checks won't be enforced for constant pointer parameter
568 names matching this regular expression.
570 .. option:: ConstantPointerParameterSuffix
572 When defined, the check will ensure constant pointer parameter names will add the
573 suffix with the given value (regardless of casing).
575 .. option:: ConstantPointerParameterHungarianPrefix
577 When enabled, the check ensures that the declared identifier will
578 have a Hungarian notation prefix based on the declared type.
580 For example using values of:
582 - ConstantPointerParameterCase of ``lower_case``
583 - ConstantPointerParameterPrefix of ``pre_``
584 - ConstantPointerParameterSuffix of ``_post``
585 - ConstantPointerParameterHungarianPrefix of ``On``
587 Identifies and/or transforms constant pointer parameter names as follows:
593 void GLOBAL_FUNCTION(int const *CONST_parameter);
599 void GLOBAL_FUNCTION(int const *pre_const_parameter_post);
601 .. option:: ConstexprFunctionCase
603 When defined, the check will ensure constexpr function names conform to the
606 .. option:: ConstexprFunctionPrefix
608 When defined, the check will ensure constexpr function names will add the
609 prefixed with the given value (regardless of casing).
611 .. option:: ConstexprFunctionIgnoredRegexp
613 Identifier naming checks won't be enforced for constexpr function names
614 matching this regular expression.
616 .. option:: ConstexprFunctionSuffix
618 When defined, the check will ensure constexpr function names will add the
619 suffix with the given value (regardless of casing).
621 For example using values of:
623 - ConstexprFunctionCase of ``lower_case``
624 - ConstexprFunctionPrefix of ``pre_``
625 - ConstexprFunctionSuffix of ``_post``
627 Identifies and/or transforms constexpr function names as follows:
633 constexpr int CE_function() { return 3; }
639 constexpr int pre_ce_function_post() { return 3; }
641 .. option:: ConstexprMethodCase
643 When defined, the check will ensure constexpr method names conform to the
646 .. option:: ConstexprMethodPrefix
648 When defined, the check will ensure constexpr method names will add the
649 prefixed with the given value (regardless of casing).
651 .. option:: ConstexprMethodIgnoredRegexp
653 Identifier naming checks won't be enforced for constexpr method names
654 matching this regular expression.
656 .. option:: ConstexprMethodSuffix
658 When defined, the check will ensure constexpr method names will add the
659 suffix with the given value (regardless of casing).
661 For example using values of:
663 - ConstexprMethodCase of ``lower_case``
664 - ConstexprMethodPrefix of ``pre_``
665 - ConstexprMethodSuffix of ``_post``
667 Identifies and/or transforms constexpr method names as follows:
675 constexpr int CST_expr_Method() { return 2; }
684 constexpr int pre_cst_expr_method_post() { return 2; }
687 .. option:: ConstexprVariableCase
689 When defined, the check will ensure constexpr variable names conform to the
692 .. option:: ConstexprVariablePrefix
694 When defined, the check will ensure constexpr variable names will add the
695 prefixed with the given value (regardless of casing).
697 .. option:: ConstexprVariableIgnoredRegexp
699 Identifier naming checks won't be enforced for constexpr variable names
700 matching this regular expression.
702 .. option:: ConstexprVariableSuffix
704 When defined, the check will ensure constexpr variable names will add the
705 suffix with the given value (regardless of casing).
707 .. option:: ConstexprVariableHungarianPrefix
709 When enabled, the check ensures that the declared identifier will
710 have a Hungarian notation prefix based on the declared type.
712 For example using values of:
714 - ConstexprVariableCase of ``lower_case``
715 - ConstexprVariablePrefix of ``pre_``
716 - ConstexprVariableSuffix of ``_post``
717 - ConstexprVariableHungarianPrefix of ``On``
719 Identifies and/or transforms constexpr variable names as follows:
725 constexpr int ConstExpr_variable = MyConstant;
731 constexpr int pre_constexpr_variable_post = MyConstant;
735 When defined, the check will ensure enumeration names conform to the
738 .. option:: EnumPrefix
740 When defined, the check will ensure enumeration names will add the
741 prefixed with the given value (regardless of casing).
743 .. option:: EnumIgnoredRegexp
745 Identifier naming checks won't be enforced for enumeration names
746 matching this regular expression.
748 .. option:: EnumSuffix
750 When defined, the check will ensure enumeration names will add the
751 suffix with the given value (regardless of casing).
753 For example using values of:
755 - EnumCase of ``lower_case``
756 - EnumPrefix of ``pre_``
757 - EnumSuffix of ``_post``
759 Identifies and/or transforms enumeration names as follows:
765 enum FOO { One, Two, Three };
771 enum pre_foo_post { One, Two, Three };
773 .. option:: EnumConstantCase
775 When defined, the check will ensure enumeration constant names conform to the
778 .. option:: EnumConstantPrefix
780 When defined, the check will ensure enumeration constant names will add the
781 prefixed with the given value (regardless of casing).
783 .. option:: EnumConstantIgnoredRegexp
785 Identifier naming checks won't be enforced for enumeration constant names
786 matching this regular expression.
788 .. option:: EnumConstantSuffix
790 When defined, the check will ensure enumeration constant names will add the
791 suffix with the given value (regardless of casing).
793 .. option:: EnumConstantHungarianPrefix
795 When enabled, the check ensures that the declared identifier will
796 have a Hungarian notation prefix based on the declared type.
798 For example using values of:
800 - EnumConstantCase of ``lower_case``
801 - EnumConstantPrefix of ``pre_``
802 - EnumConstantSuffix of ``_post``
803 - EnumConstantHungarianPrefix of ``On``
805 Identifies and/or transforms enumeration constant names as follows:
811 enum FOO { One, Two, Three };
817 enum FOO { pre_One_post, pre_Two_post, pre_Three_post };
819 .. option:: FunctionCase
821 When defined, the check will ensure function names conform to the
824 .. option:: FunctionPrefix
826 When defined, the check will ensure function names will add the
827 prefixed with the given value (regardless of casing).
829 .. option:: FunctionIgnoredRegexp
831 Identifier naming checks won't be enforced for function names
832 matching this regular expression.
834 .. option:: FunctionSuffix
836 When defined, the check will ensure function names will add the
837 suffix with the given value (regardless of casing).
839 For example using values of:
841 - FunctionCase of ``lower_case``
842 - FunctionPrefix of ``pre_``
843 - FunctionSuffix of ``_post``
845 Identifies and/or transforms function names as follows:
851 char MY_Function_string();
857 char pre_my_function_string_post();
859 .. option:: GetConfigPerFile
861 When `true` the check will look for the configuration for where an
862 identifier is declared. Useful for when included header files use a
864 Default value is `true`.
866 .. option:: GlobalConstantCase
868 When defined, the check will ensure global constant names conform to the
871 .. option:: GlobalConstantPrefix
873 When defined, the check will ensure global constant names will add the
874 prefixed with the given value (regardless of casing).
876 .. option:: GlobalConstantIgnoredRegexp
878 Identifier naming checks won't be enforced for global constant names
879 matching this regular expression.
881 .. option:: GlobalConstantSuffix
883 When defined, the check will ensure global constant names will add the
884 suffix with the given value (regardless of casing).
886 .. option:: GlobalConstantHungarianPrefix
888 When enabled, the check ensures that the declared identifier will
889 have a Hungarian notation prefix based on the declared type.
891 For example using values of:
893 - GlobalConstantCase of ``lower_case``
894 - GlobalConstantPrefix of ``pre_``
895 - GlobalConstantSuffix of ``_post``
896 - GlobalConstantHungarianPrefix of ``On``
898 Identifies and/or transforms global constant names as follows:
904 unsigned const MyConstGlobal_array[] = {1, 2, 3};
910 unsigned const pre_myconstglobal_array_post[] = {1, 2, 3};
912 .. option:: GlobalConstantPointerCase
914 When defined, the check will ensure global constant pointer names conform to the
917 .. option:: GlobalConstantPointerPrefix
919 When defined, the check will ensure global constant pointer names will add the
920 prefixed with the given value (regardless of casing).
922 .. option:: GlobalConstantPointerIgnoredRegexp
924 Identifier naming checks won't be enforced for global constant pointer
925 names matching this regular expression.
927 .. option:: GlobalConstantPointerSuffix
929 When defined, the check will ensure global constant pointer names will add the
930 suffix with the given value (regardless of casing).
932 .. option:: GlobalConstantPointerHungarianPrefix
934 When enabled, the check ensures that the declared identifier will
935 have a Hungarian notation prefix based on the declared type.
937 For example using values of:
939 - GlobalConstantPointerCase of ``lower_case``
940 - GlobalConstantPointerPrefix of ``pre_``
941 - GlobalConstantPointerSuffix of ``_post``
942 - GlobalConstantPointerHungarianPrefix of ``On``
944 Identifies and/or transforms global constant pointer names as follows:
950 int *const MyConstantGlobalPointer = nullptr;
956 int *const pre_myconstantglobalpointer_post = nullptr;
958 .. option:: GlobalFunctionCase
960 When defined, the check will ensure global function names conform to the
963 .. option:: GlobalFunctionPrefix
965 When defined, the check will ensure global function names will add the
966 prefixed with the given value (regardless of casing).
968 .. option:: GlobalFunctionIgnoredRegexp
970 Identifier naming checks won't be enforced for global function names
971 matching this regular expression.
973 .. option:: GlobalFunctionSuffix
975 When defined, the check will ensure global function names will add the
976 suffix with the given value (regardless of casing).
978 For example using values of:
980 - GlobalFunctionCase of ``lower_case``
981 - GlobalFunctionPrefix of ``pre_``
982 - GlobalFunctionSuffix of ``_post``
984 Identifies and/or transforms global function names as follows:
990 void GLOBAL_FUNCTION(int PARAMETER_1, int const CONST_parameter);
996 void pre_global_function_post(int PARAMETER_1, int const CONST_parameter);
998 .. option:: GlobalPointerCase
1000 When defined, the check will ensure global pointer names conform to the
1003 .. option:: GlobalPointerPrefix
1005 When defined, the check will ensure global pointer names will add the
1006 prefixed with the given value (regardless of casing).
1008 .. option:: GlobalPointerIgnoredRegexp
1010 Identifier naming checks won't be enforced for global pointer names
1011 matching this regular expression.
1013 .. option:: GlobalPointerSuffix
1015 When defined, the check will ensure global pointer names will add the
1016 suffix with the given value (regardless of casing).
1018 .. option:: GlobalPointerHungarianPrefix
1020 When enabled, the check ensures that the declared identifier will
1021 have a Hungarian notation prefix based on the declared type.
1023 For example using values of:
1025 - GlobalPointerCase of ``lower_case``
1026 - GlobalPointerPrefix of ``pre_``
1027 - GlobalPointerSuffix of ``_post``
1028 - GlobalPointerHungarianPrefix of ``On``
1030 Identifies and/or transforms global pointer names as follows:
1042 int *pre_global3_post;
1044 .. option:: GlobalVariableCase
1046 When defined, the check will ensure global variable names conform to the
1049 .. option:: GlobalVariablePrefix
1051 When defined, the check will ensure global variable names will add the
1052 prefixed with the given value (regardless of casing).
1054 .. option:: GlobalVariableIgnoredRegexp
1056 Identifier naming checks won't be enforced for global variable names
1057 matching this regular expression.
1059 .. option:: GlobalVariableSuffix
1061 When defined, the check will ensure global variable names will add the
1062 suffix with the given value (regardless of casing).
1064 .. option:: GlobalVariableHungarianPrefix
1066 When enabled, the check ensures that the declared identifier will
1067 have a Hungarian notation prefix based on the declared type.
1069 For example using values of:
1071 - GlobalVariableCase of ``lower_case``
1072 - GlobalVariablePrefix of ``pre_``
1073 - GlobalVariableSuffix of ``_post``
1074 - GlobalVariableHungarianPrefix of ``On``
1076 Identifies and/or transforms global variable names as follows:
1088 int pre_global3_post;
1090 .. option:: IgnoreMainLikeFunctions
1092 When set to `true` functions that have a similar signature to ``main`` or
1093 ``wmain`` won't enforce checks on the names of their parameters.
1094 Default value is `false`.
1096 .. option:: InlineNamespaceCase
1098 When defined, the check will ensure inline namespaces names conform to the
1101 .. option:: InlineNamespacePrefix
1103 When defined, the check will ensure inline namespaces names will add the
1104 prefixed with the given value (regardless of casing).
1106 .. option:: InlineNamespaceIgnoredRegexp
1108 Identifier naming checks won't be enforced for inline namespaces names
1109 matching this regular expression.
1111 .. option:: InlineNamespaceSuffix
1113 When defined, the check will ensure inline namespaces names will add the
1114 suffix with the given value (regardless of casing).
1116 For example using values of:
1118 - InlineNamespaceCase of ``lower_case``
1119 - InlineNamespacePrefix of ``pre_``
1120 - InlineNamespaceSuffix of ``_post``
1122 Identifies and/or transforms inline namespaces names as follows:
1129 inline namespace InlineNamespace {
1132 } // namespace FOO_NS
1139 inline namespace pre_inlinenamespace_post {
1142 } // namespace FOO_NS
1144 .. option:: LocalConstantCase
1146 When defined, the check will ensure local constant names conform to the
1149 .. option:: LocalConstantPrefix
1151 When defined, the check will ensure local constant names will add the
1152 prefixed with the given value (regardless of casing).
1154 .. option:: LocalConstantIgnoredRegexp
1156 Identifier naming checks won't be enforced for local constant names
1157 matching this regular expression.
1159 .. option:: LocalConstantSuffix
1161 When defined, the check will ensure local constant names will add the
1162 suffix with the given value (regardless of casing).
1164 .. option:: LocalConstantHungarianPrefix
1166 When enabled, the check ensures that the declared identifier will
1167 have a Hungarian notation prefix based on the declared type.
1169 For example using values of:
1171 - LocalConstantCase of ``lower_case``
1172 - LocalConstantPrefix of ``pre_``
1173 - LocalConstantSuffix of ``_post``
1174 - LocalConstantHungarianPrefix of ``On``
1176 Identifies and/or transforms local constant names as follows:
1182 void foo() { int const local_Constant = 3; }
1188 void foo() { int const pre_local_constant_post = 3; }
1190 .. option:: LocalConstantPointerCase
1192 When defined, the check will ensure local constant pointer names conform to the
1195 .. option:: LocalConstantPointerPrefix
1197 When defined, the check will ensure local constant pointer names will add the
1198 prefixed with the given value (regardless of casing).
1200 .. option:: LocalConstantPointerIgnoredRegexp
1202 Identifier naming checks won't be enforced for local constant pointer names
1203 matching this regular expression.
1205 .. option:: LocalConstantPointerSuffix
1207 When defined, the check will ensure local constant pointer names will add the
1208 suffix with the given value (regardless of casing).
1210 .. option:: LocalConstantPointerHungarianPrefix
1212 When enabled, the check ensures that the declared identifier will
1213 have a Hungarian notation prefix based on the declared type.
1215 For example using values of:
1217 - LocalConstantPointerCase of ``lower_case``
1218 - LocalConstantPointerPrefix of ``pre_``
1219 - LocalConstantPointerSuffix of ``_post``
1220 - LocalConstantPointerHungarianPrefix of ``On``
1222 Identifies and/or transforms local constant pointer names as follows:
1228 void foo() { int const *local_Constant = 3; }
1234 void foo() { int const *pre_local_constant_post = 3; }
1236 .. option:: LocalPointerCase
1238 When defined, the check will ensure local pointer names conform to the
1241 .. option:: LocalPointerPrefix
1243 When defined, the check will ensure local pointer names will add the
1244 prefixed with the given value (regardless of casing).
1246 .. option:: LocalPointerIgnoredRegexp
1248 Identifier naming checks won't be enforced for local pointer names
1249 matching this regular expression.
1251 .. option:: LocalPointerSuffix
1253 When defined, the check will ensure local pointer names will add the
1254 suffix with the given value (regardless of casing).
1256 .. option:: LocalPointerHungarianPrefix
1258 When enabled, the check ensures that the declared identifier will
1259 have a Hungarian notation prefix based on the declared type.
1261 For example using values of:
1263 - LocalPointerCase of ``lower_case``
1264 - LocalPointerPrefix of ``pre_``
1265 - LocalPointerSuffix of ``_post``
1266 - LocalPointerHungarianPrefix of ``On``
1268 Identifies and/or transforms local pointer names as follows:
1274 void foo() { int *local_Constant; }
1280 void foo() { int *pre_local_constant_post; }
1282 .. option:: LocalVariableCase
1284 When defined, the check will ensure local variable names conform to the
1287 .. option:: LocalVariablePrefix
1289 When defined, the check will ensure local variable names will add the
1290 prefixed with the given value (regardless of casing).
1292 .. option:: LocalVariableIgnoredRegexp
1294 Identifier naming checks won't be enforced for local variable names
1295 matching this regular expression.
1297 For example using values of:
1299 - LocalVariableCase of ``CamelCase``
1300 - LocalVariableIgnoredRegexp of ``\w{1,2}``
1302 Will exclude variables with a length less than or equal to 2 from the
1303 camel case check applied to other variables.
1305 .. option:: LocalVariableSuffix
1307 When defined, the check will ensure local variable names will add the
1308 suffix with the given value (regardless of casing).
1310 .. option:: LocalVariableHungarianPrefix
1312 When enabled, the check ensures that the declared identifier will
1313 have a Hungarian notation prefix based on the declared type.
1315 For example using values of:
1317 - LocalVariableCase of ``lower_case``
1318 - LocalVariablePrefix of ``pre_``
1319 - LocalVariableSuffix of ``_post``
1320 - LocalVariableHungarianPrefix of ``On``
1322 Identifies and/or transforms local variable names as follows:
1328 void foo() { int local_Constant; }
1334 void foo() { int pre_local_constant_post; }
1336 .. option:: MacroDefinitionCase
1338 When defined, the check will ensure macro definitions conform to the
1341 .. option:: MacroDefinitionPrefix
1343 When defined, the check will ensure macro definitions will add the
1344 prefixed with the given value (regardless of casing).
1346 .. option:: MacroDefinitionIgnoredRegexp
1348 Identifier naming checks won't be enforced for macro definitions
1349 matching this regular expression.
1351 .. option:: MacroDefinitionSuffix
1353 When defined, the check will ensure macro definitions will add the
1354 suffix with the given value (regardless of casing).
1356 For example using values of:
1358 - MacroDefinitionCase of ``lower_case``
1359 - MacroDefinitionPrefix of ``pre_``
1360 - MacroDefinitionSuffix of ``_post``
1362 Identifies and/or transforms macro definitions as follows:
1368 #define MY_MacroDefinition
1374 #define pre_my_macro_definition_post
1376 Note: This will not warn on builtin macros or macros defined on the command line
1377 using the ``-D`` flag.
1379 .. option:: MemberCase
1381 When defined, the check will ensure member names conform to the
1384 .. option:: MemberPrefix
1386 When defined, the check will ensure member names will add the
1387 prefixed with the given value (regardless of casing).
1389 .. option:: MemberIgnoredRegexp
1391 Identifier naming checks won't be enforced for member names
1392 matching this regular expression.
1394 .. option:: MemberSuffix
1396 When defined, the check will ensure member names will add the
1397 suffix with the given value (regardless of casing).
1399 .. option:: MemberHungarianPrefix
1401 When enabled, the check ensures that the declared identifier will
1402 have a Hungarian notation prefix based on the declared type.
1404 For example using values of:
1406 - MemberCase of ``lower_case``
1407 - MemberPrefix of ``pre_``
1408 - MemberSuffix of ``_post``
1409 - MemberHungarianPrefix of ``On``
1411 Identifies and/or transforms member names as follows:
1418 char MY_ConstMember_string[4];
1426 char pre_my_constmember_string_post[4];
1429 .. option:: MethodCase
1431 When defined, the check will ensure method names conform to the
1434 .. option:: MethodPrefix
1436 When defined, the check will ensure method names will add the
1437 prefixed with the given value (regardless of casing).
1439 .. option:: MethodIgnoredRegexp
1441 Identifier naming checks won't be enforced for method names
1442 matching this regular expression.
1444 .. option:: MethodSuffix
1446 When defined, the check will ensure method names will add the
1447 suffix with the given value (regardless of casing).
1449 For example using values of:
1451 - MethodCase of ``lower_case``
1452 - MethodPrefix of ``pre_``
1453 - MethodSuffix of ``_post``
1455 Identifies and/or transforms method names as follows:
1462 char MY_Method_string();
1470 char pre_my_method_string_post();
1473 .. option:: NamespaceCase
1475 When defined, the check will ensure namespace names conform to the
1478 .. option:: NamespacePrefix
1480 When defined, the check will ensure namespace names will add the
1481 prefixed with the given value (regardless of casing).
1483 .. option:: NamespaceIgnoredRegexp
1485 Identifier naming checks won't be enforced for namespace names
1486 matching this regular expression.
1488 .. option:: NamespaceSuffix
1490 When defined, the check will ensure namespace names will add the
1491 suffix with the given value (regardless of casing).
1493 For example using values of:
1495 - NamespaceCase of ``lower_case``
1496 - NamespacePrefix of ``pre_``
1497 - NamespaceSuffix of ``_post``
1499 Identifies and/or transforms namespace names as follows:
1513 namespace pre_foo_ns_post {
1517 .. option:: ParameterCase
1519 When defined, the check will ensure parameter names conform to the
1522 .. option:: ParameterPrefix
1524 When defined, the check will ensure parameter names will add the
1525 prefixed with the given value (regardless of casing).
1527 .. option:: ParameterIgnoredRegexp
1529 Identifier naming checks won't be enforced for parameter names
1530 matching this regular expression.
1532 .. option:: ParameterSuffix
1534 When defined, the check will ensure parameter names will add the
1535 suffix with the given value (regardless of casing).
1537 .. option:: ParameterHungarianPrefix
1539 When enabled, the check ensures that the declared identifier will
1540 have a Hungarian notation prefix based on the declared type.
1542 For example using values of:
1544 - ParameterCase of ``lower_case``
1545 - ParameterPrefix of ``pre_``
1546 - ParameterSuffix of ``_post``
1547 - ParameterHungarianPrefix of ``On``
1549 Identifies and/or transforms parameter names as follows:
1555 void GLOBAL_FUNCTION(int PARAMETER_1, int const CONST_parameter);
1561 void GLOBAL_FUNCTION(int pre_parameter_post, int const CONST_parameter);
1563 .. option:: ParameterPackCase
1565 When defined, the check will ensure parameter pack names conform to the
1568 .. option:: ParameterPackPrefix
1570 When defined, the check will ensure parameter pack names will add the
1571 prefixed with the given value (regardless of casing).
1573 .. option:: ParameterPackIgnoredRegexp
1575 Identifier naming checks won't be enforced for parameter pack names
1576 matching this regular expression.
1578 .. option:: ParameterPackSuffix
1580 When defined, the check will ensure parameter pack names will add the
1581 suffix with the given value (regardless of casing).
1583 For example using values of:
1585 - ParameterPackCase of ``lower_case``
1586 - ParameterPackPrefix of ``pre_``
1587 - ParameterPackSuffix of ``_post``
1589 Identifies and/or transforms parameter pack names as follows:
1595 template <typename... TYPE_parameters> {
1596 void FUNCTION(int... TYPE_parameters);
1603 template <typename... TYPE_parameters> {
1604 void FUNCTION(int... pre_type_parameters_post);
1607 .. option:: PointerParameterCase
1609 When defined, the check will ensure pointer parameter names conform to the
1612 .. option:: PointerParameterPrefix
1614 When defined, the check will ensure pointer parameter names will add the
1615 prefixed with the given value (regardless of casing).
1617 .. option:: PointerParameterIgnoredRegexp
1619 Identifier naming checks won't be enforced for pointer parameter names
1620 matching this regular expression.
1622 .. option:: PointerParameterSuffix
1624 When defined, the check will ensure pointer parameter names will add the
1625 suffix with the given value (regardless of casing).
1627 .. option:: PointerParameterHungarianPrefix
1629 When enabled, the check ensures that the declared identifier will
1630 have a Hungarian notation prefix based on the declared type.
1632 For example using values of:
1634 - PointerParameterCase of ``lower_case``
1635 - PointerParameterPrefix of ``pre_``
1636 - PointerParameterSuffix of ``_post``
1637 - PointerParameterHungarianPrefix of ``On``
1639 Identifies and/or transforms pointer parameter names as follows:
1645 void FUNCTION(int *PARAMETER);
1651 void FUNCTION(int *pre_parameter_post);
1653 .. option:: PrivateMemberCase
1655 When defined, the check will ensure private member names conform to the
1658 .. option:: PrivateMemberPrefix
1660 When defined, the check will ensure private member names will add the
1661 prefixed with the given value (regardless of casing).
1663 .. option:: PrivateMemberIgnoredRegexp
1665 Identifier naming checks won't be enforced for private member names
1666 matching this regular expression.
1668 .. option:: PrivateMemberSuffix
1670 When defined, the check will ensure private member names will add the
1671 suffix with the given value (regardless of casing).
1673 .. option:: PrivateMemberHungarianPrefix
1675 When enabled, the check ensures that the declared identifier will
1676 have a Hungarian notation prefix based on the declared type.
1678 For example using values of:
1680 - PrivateMemberCase of ``lower_case``
1681 - PrivateMemberPrefix of ``pre_``
1682 - PrivateMemberSuffix of ``_post``
1683 - PrivateMemberHungarianPrefix of ``On``
1685 Identifies and/or transforms private member names as follows:
1693 int Member_Variable;
1702 int pre_member_variable_post;
1705 .. option:: PrivateMethodCase
1707 When defined, the check will ensure private method names conform to the
1710 .. option:: PrivateMethodPrefix
1712 When defined, the check will ensure private method names will add the
1713 prefixed with the given value (regardless of casing).
1715 .. option:: PrivateMethodIgnoredRegexp
1717 Identifier naming checks won't be enforced for private method names
1718 matching this regular expression.
1720 .. option:: PrivateMethodSuffix
1722 When defined, the check will ensure private method names will add the
1723 suffix with the given value (regardless of casing).
1725 For example using values of:
1727 - PrivateMethodCase of ``lower_case``
1728 - PrivateMethodPrefix of ``pre_``
1729 - PrivateMethodSuffix of ``_post``
1731 Identifies and/or transforms private method names as follows:
1739 int Member_Method();
1748 int pre_member_method_post();
1751 .. option:: ProtectedMemberCase
1753 When defined, the check will ensure protected member names conform to the
1756 .. option:: ProtectedMemberPrefix
1758 When defined, the check will ensure protected member names will add the
1759 prefixed with the given value (regardless of casing).
1761 .. option:: ProtectedMemberIgnoredRegexp
1763 Identifier naming checks won't be enforced for protected member names
1764 matching this regular expression.
1766 .. option:: ProtectedMemberSuffix
1768 When defined, the check will ensure protected member names will add the
1769 suffix with the given value (regardless of casing).
1771 .. option:: ProtectedMemberHungarianPrefix
1773 When enabled, the check ensures that the declared identifier will
1774 have a Hungarian notation prefix based on the declared type.
1776 For example using values of:
1778 - ProtectedMemberCase of ``lower_case``
1779 - ProtectedMemberPrefix of ``pre_``
1780 - ProtectedMemberSuffix of ``_post``
1781 - ProtectedMemberHungarianPrefix of ``On``
1783 Identifies and/or transforms protected member names as follows:
1791 int Member_Variable;
1800 int pre_member_variable_post;
1803 .. option:: ProtectedMethodCase
1805 When defined, the check will ensure protected method names conform to the
1808 .. option:: ProtectedMethodPrefix
1810 When defined, the check will ensure protected method names will add the
1811 prefixed with the given value (regardless of casing).
1813 .. option:: ProtectedMethodIgnoredRegexp
1815 Identifier naming checks won't be enforced for protected method names
1816 matching this regular expression.
1818 .. option:: ProtectedMethodSuffix
1820 When defined, the check will ensure protected method names will add the
1821 suffix with the given value (regardless of casing).
1823 For example using values of:
1825 - ProtectedMethodCase of ``lower_case``
1826 - ProtectedMethodPrefix of ``pre_``
1827 - ProtectedMethodSuffix of ``_post``
1829 Identifies and/or transforms protect method names as follows:
1837 int Member_Method();
1846 int pre_member_method_post();
1849 .. option:: PublicMemberCase
1851 When defined, the check will ensure public member names conform to the
1854 .. option:: PublicMemberPrefix
1856 When defined, the check will ensure public member names will add the
1857 prefixed with the given value (regardless of casing).
1859 .. option:: PublicMemberIgnoredRegexp
1861 Identifier naming checks won't be enforced for public member names
1862 matching this regular expression.
1864 .. option:: PublicMemberSuffix
1866 When defined, the check will ensure public member names will add the
1867 suffix with the given value (regardless of casing).
1869 .. option:: PublicMemberHungarianPrefix
1871 When enabled, the check ensures that the declared identifier will
1872 have a Hungarian notation prefix based on the declared type.
1874 For example using values of:
1876 - PublicMemberCase of ``lower_case``
1877 - PublicMemberPrefix of ``pre_``
1878 - PublicMemberSuffix of ``_post``
1879 - PublicMemberHungarianPrefix of ``On``
1881 Identifies and/or transforms public member names as follows:
1889 int Member_Variable;
1898 int pre_member_variable_post;
1901 .. option:: PublicMethodCase
1903 When defined, the check will ensure public method names conform to the
1906 .. option:: PublicMethodPrefix
1908 When defined, the check will ensure public method names will add the
1909 prefixed with the given value (regardless of casing).
1911 .. option:: PublicMethodIgnoredRegexp
1913 Identifier naming checks won't be enforced for public method names
1914 matching this regular expression.
1916 .. option:: PublicMethodSuffix
1918 When defined, the check will ensure public method names will add the
1919 suffix with the given value (regardless of casing).
1921 For example using values of:
1923 - PublicMethodCase of ``lower_case``
1924 - PublicMethodPrefix of ``pre_``
1925 - PublicMethodSuffix of ``_post``
1927 Identifies and/or transforms public method names as follows:
1935 int Member_Method();
1944 int pre_member_method_post();
1947 .. option:: ScopedEnumConstantCase
1949 When defined, the check will ensure scoped enum constant names conform to
1950 the selected casing.
1952 .. option:: ScopedEnumConstantPrefix
1954 When defined, the check will ensure scoped enum constant names will add the
1955 prefixed with the given value (regardless of casing).
1957 .. option:: ScopedEnumConstantIgnoredRegexp
1959 Identifier naming checks won't be enforced for scoped enum constant names
1960 matching this regular expression.
1962 .. option:: ScopedEnumConstantSuffix
1964 When defined, the check will ensure scoped enum constant names will add the
1965 suffix with the given value (regardless of casing).
1967 .. option:: ScopedEnumConstantHungarianPrefix
1969 When enabled, the check ensures that the declared identifier will
1970 have a Hungarian notation prefix based on the declared type.
1972 For example using values of:
1974 - ScopedEnumConstantCase of ``lower_case``
1975 - ScopedEnumConstantPrefix of ``pre_``
1976 - ScopedEnumConstantSuffix of ``_post``
1977 - ScopedEnumConstantHungarianPrefix of ``On``
1979 Identifies and/or transforms enumeration constant names as follows:
1985 enum class FOO { One, Two, Three };
1991 enum class FOO { pre_One_post, pre_Two_post, pre_Three_post };
1993 .. option:: StaticConstantCase
1995 When defined, the check will ensure static constant names conform to the
1998 .. option:: StaticConstantPrefix
2000 When defined, the check will ensure static constant names will add the
2001 prefixed with the given value (regardless of casing).
2003 .. option:: StaticConstantIgnoredRegexp
2005 Identifier naming checks won't be enforced for static constant names
2006 matching this regular expression.
2008 .. option:: StaticConstantSuffix
2010 When defined, the check will ensure static constant names will add the
2011 suffix with the given value (regardless of casing).
2013 .. option:: StaticConstantHungarianPrefix
2015 When enabled, the check ensures that the declared identifier will
2016 have a Hungarian notation prefix based on the declared type.
2018 For example using values of:
2020 - StaticConstantCase of ``lower_case``
2021 - StaticConstantPrefix of ``pre_``
2022 - StaticConstantSuffix of ``_post``
2023 - StaticConstantHungarianPrefix of ``On``
2025 Identifies and/or transforms static constant names as follows:
2031 static unsigned const MyConstStatic_array[] = {1, 2, 3};
2037 static unsigned const pre_myconststatic_array_post[] = {1, 2, 3};
2039 .. option:: StaticVariableCase
2041 When defined, the check will ensure static variable names conform to the
2044 .. option:: StaticVariablePrefix
2046 When defined, the check will ensure static variable names will add the
2047 prefixed with the given value (regardless of casing).
2049 .. option:: StaticVariableIgnoredRegexp
2051 Identifier naming checks won't be enforced for static variable names
2052 matching this regular expression.
2054 .. option:: StaticVariableSuffix
2056 When defined, the check will ensure static variable names will add the
2057 suffix with the given value (regardless of casing).
2059 .. option:: StaticVariableHungarianPrefix
2061 When enabled, the check ensures that the declared identifier will
2062 have a Hungarian notation prefix based on the declared type.
2064 For example using values of:
2066 - StaticVariableCase of ``lower_case``
2067 - StaticVariablePrefix of ``pre_``
2068 - StaticVariableSuffix of ``_post``
2069 - StaticVariableHungarianPrefix of ``On``
2071 Identifies and/or transforms static variable names as follows:
2077 static unsigned MyStatic_array[] = {1, 2, 3};
2083 static unsigned pre_mystatic_array_post[] = {1, 2, 3};
2085 .. option:: StructCase
2087 When defined, the check will ensure struct names conform to the
2090 .. option:: StructPrefix
2092 When defined, the check will ensure struct names will add the
2093 prefixed with the given value (regardless of casing).
2095 .. option:: StructIgnoredRegexp
2097 Identifier naming checks won't be enforced for struct names
2098 matching this regular expression.
2100 .. option:: StructSuffix
2102 When defined, the check will ensure struct names will add the
2103 suffix with the given value (regardless of casing).
2105 For example using values of:
2107 - StructCase of ``lower_case``
2108 - StructPrefix of ``pre_``
2109 - StructSuffix of ``_post``
2111 Identifies and/or transforms struct names as follows:
2126 struct pre_foo_post {
2131 .. option:: TemplateParameterCase
2133 When defined, the check will ensure template parameter names conform to the
2136 .. option:: TemplateParameterPrefix
2138 When defined, the check will ensure template parameter names will add the
2139 prefixed with the given value (regardless of casing).
2141 .. option:: TemplateParameterIgnoredRegexp
2143 Identifier naming checks won't be enforced for template parameter names
2144 matching this regular expression.
2146 .. option:: TemplateParameterSuffix
2148 When defined, the check will ensure template parameter names will add the
2149 suffix with the given value (regardless of casing).
2151 For example using values of:
2153 - TemplateParameterCase of ``lower_case``
2154 - TemplateParameterPrefix of ``pre_``
2155 - TemplateParameterSuffix of ``_post``
2157 Identifies and/or transforms template parameter names as follows:
2163 template <typename T> class Foo {};
2169 template <typename pre_t_post> class Foo {};
2171 .. option:: TemplateTemplateParameterCase
2173 When defined, the check will ensure template template parameter names conform to the
2176 .. option:: TemplateTemplateParameterPrefix
2178 When defined, the check will ensure template template parameter names will add the
2179 prefixed with the given value (regardless of casing).
2181 .. option:: TemplateTemplateParameterIgnoredRegexp
2183 Identifier naming checks won't be enforced for template template parameter
2184 names matching this regular expression.
2186 .. option:: TemplateTemplateParameterSuffix
2188 When defined, the check will ensure template template parameter names will add the
2189 suffix with the given value (regardless of casing).
2191 For example using values of:
2193 - TemplateTemplateParameterCase of ``lower_case``
2194 - TemplateTemplateParameterPrefix of ``pre_``
2195 - TemplateTemplateParameterSuffix of ``_post``
2197 Identifies and/or transforms template template parameter names as follows:
2203 template <template <typename> class TPL_parameter, int COUNT_params,
2204 typename... TYPE_parameters>
2210 template <template <typename> class pre_tpl_parameter_post, int COUNT_params,
2211 typename... TYPE_parameters>
2213 .. option:: TypeAliasCase
2215 When defined, the check will ensure type alias names conform to the
2218 .. option:: TypeAliasPrefix
2220 When defined, the check will ensure type alias names will add the
2221 prefixed with the given value (regardless of casing).
2223 .. option:: TypeAliasIgnoredRegexp
2225 Identifier naming checks won't be enforced for type alias names
2226 matching this regular expression.
2228 .. option:: TypeAliasSuffix
2230 When defined, the check will ensure type alias names will add the
2231 suffix with the given value (regardless of casing).
2233 For example using values of:
2235 - TypeAliasCase of ``lower_case``
2236 - TypeAliasPrefix of ``pre_``
2237 - TypeAliasSuffix of ``_post``
2239 Identifies and/or transforms type alias names as follows:
2245 using MY_STRUCT_TYPE = my_structure;
2251 using pre_my_struct_type_post = my_structure;
2253 .. option:: TypedefCase
2255 When defined, the check will ensure typedef names conform to the
2258 .. option:: TypedefPrefix
2260 When defined, the check will ensure typedef names will add the
2261 prefixed with the given value (regardless of casing).
2263 .. option:: TypedefIgnoredRegexp
2265 Identifier naming checks won't be enforced for typedef names
2266 matching this regular expression.
2268 .. option:: TypedefSuffix
2270 When defined, the check will ensure typedef names will add the
2271 suffix with the given value (regardless of casing).
2273 For example using values of:
2275 - TypedefCase of ``lower_case``
2276 - TypedefPrefix of ``pre_``
2277 - TypedefSuffix of ``_post``
2279 Identifies and/or transforms typedef names as follows:
2291 typedef int pre_myint_post;
2293 .. option:: TypeTemplateParameterCase
2295 When defined, the check will ensure type template parameter names conform to the
2298 .. option:: TypeTemplateParameterPrefix
2300 When defined, the check will ensure type template parameter names will add the
2301 prefixed with the given value (regardless of casing).
2303 .. option:: TypeTemplateParameterIgnoredRegexp
2305 Identifier naming checks won't be enforced for type template names
2306 matching this regular expression.
2308 .. option:: TypeTemplateParameterSuffix
2310 When defined, the check will ensure type template parameter names will add the
2311 suffix with the given value (regardless of casing).
2313 For example using values of:
2315 - TypeTemplateParameterCase of ``lower_case``
2316 - TypeTemplateParameterPrefix of ``pre_``
2317 - TypeTemplateParameterSuffix of ``_post``
2319 Identifies and/or transforms type template parameter names as follows:
2325 template <template <typename> class TPL_parameter, int COUNT_params,
2326 typename... TYPE_parameters>
2332 template <template <typename> class TPL_parameter, int COUNT_params,
2333 typename... pre_type_parameters_post>
2335 .. option:: UnionCase
2337 When defined, the check will ensure union names conform to the
2340 .. option:: UnionPrefix
2342 When defined, the check will ensure union names will add the
2343 prefixed with the given value (regardless of casing).
2345 .. option:: UnionIgnoredRegexp
2347 Identifier naming checks won't be enforced for union names
2348 matching this regular expression.
2350 .. option:: UnionSuffix
2352 When defined, the check will ensure union names will add the
2353 suffix with the given value (regardless of casing).
2355 For example using values of:
2357 - UnionCase of ``lower_case``
2358 - UnionPrefix of ``pre_``
2359 - UnionSuffix of ``_post``
2361 Identifies and/or transforms union names as follows:
2376 union pre_foo_post {
2381 .. option:: ValueTemplateParameterCase
2383 When defined, the check will ensure value template parameter names conform to the
2386 .. option:: ValueTemplateParameterPrefix
2388 When defined, the check will ensure value template parameter names will add the
2389 prefixed with the given value (regardless of casing).
2391 .. option:: ValueTemplateParameterIgnoredRegexp
2393 Identifier naming checks won't be enforced for value template parameter
2394 names matching this regular expression.
2396 .. option:: ValueTemplateParameterSuffix
2398 When defined, the check will ensure value template parameter names will add the
2399 suffix with the given value (regardless of casing).
2401 For example using values of:
2403 - ValueTemplateParameterCase of ``lower_case``
2404 - ValueTemplateParameterPrefix of ``pre_``
2405 - ValueTemplateParameterSuffix of ``_post``
2407 Identifies and/or transforms value template parameter names as follows:
2413 template <template <typename> class TPL_parameter, int COUNT_params,
2414 typename... TYPE_parameters>
2420 template <template <typename> class TPL_parameter, int pre_count_params_post,
2421 typename... TYPE_parameters>
2423 .. option:: VariableCase
2425 When defined, the check will ensure variable names conform to the
2428 .. option:: VariablePrefix
2430 When defined, the check will ensure variable names will add the
2431 prefixed with the given value (regardless of casing).
2433 .. option:: VariableIgnoredRegexp
2435 Identifier naming checks won't be enforced for variable names
2436 matching this regular expression.
2438 .. option:: VariableSuffix
2440 When defined, the check will ensure variable names will add the
2441 suffix with the given value (regardless of casing).
2443 .. option:: VariableHungarianPrefix
2445 When enabled, the check ensures that the declared identifier will
2446 have a Hungarian notation prefix based on the declared type.
2448 For example using values of:
2450 - VariableCase of ``lower_case``
2451 - VariablePrefix of ``pre_``
2452 - VariableSuffix of ``_post``
2453 - VariableHungarianPrefix of ``On``
2455 Identifies and/or transforms variable names as follows:
2461 unsigned MyVariable;
2467 unsigned pre_myvariable_post;
2469 .. option:: VirtualMethodCase
2471 When defined, the check will ensure virtual method names conform to the
2474 .. option:: VirtualMethodPrefix
2476 When defined, the check will ensure virtual method names will add the
2477 prefixed with the given value (regardless of casing).
2479 .. option:: VirtualMethodIgnoredRegexp
2481 Identifier naming checks won't be enforced for virtual method names
2482 matching this regular expression.
2484 .. option:: VirtualMethodSuffix
2486 When defined, the check will ensure virtual method names will add the
2487 suffix with the given value (regardless of casing).
2489 For example using values of:
2491 - VirtualMethodCase of ``lower_case``
2492 - VirtualMethodPrefix of ``pre_``
2493 - VirtualMethodSuffix of ``_post``
2495 Identifies and/or transforms virtual method names as follows:
2503 virtual int MemberFunction();
2512 virtual int pre_member_function_post();
2516 The default mapping table of Hungarian Notation
2517 -----------------------------------------------
2519 In Hungarian notation, a variable name starts with a group of lower-case
2520 letters which are mnemonics for the type or purpose of that variable, followed
2521 by whatever name the programmer has chosen; this last part is sometimes
2522 distinguished as the given name. The first character of the given name can be
2523 capitalized to separate it from the type indicators (see also CamelCase).
2524 Otherwise the case of this character denotes scope.
2526 The following table is the default mapping table of Hungarian Notation which
2527 maps Decl to its prefix string. You can also have your own style in config file.
2529 ================= ============== ====================== ============== ============== ==============
2530 Primitive Type Microsoft Type
2531 ----------------- -------------- ---------------------- -------------- -------------- --------------
2532 Type Prefix Type Prefix Type Prefix
2533 ================= ============== ====================== ============== ============== ==============
2534 int8_t i8 signed int si BOOL b
2535 int16_t i16 signed short ss BOOLEAN b
2536 int32_t i32 signed short int ssi BYTE by
2537 int64_t i64 signed long long int slli CHAR c
2538 uint8_t u8 signed long long sll UCHAR uc
2539 uint16_t u16 signed long int sli SHORT s
2540 uint32_t u32 signed long sl USHORT us
2541 uint64_t u64 signed s WORD w
2542 char8_t c8 unsigned long long int ulli DWORD dw
2543 char16_t c16 unsigned long long ull DWORD32 dw32
2544 char32_t c32 unsigned long int uli DWORD64 dw64
2545 float f unsigned long ul LONG l
2546 double d unsigned short int usi ULONG ul
2547 char c unsigned short us ULONG32 ul32
2548 bool b unsigned int ui ULONG64 ul64
2549 _Bool b unsigned char uc ULONGLONG ull
2550 int i unsigned u HANDLE h
2551 size_t n long long int lli INT i
2552 short s long double ld INT8 i8
2553 signed i long long ll INT16 i16
2554 unsigned u long int li INT32 i32
2555 long l long l INT64 i64
2556 long long ll ptrdiff_t p UINT ui
2557 unsigned long ul void *none* UINT8 u8
2558 long double ld UINT16 u16
2559 ptrdiff_t p UINT32 u32
2560 wchar_t wc UINT64 u64
2561 short int si PVOID p
2563 ================= ============== ====================== ============== ============== ==============
2565 **There are more trivial options for Hungarian Notation:**
2567 **HungarianNotation.General.***
2568 Options are not belonging to any specific Decl.
2570 **HungarianNotation.CString.***
2571 Options for NULL-terminated string.
2573 **HungarianNotation.DerivedType.***
2574 Options for derived types.
2576 **HungarianNotation.PrimitiveType.***
2577 Options for primitive types.
2579 **HungarianNotation.UserDefinedType.***
2580 Options for user-defined types.
2583 Options for Hungarian Notation
2584 ------------------------------
2586 - :option:`HungarianNotation.General.TreatStructAsClass`
2588 - :option:`HungarianNotation.DerivedType.Array`
2589 - :option:`HungarianNotation.DerivedType.Pointer`
2590 - :option:`HungarianNotation.DerivedType.FunctionPointer`
2592 - :option:`HungarianNotation.CString.CharPointer`
2593 - :option:`HungarianNotation.CString.CharArray`
2594 - :option:`HungarianNotation.CString.WideCharPointer`
2595 - :option:`HungarianNotation.CString.WideCharArray`
2597 - :option:`HungarianNotation.PrimitiveType.*`
2598 - :option:`HungarianNotation.UserDefinedType.*`
2600 .. option:: HungarianNotation.General.TreatStructAsClass
2602 When defined, the check will treat naming of struct as a class.
2603 The default value is `false`.
2605 .. option:: HungarianNotation.DerivedType.Array
2607 When defined, the check will ensure variable name will add the prefix with
2608 the given string. The default prefix is `a`.
2610 .. option:: HungarianNotation.DerivedType.Pointer
2612 When defined, the check will ensure variable name will add the prefix with
2613 the given string. The default prefix is `p`.
2615 .. option:: HungarianNotation.DerivedType.FunctionPointer
2617 When defined, the check will ensure variable name will add the prefix with
2618 the given string. The default prefix is `fn`.
2626 int DataArray[2] = {0};
2629 void *DataBuffer = NULL;
2632 typedef void (*FUNC_PTR)();
2633 FUNC_PTR FuncPtr = NULL;
2640 int aDataArray[2] = {0};
2643 void *pDataBuffer = NULL;
2646 typedef void (*FUNC_PTR)();
2647 FUNC_PTR fnFuncPtr = NULL;
2650 .. option:: HungarianNotation.CString.CharPointer
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.CharArray
2657 When defined, the check will ensure variable name will add the prefix with
2658 the given string. The default prefix is `sz`.
2660 .. option:: HungarianNotation.CString.WideCharPointer
2662 When defined, the check will ensure variable name will add the prefix with
2663 the given string. The default prefix is `wsz`.
2665 .. option:: HungarianNotation.CString.WideCharArray
2667 When defined, the check will ensure variable name will add the prefix with
2668 the given string. The default prefix is `wsz`.
2676 const char *NamePtr = "Name";
2679 const char NameArray[] = "Name";
2682 const wchar_t *WideNamePtr = L"Name";
2685 const wchar_t WideNameArray[] = L"Name";
2692 const char *szNamePtr = "Name";
2695 const char szNameArray[] = "Name";
2698 const wchar_t *wszWideNamePtr = L"Name";
2701 const wchar_t wszWideNameArray[] = L"Name";
2704 .. option:: HungarianNotation.PrimitiveType.*
2706 When defined, the check will ensure variable name of involved primitive
2707 types will add the prefix with the given string. The default prefixes are
2708 defined in the default mapping table.
2710 .. option:: HungarianNotation.UserDefinedType.*
2712 When defined, the check will ensure variable name of involved primitive
2713 types will add the prefix with the given string. The default prefixes are
2714 defined in the default mapping table.
2722 int16_t ValueI16 = 0;
2723 int32_t ValueI32 = 0;
2724 int64_t ValueI64 = 0;
2725 uint8_t ValueU8 = 0;
2726 uint16_t ValueU16 = 0;
2727 uint32_t ValueU32 = 0;
2728 uint64_t ValueU64 = 0;
2729 float ValueFloat = 0.0;
2730 double ValueDouble = 0.0;
2731 ULONG ValueUlong = 0;
2732 DWORD ValueDword = 0;
2738 int8_t i8ValueI8 = 0;
2739 int16_t i16ValueI16 = 0;
2740 int32_t i32ValueI32 = 0;
2741 int64_t i64ValueI64 = 0;
2742 uint8_t u8ValueU8 = 0;
2743 uint16_t u16ValueU16 = 0;
2744 uint32_t u32ValueU32 = 0;
2745 uint64_t u64ValueU64 = 0;
2746 float fValueFloat = 0.0;
2747 double dValueDouble = 0.0;
2748 ULONG ulValueUlong = 0;
2749 DWORD dwValueDword = 0;