llvm / llvm/llvm-project

[clang-tidy] Option to support numeric separators for CamelCase and camelBack in the context of readability-identifier-naming

Open
#180,174 1 comment 0 reactions 0 assignees View on GitHub
clang-tidy enhancement
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

The Problem:
CamelCase and camelBack casing types often make identifiers containing version numbers or technical standards ambiguous, for example, forcing the unambiguous Spec12_3_4 to be written as the ambiguous (or even conflicting) Spec1234.
While the existing Camel_Snake_Case/camel_Snake_Back options solve this, they may of course be stylistically undesirable, as they also add unnecessary underscore separators.

Proposed Solution:
Either add two new casing types (maybe in the form of CamelCaseNumericSeparators, or CamelCase1_2) that enforce the same formatting rules as CamelCase/camelBack, but permit underscores specifically when they act as separators for digits.
Or the existing CamelCase and camelBack casing types could be adapted to always ignore underscores when they are between two digits.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.