Skip to content

style: naming convention with kind and scope prefixes, checked by clang-tidy - #29

Merged
XavierBeheydt merged 1 commit into
devfrom
style/naming-convention
Nov 9, 2026
Merged

XavierBeheydt merged 1 commit into
devfrom
style/naming-convention

Conversation

@XavierBeheydt

Copy link
Copy Markdown
Member

Summary

A name tells its kind and its scope, so a diff reads right without an IDE (a review on GitHub or on a phone):

  • kind prefixes: E enum, I interface, T type template parameter, k constant, b boolean;
  • scope prefixes: m_ private/protected member, s_ static member, g_ global;
  • PascalCase types, camelCase functions and values, AETHER_ macros, lower_case namespaces.

Files:

  • docs/naming.md (new): the table and how to read it, one page for contributors and for engine users reading the API.
  • .agents/instructions/style/cpp.md: points to it instead of its old two-rule line.
  • .clang-tidy: readability-identifier-naming enforces every rule except the boolean b prefix (clang-tidy cannot select by type), which is left to review. The lowercase fixed-size aliases (i32, u8, f32, usize) and a lone T template parameter are allowed.

Verification

  • clang-tidy reports nothing on the code already on dev (version.cpp, the core tests, types.hpp through them).
  • On a throwaway file with good and bad names, it flags all 15 bad ones (abstract class without I, enum without E, file_, counter static member, globalCount, maxLights, BAD_MACRO, wrong-case functions, parameters, locals, namespace, template parameter...) and none of the good ones (EGood, ISinkOk, TValue, m_fileOk, m_bDirty, g_countOk, kMaxLightsOk).

Follow-ups

🤖 Generated with Claude Code

https://claude.ai/code/session_01JfRmXnowFEecvNmG9b9szy

…ng-tidy

A name shows its kind (E enum, I interface, T template parameter, k
constant, b boolean) and its scope (m_ member, s_ static, g_ global), so a
review reads right without an IDE. docs/naming.md is the single page for
contributors and engine users; cpp.md points to it; .clang-tidy enforces
every rule with readability-identifier-naming except the boolean prefix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JfRmXnowFEecvNmG9b9szy
@XavierBeheydt XavierBeheydt added scope: config Editor and tooling configs scope: agents AGENTS.md and .agents/ scope: docs Documentation agent: claude-code Handled by Claude Code model: opus Claude Opus (Claude Code) labels Nov 9, 2026
XavierBeheydt added a commit that referenced this pull request Nov 9, 2026
Follows the naming convention of #29 (E prefix for enums).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JfRmXnowFEecvNmG9b9szy
XavierBeheydt added a commit that referenced this pull request Nov 9, 2026
ESeverity, ISink and TArgs for the enum, the interface and the template
parameter pack; m_file and m_sink for private members (#29).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JfRmXnowFEecvNmG9b9szy
@XavierBeheydt
XavierBeheydt merged commit e384b81 into dev Nov 9, 2026
4 of 5 checks passed
@XavierBeheydt
XavierBeheydt deleted the style/naming-convention branch November 9, 2026 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent: claude-code Handled by Claude Code model: opus Claude Opus (Claude Code) scope: agents AGENTS.md and .agents/ scope: config Editor and tooling configs scope: docs Documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant