fix: use ordinal generator string comparisons#401
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Pull request overview
This PR hardens source-generator code and tests by replacing culture-sensitive string operations with ordinal comparisons and invariant casing/conversion where generator behavior should be deterministic across cultures.
Changes:
- Updated generator prefix checks and async/task type detection to use
StringComparison.Ordinal. - Switched enum constant conversion and parameter-name normalization to invariant culture APIs.
- Adjusted generator tests to use ordinal ordering and diagnostic-prefix checks.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/PatternKit.Generators/ComposerGenerator.cs |
Uses ordinal prefix checks for Func<>, Task<>, and ValueTask<> detection. |
src/PatternKit.Generators/DecoratorGenerator.cs |
Uses ordinal prefix checks for interface-name and async-return detection. |
src/PatternKit.Generators/FacadeGenerator.cs |
Uses ordinal prefix checks for generated names, async return handling, and field-name normalization. |
src/PatternKit.Generators/PrototypeGenerator.cs |
Uses ordinal prefix check for immutable collection type detection. |
src/PatternKit.Generators/ProxyGenerator.cs |
Uses ordinal prefix checks and invariant parameter-name casing. |
src/PatternKit.Generators/Singleton/SingletonGenerator.cs |
Uses ordinal prefix check when normalizing verbatim identifiers. |
src/PatternKit.Generators/StateMachineGenerator.cs |
Uses invariant culture for enum constant conversions. |
src/PatternKit.Generators/VisitorGenerator.cs |
Uses ordinal prefix check for default visitor interface naming. |
test/PatternKit.Generators.Tests/DecoratorGeneratorTests.cs |
Uses ordinal source ordering checks. |
test/PatternKit.Generators.Tests/DispatcherGeneratorTests.cs |
Uses ordinal error-prefix check. |
test/PatternKit.Generators.Tests/FacadeGeneratorTests.cs |
Uses ordinal source ordering checks. |
test/PatternKit.Generators.Tests/StateMachineGeneratorTests.cs |
Uses ordinal source ordering and diagnostic-prefix checks. |
test/PatternKit.Generators.Tests/TemplateGeneratorTests.cs |
Uses ordinal generated-source ordering checks. |
test/PatternKit.Generators.Tests/VisitorGeneratorTests.cs |
Uses ordinal diagnostic-prefix check. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Test Results 12 files 12 suites 9m 17s ⏱️ Results for commit aa4116a. |
Code Coverage |
🔍 PR Validation ResultsVersion: `` ✅ Validation Steps
📊 ArtifactsDry-run artifacts have been uploaded and will be available for 7 days. This comment was automatically generated by the PR validation workflow. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #401 +/- ##
==========================================
+ Coverage 89.55% 95.63% +6.07%
==========================================
Files 530 530
Lines 42899 42899
Branches 6203 6203
==========================================
+ Hits 38420 41026 +2606
+ Misses 2022 1873 -149
+ Partials 2457 0 -2457
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Validation
Part of #399.