Conversation
…c the equality behavior supported by Valuify (#19). Added Console and Console.Tests to support tests on generated code (rather than just tests for generated code).
* Mirror declaration snippets in console project * Corrected Simple class definitions - some minor whitespace cleanup * Supressed annoying warning * Addressed some warnings
* Add comprehensive tests for SimpleForInt Monify output * Corrected tests for SimpleForInt
* Add Monify console wrapper tests * Minor format corrections * - `ToString` no longer throws a `FormatException`. * - Equality checks involing an encapsulated array containing identical values now yield true (#19).
* Add ForString operator tests for equivalent strings * Applied suggestions
* Flatten nested console test InnerTests directories * Remove trailing newlines from nested console tests
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| private static bool IsViolatingCapturesStateRule(INamedTypeSymbol? symbol, ITypeSymbol? value) | ||
| { | ||
| return symbol is null || value is null || !symbol.IsStateless(value, out _); | ||
| return symbol is null || !symbol.IsStateless(value, out _); |
There was a problem hiding this comment.
Captures-state rule still fires when encapsulated type is unresolved
The fix for MONFY03 assumes the encapsulated value type is null, but HasMonify never returns a null type – when the attribute’s type argument can’t be resolved it yields an IErrorTypeSymbol. Analyze still passes that symbol into IsViolatingCapturesStateRule, so IsStateless evaluates the real fields against an error type and returns false, which means MONFY03 is still reported even though the type information is missing. To actually skip the diagnostic when the value type can’t be determined, the rule needs to detect unresolved types (e.g. IErrorTypeSymbol) or bail out when HasMonify fails instead of running the stateless check.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| private static bool IsViolatingCapturesStateRule(INamedTypeSymbol? symbol, ITypeSymbol? value) | ||
| { | ||
| return symbol is null || value is null || !symbol.IsStateless(value, out _); | ||
| return symbol is null || !symbol.IsStateless(value, out _); |
There was a problem hiding this comment.
Captures-state rule still fires when encapsulated type is unresolved
The fix for MONFY03 assumes the encapsulated value type is null, but HasMonify never returns a null type – when the attribute’s type argument can’t be resolved it yields an IErrorTypeSymbol. Analyze still passes that symbol into IsViolatingCapturesStateRule, so IsStateless evaluates the real fields against an error type and returns false, which means MONFY03 is still reported even though the type information is missing. To actually skip the diagnostic when the value type can’t be determined, the rule needs to detect unresolved types (e.g. IErrorTypeSymbol) or bail out when HasMonify fails instead of running the stateless check.
Useful? React with 👍 / 👎.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #28 +/- ##
==========================================
- Coverage 93.84% 93.76% -0.09%
==========================================
Files 41 44 +3
Lines 845 866 +21
Branches 86 89 +3
==========================================
+ Hits 793 812 +19
- Misses 48 50 +2
Partials 4 4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Pull Request
Description
Fixed
MONFY03 is no longer raised if the encapsulated type cannot be determined (MONFY03 Incorrectly Raised for Empty Class #22).
Equality checks involing an encapsulated array containing identical values now yield true (Equality Check Fails when Encapsulated Value is an Array #19).
ToStringno longer throws aFormatException.Type of change: Bug fix
Related issues: Equality Check Fails when Encapsulated Value is an Array #19, MONFY03 Incorrectly Raised for Empty Class #22
Checklist
Please ensure the following are true for your PR: