There might be a need for a facility concerning identifier conventions
beyond the scope of modernize-loop-convert. However, a case came up
while applying modernize-loop-convert where the loop was over a container
held in a member variable named m_widgets. modernize-loop-convert wrote
a loop like this:
for (auto m_widget : m_widgets)
This makes the local variable m_widget appear to be named as if it were
following the identifier convention for a member variable. The desired
code is
for (auto widget : m_widgets)
readability-identifier-naming understands identifier naming conventions,
including particular prefixes and suffixes for things like globals, statics,
and members.
Pull out that configuration into a generic facility that is global to
clang-tidy and have any checks that introduce identifiers consult those
configurations to product identifiers that follow the proper naming.
It should be easy to handle in the check. However, there's no active maintainer of this check. Send a patch, if you're interested in supporting this naming convention.
Extended Description
There might be a need for a facility concerning identifier conventions beyond the scope of modernize-loop-convert. However, a case came up while applying modernize-loop-convert where the loop was over a container held in a member variable named m_widgets. modernize-loop-convert wrote a loop like this:
for (auto m_widget : m_widgets)
This makes the local variable m_widget appear to be named as if it were following the identifier convention for a member variable. The desired code is
for (auto widget : m_widgets)
readability-identifier-naming understands identifier naming conventions, including particular prefixes and suffixes for things like globals, statics, and members.
Pull out that configuration into a generic facility that is global to clang-tidy and have any checks that introduce identifiers consult those configurations to product identifiers that follow the proper naming.