Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add dx to catch ConfigureAwait(false) #152

Merged
merged 1 commit into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ dotnet_diagnostic.IDE0005.severity = none
# RS0041: Public members should not use oblivious types
dotnet_diagnostic.RS0041.severity = suggestion

# CA2007: Do not directly await a Task
dotnet_diagnostic.CA2007.severity = error

[obj/**.cs]
generated_code = true

Expand Down
1 change: 1 addition & 0 deletions build/Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<LangVersion>7.3</LangVersion>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
Expand Down
2 changes: 2 additions & 0 deletions test/OpenFeature.Benchmarks/OpenFeatureClientBenchmarks.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

using System.Collections.Immutable;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
using AutoFixture;
using BenchmarkDotNet.Attributes;
Expand All @@ -12,6 +13,7 @@ namespace OpenFeature.Benchmark
[SimpleJob(RuntimeMoniker.Net60, baseline: true)]
[JsonExporterAttribute.Full]
[JsonExporterAttribute.FullCompressed]
[SuppressMessage("Reliability", "CA2007:Consider calling ConfigureAwait on the awaited task")]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding ConfigureAwait is pointless in the testing suite.

public class OpenFeatureClientBenchmarks
{
private readonly string _clientName;
Expand Down
2 changes: 2 additions & 0 deletions test/OpenFeature.Tests/FeatureProviderTests.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
using AutoFixture;
using FluentAssertions;
Expand All @@ -9,6 +10,7 @@

namespace OpenFeature.Tests
{
[SuppressMessage("Reliability", "CA2007:Consider calling ConfigureAwait on the awaited task")]
public class FeatureProviderTests : ClearOpenFeatureInstanceFixture
{
[Fact]
Expand Down
2 changes: 2 additions & 0 deletions test/OpenFeature.Tests/OpenFeatureClientTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Immutable;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Threading.Tasks;
using AutoFixture;
Expand All @@ -16,6 +17,7 @@

namespace OpenFeature.Tests
{
[SuppressMessage("Reliability", "CA2007:Consider calling ConfigureAwait on the awaited task")]
public class OpenFeatureClientTests : ClearOpenFeatureInstanceFixture
{
[Fact]
Expand Down
2 changes: 2 additions & 0 deletions test/OpenFeature.Tests/OpenFeatureHookTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Threading.Tasks;
using AutoFixture;
Expand All @@ -14,6 +15,7 @@

namespace OpenFeature.Tests
{
[SuppressMessage("Reliability", "CA2007:Consider calling ConfigureAwait on the awaited task")]
public class OpenFeatureHookTests : ClearOpenFeatureInstanceFixture
{
[Fact]
Expand Down