[clang-tools-extra] readability-identifier-naming should add universal default options (PR #171686)

Dominik Kaszewski via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 11 11:56:00 PST 2025


================
@@ -223,6 +226,60 @@ Options description
 
 A detailed description of each option is presented below:
 
+.. option:: DefaultCase
+
+    When defined, the check will ensure all name by default conform to the
+    selected casing.
+
+.. option:: DefaultPrefix
+
+    When defined, the check will ensure all name by default will add the
+    prefixed with the given value (regardless of casing).
+
+.. option:: DefaultIgnoredRegexp
+
+    Identifier naming checks won't be enforced for all name by default
+    matching this regular expression.
+
+.. option:: DefaultSuffix
+
+    When defined, the check will ensure all name by default will add the
+    suffix with the given value (regardless of casing).
+
+.. option:: DefaultHungarianPrefix
+
+    When enabled, the check ensures that the declared identifier will
+    have a Hungarian notation prefix based on the declared type.
+
+The check only works on kinds of identifiers which have been configured,
+so an empty config effectively disables it.
+The "default" option can be used to enable all kinds of identifiers,
+then optionally override specific kinds which are desired with a different case.
+
+For example using values of:
+
+    - DefaultCase of ``lower_case``
+    - MacroDefinitionCase of ``UPPER_CASE``
+    - TemplateParameterCase of ``CamelCase``
+
+Identifies and/or transforms names as follows:
+
+Before:
+
+.. code-block:: c++
+
+    #define macroDefinition
+    template <typename typenameParameter>
+    int functionDeclaration(typenameParameter paramVal, int paramCount);
+
+After:
+
+.. code-block:: c++
+
+    #define MACRO_DEFINITION
+    template <typename TypenameParameter>
+    int function_declarations(TypenameParameter param_val, int param_count);
+
----------------
dkaszews wrote:

You mean example or entire defaults? 

https://github.com/llvm/llvm-project/pull/171686


More information about the cfe-commits mailing list