Add POWERKIT_INCLUDE_COVERAGE compiler variable#30
Conversation
…e files Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/88fb4eaf-33bd-4da9-83b5-6cab4734a14d Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
…clarations Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/88fb4eaf-33bd-4da9-83b5-6cab4734a14d Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/4af2c274-b95a-484d-bc58-f4754b5019ac Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
|
@copilot resolve the merge conflicts in this pull request |
Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Done — resolved in |
| using System.Diagnostics.CodeAnalysis; | ||
|
|
There was a problem hiding this comment.
Why the spacing? @copilot
Search and correct this error in other files
There was a problem hiding this comment.
Fixed in f7953c6. The using System.Diagnostics.CodeAnalysis; was placed out of order with an extra blank line separator instead of being sorted alphabetically among the other usings. Corrected in all four affected files: AsyncEnumerableExtensions.cs, ZipArchiveEntryExtensions.cs, RegistryExtensions.cs, and Cell.cs (which also had a missing blank line before namespace).
There was a problem hiding this comment.
Pull request overview
Adds an opt-in mechanism (POWERKIT_INCLUDE_COVERAGE) to control whether PowerKit APIs are included in consumer coverage reports by conditionally applying [ExcludeFromCodeCoverage] to all types by default.
Changes:
- Added
#if !POWERKIT_INCLUDE_COVERAGEguarded[ExcludeFromCodeCoverage]before type declarations across PowerKit source files. - Added
POWERKIT_INCLUDE_COVERAGEtoPowerKit.Testsconstants so tests collect coverage for PowerKit APIs.
Reviewed changes
Copilot reviewed 40 out of 40 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| PowerKit/Cell.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Disposable.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/LockFile.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/TempDirectory.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/TempFile.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/AggregateExceptionExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/ArrayPoolExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to types in the file. |
| PowerKit/Extensions/AssemblyExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/AsyncEnumerableExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/BinaryReaderExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/BinaryWriterExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/BoolExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/CollectionExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/ComparableExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/ConsoleExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/CultureInfoExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/DateTimeExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/DateTimeOffsetExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/DecimalExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/DirectoryExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/DoubleExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/EncodingExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to types in the file. |
| PowerKit/Extensions/EnumerableExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/EnvironmentExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/ExceptionExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/FileExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/FunctionalExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to types in the file. |
| PowerKit/Extensions/GuidExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/IntExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/LongExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/PathExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to types in the file. |
| PowerKit/Extensions/ProcessExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/RegistryExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/StreamExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/StringBuilderExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/StringExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/TextReaderExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/TimeSpanExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit/Extensions/ZipArchiveEntryExtensions.cs | Conditionally applies [ExcludeFromCodeCoverage] to the type. |
| PowerKit.Tests/PowerKit.Tests.csproj | Defines POWERKIT_INCLUDE_COVERAGE for test/coverage runs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/b4748028-9b7c-402a-8fea-4f07f6688c20 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Adds opt-in coverage collection via
POWERKIT_INCLUDE_COVERAGE. By default (symbol unset), all PowerKit APIs are annotated with[ExcludeFromCodeCoverage], so consumers don't pollute their coverage reports. Defining the symbol removes the attribute.Changes
#if !POWERKIT_INCLUDE_COVERAGE / [ExcludeFromCodeCoverage] / #endifguard added before every type declaration (includingfile-scoped helpers and all classes in multi-type files)PowerKit.Tests/PowerKit.Tests.csproj: DefinesPOWERKIT_INCLUDE_COVERAGEso tests measure actual coverage of the APIsUsage