Conversation
There was a problem hiding this comment.
Pull request overview
Enables the .NET analyzer rule CA1836 (“Prefer IsEmpty over Count when available”) and updates a few call sites to comply, primarily on concurrent collections in runtime code and polling assertions in tests.
Changes:
- Enable CA1836 as a warning in
.editorconfig. - Replace
Count > 0/Count == 0emptiness checks withIsEmptyon concurrent collections. - Update several Mocha integration tests’ polling conditions to use
IsEmpty.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/StrawberryShake/Client/src/Transport.WebSockets/Session.cs |
Uses ConcurrentDictionary.IsEmpty instead of Count > 0 during disposal. |
src/Mocha/test/Mocha.Transport.RabbitMQ.Tests/Behaviors/InboxTests.cs |
Uses ConcurrentBag.IsEmpty in polling wait condition. |
src/Mocha/test/Mocha.Transport.InMemory.Tests/Behaviors/InboxTests.cs |
Uses ConcurrentBag.IsEmpty in polling wait condition. |
src/Mocha/test/Mocha.Tests/Outbox/OutboxIntegrationTests.cs |
Uses ConcurrentBag.IsEmpty in polling wait conditions. |
src/Mocha/test/Mocha.Tests/Inbox/InboxIntegrationTests.cs |
Uses ConcurrentBag.IsEmpty in polling wait condition. |
src/HotChocolate/Core/src/Types/Utilities/Subscriptions/ObservableSourceStreamAdapter.cs |
Uses ConcurrentQueue.IsEmpty instead of Count == 0 before awaiting. |
.editorconfig |
Adds CA1836 severity configuration. |
💡 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 #9423 +/- ##
==========================================
- Coverage 74.16% 0 -74.17%
==========================================
Files 2677 0 -2677
Lines 140790 0 -140790
Branches 16371 0 -16371
==========================================
- Hits 104421 0 -104421
+ Misses 30774 0 -30774
+ Partials 5595 0 -5595
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 of the changes (Less than 80 chars)