Skip to content

Deduplicate repeated XML docs in PowerKit with targeted <inheritdoc/> - #97

Merged
Tyrrrz merged 3 commits into
primefrom
copilot/audit-refactor-xml-docs
Jul 27, 2026
Merged

Deduplicate repeated XML docs in PowerKit with targeted <inheritdoc/>#97
Tyrrrz merged 3 commits into
primefrom
copilot/audit-refactor-xml-docs

Conversation

Copilot AI commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

This PR audits duplicate XML documentation in Tyrrrz/PowerKit and replaces repeated blocks with inheritance-based docs. Canonical docs were retained on primary overloads, and delegating/related overloads now inherit from them.

  • Overload-level doc deduplication

    • Replaced duplicated summaries on overload wrappers with <inheritdoc/> or <inheritdoc cref="..."/>.
    • Applied to:
      • Adler32.Hash(ReadOnlySpan<byte>) → inherits from Hash(byte[])
      • Crc32.Hash(ReadOnlySpan<byte>) → inherits from Hash(byte[])
      • Deflate.Compress(ReadOnlySpan<byte>) → inherits from Compress(byte[])
      • Deflate.Decompress(ReadOnlySpan<byte>) → inherits from Decompress(byte[])
      • EnumExtensions.ParseOrNull<TEnum>(string?) → inherits from ParseOrNull<TEnum>(string, bool)
      • EnumExtensions.ParseOrDefault<TEnum>(string?, TEnum) → inherits from ParseOrDefault<TEnum>(string, bool, TEnum)
      • FileExtensions.Contains(string, byte[]) → inherits from Contains(string, ReadOnlySpan<byte>)
      • HttpClientExtensions.DownloadAsync(string, ...) / HeadAsync(string, ...) → inherits from URI overload docs
  • Canonical selection

    • Kept full XML docs on central overloads (the ones containing core logic or serving as primary entry points).
    • Wrapper/delegating overloads now reference canonical docs instead of duplicating text.

Example pattern used:

/// <summary>
/// Compresses the specified data using the Deflate algorithm.
/// </summary>
public static byte[] Compress(byte[] data) { ... }

/// <inheritdoc cref="Compress(byte[])" />
public static byte[] Compress(ReadOnlySpan<byte> data) => Compress(data.ToArray());

Copilot AI changed the title [WIP] Audit and refactor XML documentation comments across repositories Deduplicate repeated XML docs in PowerKit with targeted <inheritdoc/> Jul 27, 2026
Copilot AI requested a review from Tyrrrz July 27, 2026 17:04
@Tyrrrz Tyrrrz added the enhancement New feature or request label Jul 27, 2026
@Tyrrrz
Tyrrrz marked this pull request as ready for review July 27, 2026 17:31
Copilot AI review requested due to automatic review settings July 27, 2026 17:31
@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.46%. Comparing base (1d009a8) to head (e732e58).

Additional details and impacted files
@@           Coverage Diff           @@
##            prime      #97   +/-   ##
=======================================
  Coverage   86.46%   86.46%           
=======================================
  Files          78       78           
  Lines        1411     1411           
  Branches      243      243           
=======================================
  Hits         1220     1220           
  Misses        138      138           
  Partials       53       53           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces duplicated XML documentation across several overloads in PowerKit by replacing repeated <summary> blocks with <inheritdoc/> references to a canonical overload, keeping the “source of truth” docs in one place.

Changes:

  • Replaced repeated XML doc blocks on overload wrappers in checksum (Adler32, Crc32) and compression (Deflate) APIs with <inheritdoc cref="..."/>.
  • Switched delegating overloads in EnumExtensions and FileExtensions to inherit documentation from their canonical overloads.
  • Updated HttpClientExtensions overloads to use <inheritdoc /> (but these need cref to actually inherit docs from the intended overload).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
PowerKit/Extensions/HttpClientExtensions.cs Deduplicates docs for string overloads of HTTP helpers (needs cref to correctly inherit).
PowerKit/Extensions/FileExtensions.cs Makes Contains(string, byte[]) inherit docs from the ReadOnlySpan<byte> overload.
PowerKit/Extensions/EnumExtensions.cs Makes convenience overloads inherit docs from the overloads that define the canonical behavior.
PowerKit/Deflate.cs Makes span-based overloads inherit docs from the byte[] overloads.
PowerKit/Crc32.cs Makes span-based overload inherit docs from the byte[] overload.
PowerKit/Adler32.cs Makes span-based overload inherit docs from the byte[] overload.
Comments suppressed due to low confidence (1)

PowerKit/Extensions/HttpClientExtensions.cs:75

  • <inheritdoc /> without a cref won’t inherit XML docs for this overload because it’s not overriding/implementing a base/interface member. Point it explicitly at the Uri overload to actually reuse its documentation.
        /// <inheritdoc />

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread PowerKit/Extensions/HttpClientExtensions.cs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants