Conversation
Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/7baa5f21-3d1a-4590-9457-f25749bfe36a Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
- Move TFM guards to file top in StreamExtensions.cs and TextReaderExtensions.cs (all methods in those files inherently rely on those TFMs) - Add ExcludeFromCoverage to DelegateDisposable and AsyncDisposableAdapter - Reorder ArrayPoolMemoryOwner before ArrayPoolExtensions (helper type declared before use) - Remove unnecessary named parameters from test calls throughout the test suite Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/615887ed-51d3-4f7c-89df-80f1fe80c993 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
Tyrrrz
April 17, 2026 15:07
View session
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## prime #49 +/- ##
==========================================
- Coverage 94.56% 94.55% -0.02%
==========================================
Files 92 92
Lines 1951 1947 -4
Branches 152 152
==========================================
- Hits 1845 1841 -4
Misses 77 77
Partials 29 29 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Tyrrrz
reviewed
Apr 17, 2026
Tyrrrz
reviewed
Apr 17, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR applies a uniform stylistic consistency pass across PowerKit and its test suite, primarily standardizing TFM guard placement, coverage-exclusion attributes for types, helper type ordering, and removal of unnecessary named arguments.
Changes:
- Moved TFM guards to the top of files where the entire file is TFM-dependent (e.g., Observable/Stream/TextReader helpers).
- Added conditional
[ExcludeFromCodeCoverage]to previously uncovered helper types (DelegateDisposable,AsyncDisposableAdapter) and reordered helper types to appear before first use (ArrayPoolMemoryOwner<T>). - Removed named arguments where they don’t skip earlier optional parameters across tests.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| PowerKit/SynchronizedObserver.cs | Moves the file-wide TFM guard to the top of the file. |
| PowerKit/Observable.cs | Moves the file-wide TFM guard to the top of the file. |
| PowerKit/Extensions/TextReaderExtensions.cs | Moves the file-wide TFM guard to the top and closes it at end-of-file. |
| PowerKit/Extensions/StreamExtensions.cs | Moves the file-wide TFM guard to the top and closes it at end-of-file. |
| PowerKit/Extensions/AsyncDisposableExtensions.cs | Adds conditional [ExcludeFromCodeCoverage] to AsyncDisposableAdapter. |
| PowerKit/Extensions/ArrayPoolExtensions.cs | Reorders helper type before first use; keeps conditional coverage attributes per type. |
| PowerKit/Disposable.cs | Adds conditional [ExcludeFromCodeCoverage] to DelegateDisposable. |
| PowerKit.Tests/ZipArchiveEntryExtensionsTests.cs | Removes unnecessary named argument in ZipArchive constructor call. |
| PowerKit.Tests/TempFileTests.cs | Removes unnecessary named argument in TempFile.Create(...). |
| PowerKit.Tests/TempDirectoryTests.cs | Removes unnecessary named argument in TempDirectory.Create(...). |
| PowerKit.Tests/StreamExtensionsTests.cs | Removes unnecessary named arguments in CopyToAsync(...) and assertion precision. |
| PowerKit.Tests/ProgressMuxerTests.cs | Removes unnecessary named arguments in CreateInput(...). |
| PowerKit.Tests/PathExtensionsTests.cs | Removes unnecessary named arguments in GetInvalid*Chars(...). |
| PowerKit.Tests/ObservableTests.cs | Removes unnecessary named argument where it doesn’t skip earlier optionals. |
| PowerKit.Tests/FileExtensionsTests.cs | Removes unnecessary named arguments in ReadAllBytes*(...) calls. |
| PowerKit.Tests/EncodingExtensionsTests.cs | Removes unnecessary named arguments in UTF8Encoding(...) constructor calls. |
| PowerKit.Tests/DirectoryExtensionsTests.cs | Removes unnecessary named arguments in TryDelete(...) calls. |
| PowerKit.Tests/BinaryWriterExtensionsTests.cs | Removes unnecessary named arguments in SkipPadding(...). |
| PowerKit.Tests/BinaryReaderExtensionsTests.cs | Removes unnecessary named arguments in SkipPadding(...) / SkipZeroes(...). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…erExtensions Per review feedback: Stream and TextReader exist on all TFMs, so the guard belongs inside the extension block on the individual methods, not at file top. Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/3448c479-13bc-45bc-93a0-5ee8b3fc4617 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Tyrrrz
approved these changes
Apr 17, 2026
This was referenced May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enforces five style rules uniformly across the library and test project.
TFM guard placement
Guards belong at the top of the file when the entire file's content depends on the TFM (i.e. the type being extended is itself TFM-specific); otherwise at method level.
StreamExtensions.cs,TextReaderExtensions.cs: guard is inside theextensionblock at method level —StreamandTextReaderexist on all TFMs; only the individual async methods rely on TFM-specific APIs.Observable.cs,SynchronizedObserver.cs: guard at file top —IObservable<T>itself requires NET40+, so the whole type is TFM-specific.AssemblyExtensions.cs,FileExtensions.cs) keep method-level guards.ExcludeFromCoverageon all PowerKit types[ExcludeFromCodeCoverage]block toDelegateDisposableandAsyncDisposableAdapter, which were missing it.Helper types:
fileaccess + declared before first useArrayPoolMemoryOwner<T>reordered to appear beforeArrayPoolExtensionsinArrayPoolExtensions.cs.DelegateDisposableandAsyncDisposableAdapteralready hadfileaccessibility; coverage attribute was the only gap.No unnecessary named parameters
Removed named args wherever the parameter is not skipping an earlier default:
Named args are retained only where they skip an earlier optional parameter (e.g.
onError:andonCompleted:inObservableTests.cs).varfor all local declarationsAlready consistent throughout; no changes needed.