Skip to content

Commit 50b4a2c

Browse files
committed
Remove IDE0370
1 parent e024a02 commit 50b4a2c

File tree

4 files changed

+5
-20
lines changed

4 files changed

+5
-20
lines changed

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,11 @@ dotnet_diagnostic.IDE0300.severity = none
847847
# TODO: Discuss whether we want to start using this
848848
dotnet_diagnostic.IDE0301.severity = none
849849

850+
# IDE0370: Remove unnecessary suppression
851+
#
852+
# This can lead to many false positives in different target frameworks.
853+
dotnet_diagnostic.IDE0370.severity = suggestion
854+
850855
#### .NET Compiler Platform code style rules ####
851856

852857
### Language rules ###

src/Renci.SshNet/ScpClient.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,7 @@ public void Upload(Stream source, string path)
254254
using (var input = ServiceFactory.CreatePipeStream())
255255
using (var channel = Session.CreateChannelSession())
256256
{
257-
#pragma warning disable IDE0370 // Remove unnecessary suppression
258257
channel.DataReceived += (sender, e) => input.Write(e.Data.Array!, e.Data.Offset, e.Data.Count);
259-
#pragma warning restore IDE0370 // Remove unnecessary suppression
260258
channel.Closed += (sender, e) => input.Dispose();
261259
channel.Open();
262260

@@ -299,9 +297,7 @@ public void Upload(FileInfo fileInfo, string path)
299297
using (var input = ServiceFactory.CreatePipeStream())
300298
using (var channel = Session.CreateChannelSession())
301299
{
302-
#pragma warning disable IDE0370 // Remove unnecessary suppression
303300
channel.DataReceived += (sender, e) => input.Write(e.Data.Array!, e.Data.Offset, e.Data.Count);
304-
#pragma warning restore IDE0370 // Remove unnecessary suppression
305301
channel.Closed += (sender, e) => input.Dispose();
306302
channel.Open();
307303

@@ -347,9 +343,7 @@ public void Upload(DirectoryInfo directoryInfo, string path)
347343
using (var input = ServiceFactory.CreatePipeStream())
348344
using (var channel = Session.CreateChannelSession())
349345
{
350-
#pragma warning disable IDE0370 // Remove unnecessary suppression
351346
channel.DataReceived += (sender, e) => input.Write(e.Data.Array!, e.Data.Offset, e.Data.Count);
352-
#pragma warning restore IDE0370 // Remove unnecessary suppression
353347
channel.Closed += (sender, e) => input.Dispose();
354348
channel.Open();
355349

@@ -392,9 +386,7 @@ public void Download(string filename, FileInfo fileInfo)
392386
using (var input = ServiceFactory.CreatePipeStream())
393387
using (var channel = Session.CreateChannelSession())
394388
{
395-
#pragma warning disable IDE0370 // Remove unnecessary suppression
396389
channel.DataReceived += (sender, e) => input.Write(e.Data.Array!, e.Data.Offset, e.Data.Count);
397-
#pragma warning restore IDE0370 // Remove unnecessary suppression
398390
channel.Closed += (sender, e) => input.Dispose();
399391
channel.Open();
400392

@@ -434,9 +426,7 @@ public void Download(string directoryName, DirectoryInfo directoryInfo)
434426
using (var input = ServiceFactory.CreatePipeStream())
435427
using (var channel = Session.CreateChannelSession())
436428
{
437-
#pragma warning disable IDE0370 // Remove unnecessary suppression
438429
channel.DataReceived += (sender, e) => input.Write(e.Data.Array!, e.Data.Offset, e.Data.Count);
439-
#pragma warning restore IDE0370 // Remove unnecessary suppression
440430
channel.Closed += (sender, e) => input.Dispose();
441431
channel.Open();
442432

@@ -476,9 +466,7 @@ public void Download(string filename, Stream destination)
476466
using (var input = ServiceFactory.CreatePipeStream())
477467
using (var channel = Session.CreateChannelSession())
478468
{
479-
#pragma warning disable IDE0370 // Remove unnecessary suppression
480469
channel.DataReceived += (sender, e) => input.Write(e.Data.Array!, e.Data.Offset, e.Data.Count);
481-
#pragma warning restore IDE0370 // Remove unnecessary suppression
482470
channel.Closed += (sender, e) => input.Dispose();
483471
channel.Open();
484472

src/Renci.SshNet/Security/Cryptography/EcdsaKey.BclImpl.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,8 @@ public override bool Verify(byte[] input, byte[] signature)
6565
public override void Export(out byte[] qx, out byte[] qy)
6666
{
6767
var parameter = Ecdsa.ExportParameters(includePrivateParameters: false);
68-
#pragma warning disable IDE0370 // Remove unnecessary suppression
6968
qx = parameter.Q.X!;
7069
qy = parameter.Q.Y!;
71-
#pragma warning restore IDE0370 // Remove unnecessary suppression
7270
}
7371

7472
protected override void Dispose(bool disposing)

src/Renci.SshNet/SshCommand.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,7 @@ public Task ExecuteAsync(CancellationToken cancellationToken = default)
307307
{
308308
try
309309
{
310-
#pragma warning disable IDE0370 // Remove unnecessary suppression
311310
((SshCommand)cmd!).CancelAsync();
312-
#pragma warning restore IDE0370 // Remove unnecessary suppression
313311
}
314312
catch
315313
{
@@ -585,9 +583,7 @@ private void Channel_RequestReceived(object? sender, ChannelRequestEventArgs e)
585583

586584
private void Channel_ExtendedDataReceived(object? sender, ChannelExtendedDataEventArgs e)
587585
{
588-
#pragma warning disable IDE0370 // Remove unnecessary suppression
589586
ExtendedOutputStream.Write(e.Data.Array!, e.Data.Offset, e.Data.Count);
590-
#pragma warning restore IDE0370 // Remove unnecessary suppression
591587

592588
if (e.DataTypeCode == 1)
593589
{
@@ -597,9 +593,7 @@ private void Channel_ExtendedDataReceived(object? sender, ChannelExtendedDataEve
597593

598594
private void Channel_DataReceived(object? sender, ChannelDataEventArgs e)
599595
{
600-
#pragma warning disable IDE0370 // Remove unnecessary suppression
601596
OutputStream.Write(e.Data.Array!, e.Data.Offset, e.Data.Count);
602-
#pragma warning restore IDE0370 // Remove unnecessary suppression
603597
}
604598

605599
/// <summary>

0 commit comments

Comments
 (0)