mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-04 05:25:00 +00:00
[PR #1128] [MERGED] Change interfaces to be consistent for new Async paths (definitely breaks things) #1565
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/adamhathcock/sharpcompress/pull/1128
Author: @adamhathcock
Created: 1/12/2026
Status: ✅ Merged
Merged: 1/15/2026
Merged by: @adamhathcock
Base:
master← Head:adam/async-interface📝 Commits (10+)
05ebf22Start using the interface to draw distinction between async and syncc5a6f90Merge branch 'adam/async' into adam/async-interfacec1f8580Remove unnecessary ValueTask wrappers from async factory methods0615d17fix async interfacing for open38203fbFix async reader variable types - Remove double await on ReaderFactory.OpenAsync and use IAsyncReaderfce4a96make Writable interfaces for archive0502ff5test fixes and fmtd727d76Merge remote-tracking branch 'origin/master' into adam/async-interface6d6103aupdate docs1b4cedfmisc fixes📊 Changes
137 files changed (+4323 additions, -2443 deletions)
View changed files
📝
.editorconfig(+0 -1)📝
.gitignore(+2 -2)📝
AGENTS.md(+0 -1)📝
Directory.Build.props(+1 -0)📝
Directory.Packages.props(+1 -0)📝
SharpCompress.sln(+1 -2)📝
docs/API.md(+91 -68)📝
docs/ARCHITECTURE.md(+11 -11)📝
docs/ENCODING.md(+13 -13)📝
docs/PERFORMANCE.md(+16 -16)📝
docs/USAGE.md(+17 -17)📝
src/SharpCompress/Archives/AbstractArchive.cs(+26 -8)📝
src/SharpCompress/Archives/AbstractWritableArchive.cs(+5 -4)📝
src/SharpCompress/Archives/ArchiveFactory.cs(+34 -109)📝
src/SharpCompress/Archives/AutoArchiveFactory.cs(+12 -11)➕
src/SharpCompress/Archives/GZip/GZipArchive.Factory.cs(+197 -0)📝
src/SharpCompress/Archives/GZip/GZipArchive.cs(+18 -217)📝
src/SharpCompress/Archives/GZip/GZipArchiveEntry.cs(+2 -4)📝
src/SharpCompress/Archives/IArchive.cs(+6 -1)📝
src/SharpCompress/Archives/IArchiveExtensions.cs(+1 -10)...and 80 more files
📄 Description
API thinking here: https://github.com/adamhathcock/sharpcompress/issues/1129
This pull request introduces several improvements and clarifications to the SharpCompress codebase and documentation, focusing on enhancing async support, updating documentation for modern usage, and cleaning up code and configuration files. The most significant changes are grouped and summarized below.
Async API Enhancements and Consistency:
AbstractArchiveby using explicit async enumerator methods for casting and updating aggregate operations to use their async variants (e.g.,AggregateAsync,AllAsync). Also addedTotalUncompressedSizeAsyncand clarifiedIsEncryptedAsyncreturn type. [1] [2]ArchiveFactoryasync methods to remove unnecessaryConfigureAwait(false), streamline calls, and eliminate redundant XML documentation comments, making the async API more idiomatic and easier to maintain. [1] [2] [3] [4] [5] [6] [7] [8]AbstractWritableArchiveto implement the newIWritableAsyncArchiveinterface and unified interface method implementations underIWritableArchiveCommon, improving consistency for writable archives. [1] [2]Documentation Updates and Modernization:
docs/API.mdto reflect modern async usage patterns, clarify types (IEntry→IArchiveEntry), provide more accurate code samples, and expand on supported compression and archive types. Also updated extraction and writer usage to reflect best practices and new APIs. [1] [2] [3] [4] [5] [6] [7]Configuration and Project Maintenance:
Microsoft.NET.ILLink.Taskpackage to central package management and enabledCentralPackageTransitivePinningEnabledin build properties to improve dependency management. [1] [2].editorconfigrule that set CS1998 (async method lacks 'await') as an error, likely to reduce noise for intentionally synchronous async methods..gitignoreand remove obsolete documentation files, reflecting a cleanup of project structure.Minor Documentation and Typo Fixes:
TotalUncompressSize→TotalUncompressedSize) for clarity and consistency.AGENTS.md.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.