Skip to content

Make sure identifiers are in line with policy #2361

@joto

Description

@joto

Identifiers for classes, functions, classes etc. should follow our coding styles. Most use lower case with underscore, classes have postfix _t etc.

clang-tidy can check this. See https://clang.llvm.org/extra/clang-tidy/checks/readability/identifier-naming.html .

Here is a first, incomplete try at a config snippet which can be added to .clang-tidy:

    - key: readability-identifier-naming.ClassCase
      value: lower_case
    - key: readability-identifier-naming.ClassSuffix
      value: _t
    - key: readability-identifier-naming.PrivateMemberPrefix
      value: m_
    - key: readability-identifier-naming.StructCase
      value: lower_case
    - key: readability-identifier-naming.EnumCase
      value: lower_case
    - key: readability-identifier-naming.FunctionCase
      value: lower_case
    - key: readability-identifier-naming.FunctionIgnoredRegexp
      value: luaX.*
    - key: readability-identifier-naming.VariableCase
      value: lower_case
    - key: readability-identifier-naming.GlobalConstantCase
      value: UPPER_CASE
    - key: readability-identifier-naming.NamespaceCase
      value: lower_case

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions