Skip to content

Rename PascalCase entities to std-style snake_case (#96) - #248

Merged
thirtytwobits merged 2 commits into
mainfrom
claude/issue-96-naming-conventions
Oct 20, 2026
Merged

thirtytwobits merged 2 commits into
mainfrom
claude/issue-96-naming-conventions

Conversation

@thirtytwobits

Copy link
Copy Markdown
Member

Summary

Closes #96. As settled in #85, CETL follows the standard library's snake_case naming. This PR renames the remaining PascalCase entities and keeps the old public names working as [[deprecated]] aliases.

Public names (each old name kept as a deprecated alias):

Old New
cetl::VariableLengthArray cetl::variable_length_array
cetl::pf17::pmr::UnsynchronizedArrayMemoryResource unsynchronized_array_memory_resource
cetl::pf17::pmr::UnsynchronizedBufferMemoryResource unsynchronized_buffer_memory_resource
cetl::pf17::pmr::deviant::MaxAlignNewDeleteResource max_align_new_delete_resource
cetl::pmr::UnsynchronizedBufferMemoryResourceDelegate unsynchronized_buffer_memory_resource_delegate
cetl::pmr::O1HeapAlignedStorage o1heap_aligned_storage
cetl::pmr::UnsynchronizedO1HeapMemoryResourceDelegate unsynchronized_o1heap_memory_resource_delegate
cetl::pmr::MemoryResourceDeleter memory_resource_deleter
cetl::pmr::PolymorphicDeleter polymorphic_deleter
cetl::pmr::Factory factory
cetl::pmr::PmrInterfaceDeleter pmr_interface_deleter
cetl::pmr::InterfacePtr interface_ptr
cetl::pmr::InterfaceFactory interface_factory

Internal names (renamed with no alias, since users can't name them):

  • detail:: helpers: SynthThreeWay, VariableLengthArrayBase, IsPmr, EnableIfPmrT, EnableIfNotPmrT
  • private types and members: IteratorImpl, MemoryResourceData, ConcreteRaii, IsCallable, EnableIfLvIsCallable, EnableIfNotPair, BufferControl, ValueConstPtrAndTypeId, IsMovableT, swapVariants()
  • class-local type aliases: Base, Storage, Concrete, RawValueType, ReturnType

Template parameters stay PascalCase, matching the newer headers.

Other changes:

  • Every use in CETLVaSt (unit tests, docs examples, fuzz and MCU suites) and in the Doxygen pages now uses the new names. The page titles had a stale UnsynchronizedBArrayMemoryResource / PolymorphicAllocatorDeleter, and one comment named std::pmr:: where it meant cetl::pmr::; those are fixed too.
  • CONTRIBUTING.md has a new "Naming Conventions" section. It describes the style and the rename policy: rename, keep a deprecated alias, and remove the alias only in a major release.
  • CETL_VERSION_MINOR is left alone. Earlier feature PRs haven't bumped it, so I've assumed it's bumped at release time.

Tests

  • New test_deprecated_names.cpp:
    • static_asserts that each of the 13 aliases names the same type as its replacement, including the variable_length_array<bool> specialization
    • a runtime test that builds and uses the VLA, Factory and InterfaceFactory through their old names

Validation

  • Host GCC, C++14, Debug / DebugEP / Release: build, run_unittests and run_examples all pass.
  • GCC 7 (toolshed ts24.4.3, configure-gcc7-native-cpp-14-offline), Debug / DebugEP: build, run_unittests and run_examples all pass.
  • Headers are clean under clang-format 22.1 (ts26.4.3) and 19.1.7 (ts24.4.3).
  • A probe that uses each old name without suppression gets a deprecation warning on all 13 names under clang, GCC 13 and GCC 7.
  • The fuzz target and mcu/test_text.cpp pass a syntax check. Doxygen gives no warnings about any renamed name.

🤖 Generated with Claude Code

CETL is meant to read like the standard library, and #85 settled that it
uses std's snake_case naming; newer types (optional, variant, rtti,
unbounded_variant, pmr::function) already do. This renames the older
PascalCase types to match.

Public types that users can name keep their old names as
[[deprecated]] aliases next to the new definitions, so existing code
keeps compiling with a warning that names the replacement:

  VariableLengthArray                        -> variable_length_array
  UnsynchronizedArrayMemoryResource          -> unsynchronized_array_memory_resource
  UnsynchronizedBufferMemoryResource         -> unsynchronized_buffer_memory_resource
  deviant::MaxAlignNewDeleteResource         -> deviant::max_align_new_delete_resource
  UnsynchronizedBufferMemoryResourceDelegate -> unsynchronized_buffer_memory_resource_delegate
  O1HeapAlignedStorage                       -> o1heap_aligned_storage
  UnsynchronizedO1HeapMemoryResourceDelegate -> unsynchronized_o1heap_memory_resource_delegate
  MemoryResourceDeleter                      -> memory_resource_deleter
  PolymorphicDeleter                         -> polymorphic_deleter
  Factory                                    -> factory
  PmrInterfaceDeleter                        -> pmr_interface_deleter
  InterfacePtr                               -> interface_ptr
  InterfaceFactory                           -> interface_factory

Private members, detail-namespace helpers and class-local type aliases
are renamed without aliases since users cannot name them. All uses in
CETLVaSt (tests, examples, fuzz and MCU suites) move to the new names;
test_deprecated_names.cpp checks every alias still names the same type.

CONTRIBUTING.md gains a "Naming Conventions" section describing the
style and the rename-with-deprecated-alias policy.

Closes #96.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thirtytwobits

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T02:23:37.594033Z 868610d Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 868610da9f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread include/cetl/pf17/array_memory_resource.hpp
Comment thread include/cetl/pmr/buffer_memory_resource_delegate.hpp
MAMONTBOT
MAMONTBOT previously approved these changes Oct 20, 2026

@MAMONTBOT MAMONTBOT left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the changes; no blocking issues found.

pavel-kirienko
pavel-kirienko previously approved these changes Oct 20, 2026
UnsynchronizedBufferMemoryResourceDelegate, MemoryResourceDeleter and
PolymorphicDeleter could deduce their template argument from a
constructor call while they were class templates. As alias templates
they only can from C++20 (P1814), so C++17 code such as
`MemoryResourceDeleter d{res, size};` no longer compiles through the
old name. No C++17 construct keeps both deduction and type identity, so
this is a known break of the rename, like the mangled-name change, and
ships with the same major release.

Note it on the three aliases and in CONTRIBUTING's rename policy, and
add a C++20-only test that deduction through the old names works there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thirtytwobits
thirtytwobits merged commit 455c52b into main Oct 20, 2026
30 checks passed
@thirtytwobits
thirtytwobits deleted the claude/issue-96-naming-conventions branch October 20, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update the naming conventions

3 participants