Skip to content

Commit bc82c7f

Browse files
Added suppressions for NET analyzers.
1 parent 4d2759c commit bc82c7f

4 files changed

Lines changed: 6 additions & 0 deletions

File tree

Open.ChannelExtensions/Extensions.Join.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ public static ChannelReader<T> Join<T>(this ChannelReader<T[]> source, bool sing
9797
/// <param name="singleReader">True will cause the resultant reader to optimize for the assumption that no concurrent read operations will occur.</param>
9898
/// <param name="allowSynchronousContinuations">True can reduce the amount of scheduling and markedly improve performance, but may produce unexpected or even undesirable behavior.</param>
9999
/// <returns>A channel reader containing the joined results.</returns>
100+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "Exception is propagated.")]
100101
public static ChannelReader<T> Join<T>(
101102
this ChannelReader<IAsyncEnumerable<T>> source,
102103
bool singleReader = false,

Open.ChannelExtensions/Extensions.ReadConcurrently.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ public static partial class Extensions
1818
/// <param name="receiver">The async receiver function.</param>
1919
/// <param name="cancellationToken">An optional cancellation token.</param>
2020
/// <returns>A task that completes when no more reading is to be done.</returns>
21+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1849:Call async methods when in an async method", Justification = "Task is complete.")]
22+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "Called when all tasks complete.")]
2123
public static Task<long> ReadAllConcurrentlyAsync<T>(this ChannelReader<T> reader,
2224
int maxConcurrency,
2325
Func<T, ValueTask> receiver,

Open.ChannelExtensions/Extensions.WriteConcurrently.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ public static partial class Extensions
2222
/// <returns>A task containing the count of items written that completes when all the data has been written to the channel writer.
2323
/// The count should be ignored if the number of iterations could exceed the max value of long.</returns>
2424

25+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "Disposed when all are complete.")]
26+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1849:Call async methods when in an async method", Justification = "Task is already complete.")]
2527
public static Task<long> WriteAllConcurrentlyAsync<T>(
2628
this ChannelWriter<T> target,
2729
int maxConcurrency,

Open.ChannelExtensions/Open.ChannelExtensions.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<TargetFrameworks>netstandard2.0; netstandard2.1</TargetFrameworks>
55
<LangVersion>latest</LangVersion>
66
<EnableNETAnalyzers>true</EnableNETAnalyzers>
7+
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
78
<Nullable>enable</Nullable>
89
<Authors>electricessence</Authors>
910
<Description>

0 commit comments

Comments
 (0)