update and rerun csharpier

This commit is contained in:
Adam Hathcock
2023-12-18 09:04:04 +00:00
parent c0e01ac132
commit ea3a96eead
13 changed files with 51 additions and 62 deletions

View File

@@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"csharpier": {
"version": "0.26.1",
"version": "0.26.7",
"commands": [
"dotnet-csharpier"
]

View File

@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.101",
"version": "8.0.100",
"rollForward": "latestFeature"
}
}

View File

@@ -26,8 +26,7 @@ public static class ArchiveFactory
public static IWritableArchive Create(ArchiveType type)
{
var factory = Factory
.Factories
.OfType<IWriteableArchiveFactory>()
.Factories.OfType<IWriteableArchiveFactory>()
.FirstOrDefault(item => item.KnownArchiveType == type);
if (factory != null)

View File

@@ -40,9 +40,9 @@ public class RarArchive : AbstractArchive<RarArchiveEntry, RarVolume>
streams[1].Position = 0;
SrcStream.Position = 0;
return srcStream
.Streams
.Select(a => new StreamRarArchiveVolume(a, ReaderOptions, idx++));
return srcStream.Streams.Select(
a => new StreamRarArchiveVolume(a, ReaderOptions, idx++)
);
}
else //split mode or single file
{

View File

@@ -236,13 +236,11 @@ public class SevenZipArchive : AbstractArchive<SevenZipArchiveEntry, SevenZipVol
}
else
{
currentStream = archive
.database
.GetFolderStream(
stream,
currentFolder,
new PasswordProvider(Options.Password)
);
currentStream = archive.database.GetFolderStream(
stream,
currentFolder,
new PasswordProvider(Options.Password)
);
}
foreach (var entry in group)
{

View File

@@ -52,11 +52,11 @@ internal class WinzipAesEncryptionData
var rfc2898 = new Rfc2898DeriveBytes(_password, _salt, RFC2898_ITERATIONS);
#else
var rfc2898 = new Rfc2898DeriveBytes(
_password,
_salt,
RFC2898_ITERATIONS,
HashAlgorithmName.SHA1
);
_password,
_salt,
RFC2898_ITERATIONS,
HashAlgorithmName.SHA1
);
#endif
KeyBytes = rfc2898.GetBytes(KeySizeInBytes); // 16 or 24 or 32 ???

View File

@@ -142,9 +142,9 @@ internal class ZipHeaderFactory
if (entryHeader.CompressionMethod == ZipCompressionMethod.WinzipAes)
{
var data = entryHeader
.Extra
.SingleOrDefault(x => x.Type == ExtraDataType.WinZipAes);
var data = entryHeader.Extra.SingleOrDefault(
x => x.Type == ExtraDataType.WinZipAes
);
if (data != null)
{
var keySize = (WinzipAesKeySize)data.DataBytes[4];

View File

@@ -1269,10 +1269,9 @@ internal sealed partial class Unpack : BitInput, IRarUnpack
if (CurSize < DataSize + RarVM.VM_FIXEDGLOBALSIZE)
{
// StackFilter->Prg.GlobalData.Add(DataSize+VM_FIXEDGLOBALSIZE-CurSize);
StackFilter
.Program
.GlobalData
.SetSize(DataSize + RarVM.VM_FIXEDGLOBALSIZE - CurSize);
StackFilter.Program.GlobalData.SetSize(
DataSize + RarVM.VM_FIXEDGLOBALSIZE - CurSize
);
}
var offset = RarVM.VM_FIXEDGLOBALSIZE;
globalData = StackFilter.Program.GlobalData;

View File

@@ -10,9 +10,7 @@ public static class WriterFactory
public static IWriter Open(Stream stream, ArchiveType archiveType, WriterOptions writerOptions)
{
var factory = Factories
.Factory
.Factories
.OfType<IWriterFactory>()
.Factory.Factories.OfType<IWriterFactory>()
.FirstOrDefault(item => item.KnownArchiveType == archiveType);
if (factory != null)

View File

@@ -198,9 +198,9 @@ public class TarArchiveTests : ArchiveTests
using (var archive = TarArchive.Open(unmodified))
{
var entry = archive
.Entries
.Single(x => x.Key.EndsWith("jpg", StringComparison.OrdinalIgnoreCase));
var entry = archive.Entries.Single(
x => x.Key.EndsWith("jpg", StringComparison.OrdinalIgnoreCase)
);
archive.RemoveEntry(entry);
archive.SaveTo(scratchPath, CompressionType.None);
}

View File

@@ -209,11 +209,9 @@ public class TarReaderTests : ReaderTests
[Fact]
public void Tar_GZip_With_Symlink_Entries()
{
var isWindows = System
.Runtime
.InteropServices
.RuntimeInformation
.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows);
var isWindows = System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(
System.Runtime.InteropServices.OSPlatform.Windows
);
using (
Stream stream = File.OpenRead(Path.Combine(TEST_ARCHIVES_PATH, "TarWithSymlink.tar.gz"))
)
@@ -256,15 +254,12 @@ public class TarReaderTests : ReaderTests
{
// need to convert the link to an absolute path for comparison
var target = reader.Entry.LinkTarget;
var realTarget = System
.IO
.Path
.GetFullPath(
System
.IO
.Path
.Combine($"{System.IO.Path.GetDirectoryName(path)}", target)
);
var realTarget = System.IO.Path.GetFullPath(
System.IO.Path.Combine(
$"{System.IO.Path.GetDirectoryName(path)}",
target
)
);
Assert.Equal(realTarget, link.GetContents().ToString());
}

View File

@@ -20,10 +20,10 @@ public class TestBase : IDisposable
public TestBase()
{
var index = AppDomain
.CurrentDomain
.BaseDirectory
.IndexOf("SharpCompress.Test", StringComparison.OrdinalIgnoreCase);
var index = AppDomain.CurrentDomain.BaseDirectory.IndexOf(
"SharpCompress.Test",
StringComparison.OrdinalIgnoreCase
);
var path = AppDomain.CurrentDomain.BaseDirectory.Substring(0, index);
SOLUTION_BASE_PATH = Path.GetDirectoryName(path) ?? throw new ArgumentNullException();

View File

@@ -184,9 +184,9 @@ public class ZipArchiveTests : ArchiveTests
using (var archive = ZipArchive.Open(unmodified))
{
var entry = archive
.Entries
.Single(x => x.Key.EndsWith("jpg", StringComparison.OrdinalIgnoreCase));
var entry = archive.Entries.Single(
x => x.Key.EndsWith("jpg", StringComparison.OrdinalIgnoreCase)
);
archive.RemoveEntry(entry);
WriterOptions writerOptions = new ZipWriterOptions(CompressionType.Deflate);
@@ -252,9 +252,9 @@ public class ZipArchiveTests : ArchiveTests
)
);
Assert.Null(
((IArchive)vfs)
.Entries
.FirstOrDefault(v => v.Key.EndsWith("jpg", StringComparison.OrdinalIgnoreCase))
((IArchive)vfs).Entries.FirstOrDefault(
v => v.Key.EndsWith("jpg", StringComparison.OrdinalIgnoreCase)
)
);
}
}
@@ -391,14 +391,14 @@ public class ZipArchiveTests : ArchiveTests
{
archive.AddAllFromDirectory(SCRATCH_FILES_PATH);
archive.RemoveEntry(
archive
.Entries
.Single(x => x.Key.EndsWith("jpg", StringComparison.OrdinalIgnoreCase))
archive.Entries.Single(
x => x.Key.EndsWith("jpg", StringComparison.OrdinalIgnoreCase)
)
);
Assert.Null(
archive
.Entries
.FirstOrDefault(x => x.Key.EndsWith("jpg", StringComparison.OrdinalIgnoreCase))
archive.Entries.FirstOrDefault(
x => x.Key.EndsWith("jpg", StringComparison.OrdinalIgnoreCase)
)
);
}
Directory.Delete(SCRATCH_FILES_PATH, true);