Skip to content

Feature/enum to class hardening - #1

Merged
rutkowskit merged 7 commits into
masterfrom
feature/enum-to-class-hardening
Aug 11, 2026
Merged

rutkowskit merged 7 commits into
masterfrom
feature/enum-to-class-hardening

Conversation

@rutkowskit

Copy link
Copy Markdown
Owner

Summary

Hardens the EnumToClass source generator after a technical review: correct Empty/flyweight semantics, safer code generation, smarter-enum API, diagnostics, and broader tests.

Changes

• Empty aligned with default(TEnum) and shared with the map / *Instance (flyweight)
• String literals escaped; enum members limited to static constants (value__ excluded)
• Classes: IEquatable, == / !=; additive TryGetByName
• Diagnostics ETC001 (not partial), ETC002 (empty enum), ETC003 (nested host — unsupported, no emit)
• global:: BCL types, doc-comment indent fix, full XML

for Description
• Analyzer release tracking (ETC001–003); CI on master + main; README / AGENTS.md

Out of scope (follow-ups)

Full nested-type generation, Flags-aware parsing, Json/Type converters.

Test plan

• [x] dotnet test -c Release (integration + snapshots)
• [x] Pack: analyzer-only nupkg under analyzers/dotnet/cs

… tests

Implement review plan P0–P3: default Empty flyweight, escaped literals,
constant-only members, class IEquatable/==, TryGetByName, ETC001/ETC002,
global:: BCL types, CI/docs hygiene, and expanded integration/snapshot tests.
Detect nested EnumToClass hosts (ContainingType), emit ETC003 error,
and do not emit partial sources that would land at namespace scope.
Add snapshot coverage and document ETC003 in README.
Normalize /// indentation on const/instance members and format summary
comments with a single-pass StringBuilder helper.
… releases

Parse all lines inside <summary> for WithDescription values (newline-separated).
Add AnalyzerReleases.Shipped/Unshipped for ETC001–ETC003 and drop RS2008 suppress.
@rutkowskit rutkowskit self-assigned this Aug 11, 2026
@rutkowskit
rutkowskit merged commit fef2742 into master Aug 11, 2026
1 check passed
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.

1 participant