Purpose
Restore a single, mechanically enforceable rule for enum constant naming, replacing the two-class system that has accumulated across S10.07 (Class_PascalCase introduction) and S10.12 (SCREAMING_SNAKE carve-out for the anonymous-enum named-constant idiom). The two-class system is not enforceable by .clang-tidy alone — it relies on per-site judgment about whether a constant is "macro-like" — and the drift is now visible: S10.16 review surfaced a third hybrid form (Class_DEFAULT_INSTANCE) that nobody had decided on.
Settle it once. One rule, one .clang-tidy setting, no IgnoredRegexp escape.
Decisions
- All enum constants →
SCREAMING_SNAKE. Tagged or anonymous, public or TU-local.
- Public enums keep the project prefix.
SOLIDSYSLOG_SEVERITY_EMERGENCY, SOLIDSYSLOG_FACILITY_USER, SOLIDSYSLOG_DATAGRAM_SEND_RESULT_SENT. Predictable, greppable, no collisions with platform headers (EMERGENCY etc. exist as <syslog.h> macros on Linux/BSD).
- TU-local anonymous-enum constants stay project-prefix-free where they are scoped to a single TU (
IPV4_HEADER_BYTES, UINT32_MAX_DECIMAL_DIGITS). No change from today — only the case rule was the question.
.clang-tidy EnumConstantCase → UPPER_CASE only. Drop the dual-form EnumConstantIgnoredRegexp escape. One rule, no exceptions.
NAMING.md collapses to one rule. Remove the "anonymous-enum named-constant idiom" carve-out language from S10.12 — the carve-out is no longer needed; there's only one rule now.
Out of scope
- Static variable naming (the
instance / DEFAULT_INSTANCE / NIL_SENDER family). Those are objects, not enum constants. Will be decided incrementally in the in-flight per-group stories (S10.16 onwards), or in a dedicated cleanup if it becomes painful.
- Per-group conformance work (S10.16–S10.19). Each resumes once S10.22 lands.
- S10.20 warning→error flip + scope widening.
Scope (rough, firms up at survey)
Tagged enums currently using SolidSyslogClass_Member:
Core/Interface/SolidSyslogPrival.h — SolidSyslogFacility_* (≈24 constants), SolidSyslogSeverity_* (8 constants)
Core/Interface/SolidSyslogTransport.h — SolidSyslogTransport_* (≈2)
Core/Interface/SolidSyslogDatagram.h — SolidSyslogDatagramSendResult_* (≈3)
Core/Interface/SolidSyslogBlockStore.h — SolidSyslogDiscardPolicy_* (≈3)
- Plus any others surfaced by survey (
SolidSyslog[A-Z][a-z][a-zA-Z]*_[A-Z][a-z] matches)
Anonymous enums (SOLIDSYSLOG_*_SIZE etc.) are already SCREAMING — no change.
Files touched by call-site renames: Core/, Platform/, Bdd/, Tests/, examples/, docs/.
Tooling:
docs/NAMING.md — collapse two-rule → one-rule
.clang-tidy — EnumConstantCase → UPPER_CASE, drop EnumConstantIgnoredRegexp
Workflow
- Survey. Enumerate every
SolidSyslog[A-Z][a-z][a-zA-Z]*_[A-Z][a-z] enum constant tree-wide. Confirm scope before any rename.
- Sweep, one commit per enum tag. Sed-driven for the mechanical bulk; regex reviewed before each invocation. Per-enum granularity so a regression bisects cleanly.
- Tooling commit.
.clang-tidy + NAMING.md together.
- Gate sweep. debug, clang-debug, sanitize, coverage, tidy, cppcheck, cppcheck-misra. Must be green.
- DEVLOG. Capture the convention change + reasoning + reference back to S10.07 / S10.12 history.
Acceptance
- Single
.clang-tidy rule for enum constants, no IgnoredRegexp escape.
NAMING.md documents one enum rule, no carve-outs.
- Zero new findings from
analyze-tidy / analyze-cppcheck tree-wide.
- 100% line + function coverage preserved.
- Full test suite green across
debug, clang-debug, sanitize, tidy, cppcheck, coverage presets.
- DEVLOG entry appended on the same branch, before opening the PR.
Risk
- Sweep PR diff will be large but mechanical. Per-enum commits keep bisect viable.
- Public-API enums change form — but the project is pre-1.0 with no released ABI, so callers absorb the rename in one go.
SOLIDSYSLOG_SEVERITY_EMERGENCY etc. are greppable and don't collide with <syslog.h>'s unprefixed EMERGENCY.
Parent epic: #12
Purpose
Restore a single, mechanically enforceable rule for enum constant naming, replacing the two-class system that has accumulated across S10.07 (Class_PascalCase introduction) and S10.12 (SCREAMING_SNAKE carve-out for the anonymous-enum named-constant idiom). The two-class system is not enforceable by
.clang-tidyalone — it relies on per-site judgment about whether a constant is "macro-like" — and the drift is now visible: S10.16 review surfaced a third hybrid form (Class_DEFAULT_INSTANCE) that nobody had decided on.Settle it once. One rule, one
.clang-tidysetting, noIgnoredRegexpescape.Decisions
SCREAMING_SNAKE. Tagged or anonymous, public or TU-local.SOLIDSYSLOG_SEVERITY_EMERGENCY,SOLIDSYSLOG_FACILITY_USER,SOLIDSYSLOG_DATAGRAM_SEND_RESULT_SENT. Predictable, greppable, no collisions with platform headers (EMERGENCYetc. exist as<syslog.h>macros on Linux/BSD).IPV4_HEADER_BYTES,UINT32_MAX_DECIMAL_DIGITS). No change from today — only the case rule was the question..clang-tidyEnumConstantCase→UPPER_CASEonly. Drop the dual-formEnumConstantIgnoredRegexpescape. One rule, no exceptions.NAMING.mdcollapses to one rule. Remove the "anonymous-enum named-constant idiom" carve-out language from S10.12 — the carve-out is no longer needed; there's only one rule now.Out of scope
instance/DEFAULT_INSTANCE/NIL_SENDERfamily). Those are objects, not enum constants. Will be decided incrementally in the in-flight per-group stories (S10.16 onwards), or in a dedicated cleanup if it becomes painful.Scope (rough, firms up at survey)
Tagged enums currently using
SolidSyslogClass_Member:Core/Interface/SolidSyslogPrival.h—SolidSyslogFacility_*(≈24 constants),SolidSyslogSeverity_*(8 constants)Core/Interface/SolidSyslogTransport.h—SolidSyslogTransport_*(≈2)Core/Interface/SolidSyslogDatagram.h—SolidSyslogDatagramSendResult_*(≈3)Core/Interface/SolidSyslogBlockStore.h—SolidSyslogDiscardPolicy_*(≈3)SolidSyslog[A-Z][a-z][a-zA-Z]*_[A-Z][a-z]matches)Anonymous enums (
SOLIDSYSLOG_*_SIZEetc.) are already SCREAMING — no change.Files touched by call-site renames: Core/, Platform/, Bdd/, Tests/, examples/, docs/.
Tooling:
docs/NAMING.md— collapse two-rule → one-rule.clang-tidy—EnumConstantCase→UPPER_CASE, dropEnumConstantIgnoredRegexpWorkflow
SolidSyslog[A-Z][a-z][a-zA-Z]*_[A-Z][a-z]enum constant tree-wide. Confirm scope before any rename..clang-tidy+NAMING.mdtogether.Acceptance
.clang-tidyrule for enum constants, noIgnoredRegexpescape.NAMING.mddocuments one enum rule, no carve-outs.analyze-tidy/analyze-cppchecktree-wide.debug,clang-debug,sanitize,tidy,cppcheck,coveragepresets.Risk
SOLIDSYSLOG_SEVERITY_EMERGENCYetc. are greppable and don't collide with<syslog.h>'s unprefixedEMERGENCY.Parent epic: #12