Skip to content

Commit e3235d7

Browse files
authored
Merge pull request #781 from adamhathcock/fix-formatting
Update csharpier and fix formatting
2 parents 7d9c875 + dc89c88 commit e3235d7

40 files changed

+208
-180
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"csharpier": {
6-
"version": "0.25.0",
6+
"version": "0.26.1",
77
"commands": [
88
"dotnet-csharpier"
99
]

src/SharpCompress/Archives/ArchiveFactory.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ public static IArchive Open(Stream stream, ReaderOptions? readerOptions = null)
2525

2626
public static IWritableArchive Create(ArchiveType type)
2727
{
28-
var factory = Factory.Factories
28+
var factory = Factory
29+
.Factories
2930
.OfType<IWriteableArchiveFactory>()
3031
.FirstOrDefault(item => item.KnownArchiveType == type);
3132

src/SharpCompress/Archives/Rar/RarArchive.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ protected override IEnumerable<RarVolume> LoadVolumes(SourceStream srcStream)
4040
streams[1].Position = 0;
4141
SrcStream.Position = 0;
4242

43-
return srcStream.Streams.Select(
44-
a => new StreamRarArchiveVolume(a, ReaderOptions, idx++)
45-
);
43+
return srcStream
44+
.Streams
45+
.Select(a => new StreamRarArchiveVolume(a, ReaderOptions, idx++));
4646
}
4747
else //split mode or single file
4848
{

src/SharpCompress/Archives/SevenZip/SevenZipArchive.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,13 @@ var group in entries.Where(x => !x.IsDirectory).GroupBy(x => x.FilePart.Folder)
236236
}
237237
else
238238
{
239-
currentStream = archive.database.GetFolderStream(
240-
stream,
241-
currentFolder,
242-
new PasswordProvider(Options.Password)
243-
);
239+
currentStream = archive
240+
.database
241+
.GetFolderStream(
242+
stream,
243+
currentFolder,
244+
new PasswordProvider(Options.Password)
245+
);
244246
}
245247
foreach (var entry in group)
246248
{

src/SharpCompress/Common/Rar/Headers/FileHeader.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#nullable disable
22

3+
using System;
4+
using System.IO;
5+
using System.Text;
6+
using SharpCompress.IO;
37
#if !Rar2017_64bit
48
using size_t = System.UInt32;
59
#else
@@ -8,11 +12,6 @@
812
using size_t = System.UInt64;
913
#endif
1014

11-
using SharpCompress.IO;
12-
using System;
13-
using System.IO;
14-
using System.Text;
15-
1615
namespace SharpCompress.Common.Rar.Headers;
1716

1817
internal class FileHeader : RarHeader

src/SharpCompress/Common/Rar/RarVolume.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ internal IEnumerable<RarFilePart> GetVolumeFileParts()
7070
var part = CreateFilePart(lastMarkHeader!, fh);
7171
var buffer = new byte[fh.CompressedSize];
7272
part.GetCompressedStream().Read(buffer, 0, buffer.Length);
73-
Comment = System.Text.Encoding.UTF8.GetString(
74-
buffer,
75-
0,
76-
buffer.Length - 1
77-
);
73+
Comment = System
74+
.Text
75+
.Encoding
76+
.UTF8
77+
.GetString(buffer, 0, buffer.Length - 1);
7878
}
7979
}
8080
break;

src/SharpCompress/Common/ReaderCancelledException.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace SharpCompress.Common;
44

55
public class ReaderCancelledException : Exception
6-
76
{
87
public ReaderCancelledException(string message)
98
: base(message) { }

src/SharpCompress/Common/Tar/TarReadOnlySubStream.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
using SharpCompress.IO;
2-
using System;
1+
using System;
32
using System.IO;
3+
using SharpCompress.IO;
44

55
namespace SharpCompress.Common.Tar;
66

src/SharpCompress/Common/Zip/ZipHeaderFactory.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ private void LoadHeader(ZipFileEntry entryHeader, Stream stream)
142142

143143
if (entryHeader.CompressionMethod == ZipCompressionMethod.WinzipAes)
144144
{
145-
var data = entryHeader.Extra.SingleOrDefault(
146-
x => x.Type == ExtraDataType.WinZipAes
147-
);
145+
var data = entryHeader
146+
.Extra
147+
.SingleOrDefault(x => x.Type == ExtraDataType.WinZipAes);
148148
if (data != null)
149149
{
150150
var keySize = (WinzipAesKeySize)data.DataBytes[4];

src/SharpCompress/Compressors/Deflate/DeflateManager.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
// -----------------------------------------------------------------------
7070

7171
using System;
72-
7372
using SharpCompress.Algorithms;
7473

7574
namespace SharpCompress.Compressors.Deflate;
@@ -1959,7 +1958,9 @@ _codec.OutputBuffer is null
19591958
// returning Z_STREAM_END instead of Z_BUFF_ERROR.
19601959
}
19611960
else if (
1962-
_codec.AvailableBytesIn == 0 && (int)flush <= old_flush && flush != FlushType.Finish
1961+
_codec.AvailableBytesIn == 0
1962+
&& (int)flush <= old_flush
1963+
&& flush != FlushType.Finish
19631964
)
19641965
{
19651966
// workitem 8557

0 commit comments

Comments
 (0)