diff --git a/src/SharpCompress/Common/GZip/GZipEntry.cs b/src/SharpCompress/Common/GZip/GZipEntry.cs index 5649e491..a544e9b3 100644 --- a/src/SharpCompress/Common/GZip/GZipEntry.cs +++ b/src/SharpCompress/Common/GZip/GZipEntry.cs @@ -43,7 +43,10 @@ public class GZipEntry : Entry yield return new GZipEntry(GZipFilePart.Create(stream, options.ArchiveEncoding)); } - internal static async IAsyncEnumerable GetEntriesAsync(Stream stream, OptionsBase options) + internal static async IAsyncEnumerable GetEntriesAsync( + Stream stream, + OptionsBase options + ) { yield return new GZipEntry(await GZipFilePart.CreateAsync(stream, options.ArchiveEncoding)); } diff --git a/src/SharpCompress/Factories/Factory.cs b/src/SharpCompress/Factories/Factory.cs index 67059017..157178e8 100644 --- a/src/SharpCompress/Factories/Factory.cs +++ b/src/SharpCompress/Factories/Factory.cs @@ -16,7 +16,7 @@ public abstract class Factory : IFactory { RegisterFactory(new ZipFactory()); RegisterFactory(new RarFactory()); - RegisterFactory(new TarFactory());//put tar before most + RegisterFactory(new TarFactory()); //put tar before most RegisterFactory(new GZipFactory()); RegisterFactory(new ArcFactory()); RegisterFactory(new ArjFactory()); diff --git a/src/SharpCompress/Readers/GZip/GZipReader.Factory.cs b/src/SharpCompress/Readers/GZip/GZipReader.Factory.cs index 58b5f983..3132d139 100644 --- a/src/SharpCompress/Readers/GZip/GZipReader.Factory.cs +++ b/src/SharpCompress/Readers/GZip/GZipReader.Factory.cs @@ -1,12 +1,11 @@ - using System.IO; using System.Threading; namespace SharpCompress.Readers.GZip; -public partial class GZipReader +public partial class GZipReader #if NET8_0_OR_GREATER -: IReaderOpenable + : IReaderOpenable #endif { public static IAsyncReader OpenAsyncReader( @@ -51,6 +50,7 @@ public partial class GZipReader fileInfo.NotNull(nameof(fileInfo)); return OpenReader(fileInfo.OpenRead(), readerOptions); } + public static IReader OpenReader(Stream stream, ReaderOptions? options = null) { stream.NotNull(nameof(stream)); diff --git a/src/SharpCompress/Readers/GZip/GZipReader.cs b/src/SharpCompress/Readers/GZip/GZipReader.cs index 21f8c537..48ff47cc 100644 --- a/src/SharpCompress/Readers/GZip/GZipReader.cs +++ b/src/SharpCompress/Readers/GZip/GZipReader.cs @@ -14,7 +14,9 @@ public partial class GZipReader : AbstractReader protected override IEnumerable GetEntries(Stream stream) => GZipEntry.GetEntries(stream, Options); - protected override IAsyncEnumerable GetEntriesAsync(Stream stream) { + + protected override IAsyncEnumerable GetEntriesAsync(Stream stream) + { return GZipEntry.GetEntriesAsync(stream, Options); } } diff --git a/tests/SharpCompress.Test/ArchiveTests.cs b/tests/SharpCompress.Test/ArchiveTests.cs index e30052e4..22ad318c 100644 --- a/tests/SharpCompress.Test/ArchiveTests.cs +++ b/tests/SharpCompress.Test/ArchiveTests.cs @@ -104,7 +104,12 @@ public class ArchiveTests : ReaderTests ) { testArchive = Path.Combine(TEST_ARCHIVES_PATH, testArchive); - ArchiveStreamRead(archiveFactory, Path.GetExtension(testArchive), readerOptions, testArchive); + ArchiveStreamRead( + archiveFactory, + Path.GetExtension(testArchive), + readerOptions, + testArchive + ); } protected void ArchiveStreamRead( diff --git a/tests/SharpCompress.Test/GZip/AsyncTests.cs b/tests/SharpCompress.Test/GZip/AsyncTests.cs index 2d62cb38..402a9d3e 100644 --- a/tests/SharpCompress.Test/GZip/AsyncTests.cs +++ b/tests/SharpCompress.Test/GZip/AsyncTests.cs @@ -75,7 +75,7 @@ public class AsyncTests : TestBase public async ValueTask Archive_Entry_Async_Open_Stream() { var testArchive = Path.Combine(TEST_ARCHIVES_PATH, "Tar.tar.gz"); - await using var archive = GZipArchive.OpenAsyncArchive( + await using var archive = GZipArchive.OpenAsyncArchive( new AsyncOnlyStream(File.OpenRead(testArchive)) ); diff --git a/tests/SharpCompress.Test/GZip/GZipArchiveAsyncTests.cs b/tests/SharpCompress.Test/GZip/GZipArchiveAsyncTests.cs index dd4229e4..32a57dcf 100644 --- a/tests/SharpCompress.Test/GZip/GZipArchiveAsyncTests.cs +++ b/tests/SharpCompress.Test/GZip/GZipArchiveAsyncTests.cs @@ -23,9 +23,7 @@ public class GZipArchiveAsyncTests : ArchiveTests #else await using (Stream stream = File.OpenRead(Path.Combine(TEST_ARCHIVES_PATH, "Tar.tar.gz"))) #endif - await using ( - var archive = GZipArchive.OpenAsyncArchive(new AsyncOnlyStream(stream)) - ) + await using (var archive = GZipArchive.OpenAsyncArchive(new AsyncOnlyStream(stream))) { var entry = await archive.EntriesAsync.FirstAsync(); await entry.WriteToFileAsync(Path.Combine(SCRATCH_FILES_PATH, entry.Key.NotNull())); diff --git a/tests/SharpCompress.Test/SevenZip/SevenZipArchiveTests.cs b/tests/SharpCompress.Test/SevenZip/SevenZipArchiveTests.cs index c99ac558..9a4f5151 100644 --- a/tests/SharpCompress.Test/SevenZip/SevenZipArchiveTests.cs +++ b/tests/SharpCompress.Test/SevenZip/SevenZipArchiveTests.cs @@ -85,14 +85,14 @@ public class SevenZipArchiveTests : ArchiveTests public void SevenZipArchive_BZip2_Split() => ArchiveStreamMultiRead( null, - "Original.7z.001", - "Original.7z.002", - "Original.7z.003", - "Original.7z.004", - "Original.7z.005", - "Original.7z.006", - "Original.7z.007" - ); + "Original.7z.001", + "Original.7z.002", + "Original.7z.003", + "Original.7z.004", + "Original.7z.005", + "Original.7z.006", + "Original.7z.007" + ); //Same as archive as Original.7z.001 ... 007 files without the root directory 'Original\' in the archive - this caused the verify to fail [Fact]