Skip to content

Rename PascalCase C identifiers to snake_case and enforce naming convention in CI #386

Description

@rhusar

The C code in native/ uses PascalCase for struct fields (e.g., StickySession, JVMRoute, Host, Port), function parameters (Alias, Load), and local variables. This is unconventional for C where snake_case is the standard naming convention.

Affected identifiers (17 struct fields, 3 parameters/variables)

  • balancerinfo: StickySession, StickySessionCookie, StickySessionPath, StickySessionRemove, StickySessionForce, Timeout, Maxattempts
  • nodemess: JVMRoute, Domain, Host, Port, Type, Upgrade, AJPSecret, ResponseFieldSize
  • domaininfo, sessionidinfo: JVMRoute
  • Function parameters/locals in mod_manager.c: Alias, Load

Proposed changes

  1. Rename all PascalCase struct fields, parameters, and local variables to snake_case across all .c and .h files under native/
  2. Preserve all MCMP wire protocol string literals ("JVMRoute", "StickySession", etc. in strcasecmp() calls and XML output tags) to maintain backward compatibility
  3. Add a clang-tidy configuration (native/.clang-tidy) with readability-identifier-naming check to enforce lower_case for struct members, function parameters, and local variables
  4. Add a clang-tidy-naming-check CI job to prevent future regressions

Important: This is a purely internal rename. The MCMP protocol contract (string constants and XML tags) remains unchanged — no client-side changes required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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