mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-10 21:22:11 +00:00
[PR #1080] [MERGED] Standardize extraction API to WriteToDirectory with IProgress support #1504
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/1080
Author: @Copilot
Created: 12/19/2025
Status: ✅ Merged
Merged: 12/19/2025
Merged by: @adamhathcock
Base:
master← Head:copilot/refactor-write-to-directory-consistency📝 Commits (9)
3f9986cInitial plan8b95e0aStandardize on WriteToDirectory naming and add async support0e59bf3Add test for IArchive.WriteToDirectoryAsync54b64a8Fix misleading variable name: emptyDirectory -> parentDirectory17bde8dMerge branch 'master' of https://github.com/adamhathcock/sharpcompress into copilot/refactor-write-to-directory-consistency2f0eb0bReplace Action with IProgress for progress reportingc701bbbRun CSharpier formatting and document check-format processd392991Remove CancellationToken from synchronous WriteToDirectory overloadc2e0179refactor archive extensions📊 Changes
4 files changed (+200 additions, -61 deletions)
View changed files
📝
AGENTS.md(+26 -4)📝
src/SharpCompress/Archives/IArchiveExtensions.cs(+139 -56)📝
tests/SharpCompress.Test/ArchiveTests.cs(+1 -1)📝
tests/SharpCompress.Test/Zip/ZipArchiveAsyncTests.cs(+34 -0)📄 Description
Standardize on WriteToDirectory Naming
This PR resolves the naming inconsistency between
WriteToDirectoryandExtractToDirectorymethods as requested in the issue.Changes Made
1. ✅ Removed
ExtractToDirectorymethodIArchiveExtensions.csto standardize onWriteToDirectorynaming2. ✅ Enhanced
WriteToDirectoryoverloadsExtractAllEntries()for optimal performanceIProgress<ProgressReport>for consistent progress reporting (without CancellationToken for sync methods)3. ✅ Added
WriteToDirectoryAsyncIArchivewith full async/await supportIProgress<ProgressReport>progress reporting, and cancellation tokens4. ✅ Updated Tests
ArchiveExtractToDirectorytest helper to useWriteToDirectoryWriteToDirectoryAsyncmethodIProgress<ProgressReport>5. ✅ Code Quality
emptyDirectorytoparentDirectory6. ✅ Merged master branch
7. ✅ Standardized on IProgress
Action<double>withIProgress<ProgressReport>for consistency with the rest of the codebase8. ✅ Code Formatting
dotnet csharpier check .anddotnet csharpier format .9. ✅ Removed CancellationToken from sync method
CancellationTokenparameter from synchronousWriteToDirectory(string, ExtractionOptions?, IProgress<ProgressReport>?)API Consistency Verification
All archive and reader types now have consistent
WriteTo*naming patterns:IArchive (IArchiveExtensions):
IArchiveEntry (IArchiveEntryExtensions):
IReader (IReaderExtensions):
ArchiveFactory (static):
Breaking Change Notice
⚠️ Breaking Change:
ExtractToDirectorymethod has been removed.Migration Guide:
Test Results
Files Modified
src/SharpCompress/Archives/IArchiveExtensions.cs- Main API changes with IProgress and formattingtests/SharpCompress.Test/ArchiveTests.cs- Test helper updatetests/SharpCompress.Test/Zip/ZipArchiveAsyncTests.cs- New async tests with progressAGENTS.md- Added detailed documentation for check-format processOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.