njames93 created this revision. njames93 added reviewers: aaron.ballman, alexfh. Herald added subscribers: cfe-commits, xazax.hun. Herald added a project: clang.
Updates the docs to include `MacroDefinition` documentation. The docs are still missing `ObjCIVar` however I don't have a clue about how that looks in code. If someone wants to show the code block needed for the example I'll add that in too. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D80877 Files: clang-tools-extra/docs/clang-tidy/checks/readability-identifier-naming.rst Index: clang-tools-extra/docs/clang-tidy/checks/readability-identifier-naming.rst =================================================================== --- clang-tools-extra/docs/clang-tidy/checks/readability-identifier-naming.rst +++ clang-tools-extra/docs/clang-tidy/checks/readability-identifier-naming.rst @@ -62,6 +62,7 @@ - :option:`LocalConstantPointerCase`, :option:`LocalConstantPointerPrefix`, :option:`LocalConstantPointerSuffix` - :option:`LocalPointerCase`, :option:`LocalPointerPrefix`, :option:`LocalPointerSuffix` - :option:`LocalVariableCase`, :option:`LocalVariablePrefix`, :option:`LocalVariableSuffix` + - :option:`MacroDefinitionCase`, :option:`MacroDefinitionPrefix`, :option:`MacroDefinitionSuffix` - :option:`MemberCase`, :option:`MemberPrefix`, :option:`MemberSuffix` - :option:`MethodCase`, :option:`MethodPrefix`, :option:`MethodSuffix` - :option:`NamespaceCase`, :option:`NamespacePrefix`, :option:`NamespaceSuffix` @@ -1076,6 +1077,44 @@ void foo() { int pre_local_constant_post; } +.. option:: MacroDefinitionCase + + When defined, the check will ensure macro definitions conform to the + selected casing. + +.. option:: MacroDefinitionPrefix + + When defined, the check will ensure macro definitions will add the + prefixed with the given value (regardless of casing). + +.. option:: MacroDefinitionSuffix + + When defined, the check will ensure macro definitions will add the + suffix with the given value (regardless of casing). + +For example using values of: + + - MacroDefinitionCase of ``lower_case`` + - MacroDefinitionPrefix of ``pre_`` + - MacroDefinitionSuffix of ``_post`` + +Identifies and/or transforms macro definitions as follows: + +Before: + +.. code-block:: c + + #define MY_MacroDefinition + +After: + +.. code-block:: c + + #define pre_my_macro_definition_post + +Note: This will not warn on builtin macros or macros defined on the command line +using the ``-D`` flag. + .. option:: MemberCase When defined, the check will ensure member names conform to the
Index: clang-tools-extra/docs/clang-tidy/checks/readability-identifier-naming.rst =================================================================== --- clang-tools-extra/docs/clang-tidy/checks/readability-identifier-naming.rst +++ clang-tools-extra/docs/clang-tidy/checks/readability-identifier-naming.rst @@ -62,6 +62,7 @@ - :option:`LocalConstantPointerCase`, :option:`LocalConstantPointerPrefix`, :option:`LocalConstantPointerSuffix` - :option:`LocalPointerCase`, :option:`LocalPointerPrefix`, :option:`LocalPointerSuffix` - :option:`LocalVariableCase`, :option:`LocalVariablePrefix`, :option:`LocalVariableSuffix` + - :option:`MacroDefinitionCase`, :option:`MacroDefinitionPrefix`, :option:`MacroDefinitionSuffix` - :option:`MemberCase`, :option:`MemberPrefix`, :option:`MemberSuffix` - :option:`MethodCase`, :option:`MethodPrefix`, :option:`MethodSuffix` - :option:`NamespaceCase`, :option:`NamespacePrefix`, :option:`NamespaceSuffix` @@ -1076,6 +1077,44 @@ void foo() { int pre_local_constant_post; } +.. option:: MacroDefinitionCase + + When defined, the check will ensure macro definitions conform to the + selected casing. + +.. option:: MacroDefinitionPrefix + + When defined, the check will ensure macro definitions will add the + prefixed with the given value (regardless of casing). + +.. option:: MacroDefinitionSuffix + + When defined, the check will ensure macro definitions will add the + suffix with the given value (regardless of casing). + +For example using values of: + + - MacroDefinitionCase of ``lower_case`` + - MacroDefinitionPrefix of ``pre_`` + - MacroDefinitionSuffix of ``_post`` + +Identifies and/or transforms macro definitions as follows: + +Before: + +.. code-block:: c + + #define MY_MacroDefinition + +After: + +.. code-block:: c + + #define pre_my_macro_definition_post + +Note: This will not warn on builtin macros or macros defined on the command line +using the ``-D`` flag. + .. option:: MemberCase When defined, the check will ensure member names conform to the
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits