Suppress ReSharper nullability errors in Mocha#9545
Conversation
There was a problem hiding this comment.
Pull request overview
This PR suppresses ReSharper nullable-contract inspections in Mocha where the code performs null checks on members that are declared non-nullable, reducing IDE noise during development.
Changes:
- Added ReSharper
ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContractsuppressions around null checks in transport description building. - Added the same suppressions around outbound route lifecycle checks (
Endpoint is null) during initialization/discovery. - Added suppressions in routing/indexing logic when checking endpoint addresses for null.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
src/Mocha/src/Mocha/Transport/MessagingTransport.cs |
Suppresses ReSharper warnings around null checks for receive/dispatch endpoint resources in Describe(). |
src/Mocha/src/Mocha/Transport/MessagingTransport.Lifecyle.cs |
Suppresses ReSharper warnings around outbound route endpoint-null checks during setup/discovery. |
src/Mocha/src/Mocha/MessageTypes/OutboundRoute.cs |
Suppresses ReSharper warning around Endpoint null check in Describe(). |
src/Mocha/src/Mocha/Endpoints/EndpointRouter.cs |
Suppresses ReSharper warnings around address-null checks while updating the endpoint address index. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9545 +/- ##
============================
============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I think the review was directionally thoughtful, but not well calibrated for this PR. The core idea in the comments on ReceiveEndpoint.Source and DispatchEndpoint.Destination was reasonable: if something is genuinely nullable in supported use, the type system should say so. But in this case it pushed too hard toward “make the API nullable” and didn’t weigh the cost of widening a public contract just to silence a ReSharper warning. For a PR titled “Suppress ReSharper nullability errors in Mocha,” that’s too big a design leap. What I’d say now is: The review found a real tension between lifecycle state and nullability annotations. |
Summary of the changes (Less than 80 chars)