mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-07-08 18:16:30 +00:00
last style changes for now
This commit is contained in:
@@ -270,7 +270,7 @@ dotnet_diagnostic.CA1307.severity = error # specify StringComparison for clarity
|
||||
dotnet_diagnostic.CA1309.severity = error # use ordinal StringComparison
|
||||
dotnet_diagnostic.CA1310.severity = error # specify StringComparison for correctness
|
||||
dotnet_diagnostic.CA1507.severity = error # use nameof in place of string literals
|
||||
dotnet_diagnostic.CA1513.severity = error # use ObjectDisposedException throw helper
|
||||
dotnet_diagnostic.CA1513.severity = suggestion # use ObjectDisposedException throw helper
|
||||
dotnet_diagnostic.CA1707.severity = suggestion # identifiers should not contain underscores
|
||||
dotnet_diagnostic.CA1708.severity = suggestion # identifiers should differ by more than case
|
||||
dotnet_diagnostic.CA1711.severity = suggestion # identifiers should not have incorrect suffixes
|
||||
@@ -309,7 +309,7 @@ dotnet_diagnostic.CA1712.severity = suggestion # do not prefix enum values with
|
||||
dotnet_diagnostic.CA2022.severity = suggestion # avoid inexact reads with Stream.Read
|
||||
dotnet_diagnostic.CA1850.severity = error # prefer static HashData over ComputeHash
|
||||
dotnet_diagnostic.CA2263.severity = error # prefer generic overload when type is known
|
||||
dotnet_diagnostic.CA2012.severity = suggestion # use ValueTasks correctly
|
||||
dotnet_diagnostic.CA2012.severity = error # use ValueTasks correctly
|
||||
dotnet_diagnostic.CA1001.severity = error # disposable field owners should be disposable
|
||||
|
||||
dotnet_diagnostic.CS0169.severity = error # field is never used
|
||||
@@ -319,7 +319,7 @@ dotnet_diagnostic.CS1998.severity = error # async method lacks await operators
|
||||
dotnet_diagnostic.CS8602.severity = error # possible null reference dereference
|
||||
dotnet_diagnostic.CS8604.severity = error # possible null reference argument
|
||||
dotnet_diagnostic.CS8618.severity = error # non-nullable member is uninitialized
|
||||
dotnet_diagnostic.CS0618.severity = suggestion # obsolete member usage
|
||||
dotnet_diagnostic.CS0618.severity = error # obsolete member usage
|
||||
dotnet_diagnostic.CS4014.severity = error # unawaited task call
|
||||
dotnet_diagnostic.CS8600.severity = error # possible null to non-nullable conversion
|
||||
dotnet_diagnostic.CS8603.severity = error # possible null reference return
|
||||
|
||||
@@ -42,7 +42,9 @@ public partial class EntryStream : Stream
|
||||
if (Utility.UseSyncOverAsyncDispose())
|
||||
{
|
||||
#pragma warning disable VSTHRD002 // Avoid problematic synchronous waits
|
||||
#pragma warning disable CA2012
|
||||
SkipEntryAsync().GetAwaiter().GetResult();
|
||||
#pragma warning restore CA2012
|
||||
#pragma warning restore VSTHRD002 // Avoid problematic synchronous waits
|
||||
}
|
||||
else
|
||||
|
||||
@@ -39,7 +39,9 @@ internal class TarReadOnlySubStream : Stream
|
||||
if (Utility.UseSyncOverAsyncDispose())
|
||||
{
|
||||
#pragma warning disable VSTHRD002 // Avoid problematic synchronous waits
|
||||
#pragma warning disable CA2012
|
||||
_stream.SkipAsync(512 - bytesInLastBlock).GetAwaiter().GetResult();
|
||||
#pragma warning restore CA2012
|
||||
#pragma warning restore VSTHRD002 // Avoid problematic synchronous waits
|
||||
}
|
||||
else
|
||||
|
||||
@@ -76,7 +76,9 @@ internal partial class WinzipAesCryptoStream : Stream
|
||||
try
|
||||
{
|
||||
#pragma warning disable VSTHRD002 // Avoid problematic synchronous waits
|
||||
#pragma warning disable CA2012
|
||||
_stream.ReadFullyAsync(ten, 0, 10).GetAwaiter().GetResult();
|
||||
#pragma warning restore CA2012
|
||||
#pragma warning restore VSTHRD002 // Avoid problematic synchronous waits
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -44,26 +44,6 @@ public class ZipWriterEntryOptions
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When CompressionType.Deflate is used, this property is referenced.
|
||||
/// Valid range: 0-9 (0=no compression, 6=default, 9=best compression).
|
||||
/// When null, uses the archive's default compression level.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This property is deprecated. Use <see cref="CompressionLevel"/> instead.
|
||||
/// </remarks>
|
||||
[Obsolete(
|
||||
"Use CompressionLevel property instead. This property will be removed in a future version."
|
||||
)]
|
||||
public CompressionLevel? DeflateCompressionLevel
|
||||
{
|
||||
get =>
|
||||
CompressionLevel.HasValue
|
||||
? (CompressionLevel)Math.Min(CompressionLevel.Value, 9)
|
||||
: null;
|
||||
set => CompressionLevel = value.HasValue ? (int)value.Value : null;
|
||||
}
|
||||
|
||||
public string? EntryComment { get; set; }
|
||||
|
||||
public DateTime? ModificationDateTime { get; set; }
|
||||
|
||||
@@ -173,7 +173,7 @@ public class Zip64AsyncTests : WriterTests
|
||||
var opts = new ZipWriterOptions(CompressionType.Deflate) { UseZip64 = setZip64 };
|
||||
|
||||
// Use no compression to ensure we hit the limits (actually inflates a bit, but seems better than using method==Store)
|
||||
var eo = new ZipWriterEntryOptions { DeflateCompressionLevel = CompressionLevel.None };
|
||||
var eo = new ZipWriterEntryOptions { CompressionLevel = 0 };
|
||||
|
||||
using var zip = File.OpenWrite(filename);
|
||||
using var st = forwardOnly ? (Stream)new ForwardOnlyStream(zip) : zip;
|
||||
|
||||
@@ -158,7 +158,7 @@ public class Zip64Tests : WriterTests
|
||||
var opts = new ZipWriterOptions(CompressionType.Deflate) { UseZip64 = setZip64 };
|
||||
|
||||
// Use no compression to ensure we hit the limits (actually inflates a bit, but seems better than using method==Store)
|
||||
var eo = new ZipWriterEntryOptions { DeflateCompressionLevel = CompressionLevel.None };
|
||||
var eo = new ZipWriterEntryOptions { CompressionLevel = 0 };
|
||||
|
||||
using var zip = File.OpenWrite(filename);
|
||||
using var st = forwardOnly ? (Stream)new ForwardOnlyStream(zip) : zip;
|
||||
|
||||
Reference in New Issue
Block a user