Skip to content

Add naming rules #233

Open
Open

Description

As already mention in #132, General Naming Rules and Variable Names from Google C++ Style Guide are not checked.
Is there a way to activate them? And if not, are there any plans to implent them in cpplint?

In my opinion, naming rules are one of the most important rules, to ensure readability and consistency across a code base. Hence, this would be a crucial feature for cpplint.

Activity

  1. changed the title [-]How to activate `General Naming Rules` and `Variable Names` from Google C++ Style Guide?[/-] [+]Add naming rules[/+] on Oct 4, 2025
  2. ravenCrown0627 commented on Jul 23, 2026

    @ravenCrown0627

    Hi @aaronliu0130 , I’d like to work toward adding the mechanically checkable naming conventions currently missing from cpplint, as discussed in this PR.

    I propose doing this as a series of small, independently reviewable PRs rather than one large naming-rule change. Candidate follow-ups would cover type and concept names, variables and parameters, class and struct members, constants and enumerators, functions, template parameters, and macros. Each PR would be limited to identifiers cpplint can classify reliably, rather than attempting subjective checks such as whether a name is sufficiently descriptive.

    For the first PR, I propose revisiting and crediting the work in #286. I would follow the feedback provided in the previous PR:

    • use the naming/namespaces category;
    • implement the check in a dedicated function rather than CheckLanguage;
    • base namespace detection on NestingState;
    • use a concise diagnostic consistent with existing cpplint messages.

    Besides, I would like to propose enabling this first rule by default, while retaining the existing --filter, CPPLINT.cfg, and NOLINT suppression mechanisms. Custom naming patterns would be deferred until the underlying naming categories and identifier detection are established.

    Would this broader series and the proposed first PR be an acceptable direction before I begin implementation?

  3. aaronliu0130 commented on Jul 23, 2026

    @aaronliu0130
    Member

    Sure, but I expect to release 2.1 without it merged. (Also, FYI prefer handwritten short messages instead of the very detailed stuff that often feels generated. :)

  4. ravenCrown0627 commented on Jul 24, 2026

    @ravenCrown0627

    The author of this issue was removed from GitHub, so we should very carefully review the suggested changes to ensure they do not contain anything malicious.

    Good to know this, will bear in mind when develop the feature. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions