forked from OSchip/llvm-project
[clang-tidy] Added MacroDefiniton docs for readability-identifier-naming
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. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D80877
This commit is contained in:
parent
d3b7f90d00
commit
65fa0a9f7f
|
@ -62,6 +62,7 @@ The following options are describe below:
|
|||
- :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 @@ After:
|
|||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue