Repository navigation
Feature/enum to class hardening - #1
Merged
Merged
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
• 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