Skip to content

Commit 43025c5

Browse files
Fix ConfigureAwait warnings in src/, tests/, and benchmarks/
Co-authored-by: Chris-Wolfgang <210299580+Chris-Wolfgang@users.noreply.github.com>
1 parent 18d8565 commit 43025c5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,12 @@ dotnet_diagnostic.SA1600.severity = warning
347347
dotnet_diagnostic.SA1601.severity = warning
348348
dotnet_diagnostic.SA1602.severity = warning
349349

350+
# Library code should preserve synchronization context by default
351+
# Consumers decide whether to use ConfigureAwait(false) when calling library methods
352+
dotnet_diagnostic.MA0004.severity = none # Meziantou: Use ConfigureAwait
353+
dotnet_diagnostic.S3216.severity = none # SonarAnalyzer: ConfigureAwait
354+
dotnet_diagnostic.CA2007.severity = none # .NET Analyzer: Use ConfigureAwait
355+
350356
# Test projects - relaxed naming, no doc requirements
351357
[tests/**/*.cs]
352358
# Allow Test_Method_Names_With_Underscores
@@ -386,6 +392,9 @@ dotnet_diagnostic.S3216.severity = none # ConfigureAwait not needed in
386392
dotnet_diagnostic.S3776.severity = none # Complexity OK in tests
387393
dotnet_diagnostic.S4049.severity = none # Properties vs methods flexibility in tests
388394

395+
# .NET Analyzer - Relax in tests
396+
dotnet_diagnostic.CA2007.severity = none # ConfigureAwait not needed in tests
397+
389398
# SecurityCodeScan - Relax in tests (but keep serious ones)
390399
dotnet_diagnostic.SCS0005.severity = suggestion # Weak random OK for test data
391400

@@ -404,6 +413,11 @@ dotnet_diagnostic.CA1707.severity = none
404413
# Relax async/await analyzer rules for benchmarks
405414
dotnet_diagnostic.AsyncFixer01.severity = none # Allow unnecessary async/await in benchmarks
406415

416+
# ConfigureAwait not needed in benchmarks
417+
dotnet_diagnostic.MA0004.severity = none # Meziantou: Use ConfigureAwait
418+
dotnet_diagnostic.S3216.severity = none # SonarAnalyzer: ConfigureAwait
419+
dotnet_diagnostic.CA2007.severity = none # .NET Analyzer: Use ConfigureAwait
420+
407421
# Banned API Analyzer - Just warn in benchmarks (allow for benchmarking purposes)
408422
dotnet_diagnostic.RS0030.severity = warning # Using banned API - warn instead of error in benchmarks
409423

0 commit comments

Comments
 (0)