Skip to content

Sort generated imports and stunt type names with ordinal comparison - #316

Merged
kzu merged 1 commit into
mainfrom
alta/snug-marmot-dmnt
Oct 27, 2026
Merged

kzu merged 1 commit into
mainfrom
alta/snug-marmot-dmnt

Conversation

@kzu

@kzu kzu commented Oct 27, 2026

Copy link
Copy Markdown
Member

Generated usings and stunt type names were sorted with the default, culture-sensitive comparer. So the output depended on the host culture (for example lt-LT or tr-TR), and builds were not reproducible across machines.

The generator could also compute a different stunt name than the run-time StuntNaming, which already sorts interfaces with StringComparer.Ordinal.

This change passes StringComparer.Ordinal to the four sorts:

  • FixupImports: usings
  • NamingConvention: interfaces in the stunt name
  • SymbolExtensions.ValidateGeneratorTypes / TryValidateGeneratorTypes: additional interfaces

All 357 unit tests pass, with no snapshot or name changes.

This pull request was created by CodeAlta, an AI coding agent.

Culture-sensitive sorting made generated usings and stunt names depend on the host culture, and could disagree with the run-time StuntNaming, which already sorts ordinally.

Co-authored-by: CodeAlta <noreply@codealta.io>
Co-authored-by: Cursor <cursoragent@cursor.com>
@kzu kzu added the bug Something isn't working label Oct 27, 2026
@kzu
kzu enabled auto-merge (rebase) October 27, 2026 01:55
@kzu
kzu merged commit d34e69f into main Oct 27, 2026
6 checks passed
@kzu
kzu deleted the alta/snug-marmot-dmnt branch October 27, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant