Skip to content
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
6 changes: 3 additions & 3 deletions .csharpierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
**/nuget.config
**/_snapshots/
**/_snapshot/
**/[Nn]u[Gg]et.config
**/*.verified.*
**/*.received.*
44 changes: 27 additions & 17 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,22 @@ generated_code = true
# XML project files
[*.{slnx,csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj,nativeproj,locproj}]
indent_size = 2
max_line_length = 160
max_line_length = 200

# Xml build files
[*.builds]
indent_size = 2
max_line_length = 200

# Xml files
[*.{xml,stylecop,resx,ruleset}]
indent_size = 2
max_line_length = 200

# XML config files
[*.{props,targets,ruleset,config,nuspec,vsixmanifest,vsct}]
indent_size = 2
max_line_length = 200

# JSON files
[*.json]
Expand Down Expand Up @@ -87,10 +90,6 @@ insert_final_newline = false
[*.sln]
indent_style = tab

[*.{received,verified}.txt]
insert_final_newline = false
trim_trailing_whitespace = false

[*.{cs,csx,vb,vbx}]
# .NET Code Style Settings
# See https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
Expand Down Expand Up @@ -135,6 +134,13 @@ dotnet_naming_rule.all_const.severity = error
dotnet_naming_rule.all_const.style = all_elements
dotnet_naming_rule.all_const.symbols = all_const

dotnet_naming_style.all_static_readonly.capitalization = pascal_case
dotnet_naming_symbols.all_static_readonly.applicable_kinds = field
dotnet_naming_symbols.all_static_readonly.required_modifiers = static, readonly
dotnet_naming_rule.all_static_readonly.severity = error
dotnet_naming_rule.all_static_readonly.style = all_static_readonly
dotnet_naming_rule.all_static_readonly.symbols = all_static_readonly

dotnet_naming_style.all_fields.required_prefix = _
dotnet_naming_style.all_fields.capitalization = camel_case
dotnet_naming_symbols.all_fields.applicable_kinds = field
Expand Down Expand Up @@ -264,22 +270,26 @@ dotnet_diagnostic.IDE0046.severity = sugges
csharp_style_prefer_primary_constructors = false
dotnet_diagnostic.IDE0290.severity = suggestion

# IDE0060: Remove unused parameter
dotnet_diagnostic.IDE0060.severity = warning
dotnet_diagnostic.RCS1163.severity = none
dotnet_code_quality_unused_parameters = all

# [CSharpier] Incompatible rules deactivated
# https://csharpier.com/docs/IntegratingWithLinters#code-analysis-rules
dotnet_diagnostic.IDE0055.severity = none
dotnet_diagnostic.SA1000.severity = none
dotnet_diagnostic.SA1009.severity = none
dotnet_diagnostic.SA1111.severity = none
dotnet_diagnostic.SA1118.severity = none
dotnet_diagnostic.SA1137.severity = none
dotnet_diagnostic.SA1413.severity = none
dotnet_diagnostic.SA1500.severity = none
dotnet_diagnostic.SA1501.severity = none
dotnet_diagnostic.SA1502.severity = none
dotnet_diagnostic.SA1504.severity = none
dotnet_diagnostic.SA1515.severity = none
dotnet_diagnostic.SA1516.severity = none

# Support for NetEvolve.Arguments Methods
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1062#null-check-validation-methods
dotnet_code_quality.CA1062.null_check_validation_methods = M:NetEvolve.Arguments.Argument.ThrowIfNull(System.Object,System.String)|M:NetEvolve.Arguments.Argument.ThrowIfNull(System.Void*,System.String)|M:NetEvolve.Arguments.Argument.ThrowIfNullOrEmpty(System.String,System.String)|M:NetEvolve.Arguments.Argument.ThrowIfNullOrEmpty``1(System.Collections.Generic.IEnumerable{``0},System.String)|M:NetEvolve.Arguments.Argument.ThrowIfNullOrWhiteSpace(System.String,System.String)

# Disable all style rules for generated code
[*.{received,verified}.*]
generated_code = true
# Disable all style rules for migrations
dotnet_analyzer_diagnostic.severity = none

[**/Migrations/*.{cs,csx,vb,vbx}]
generated_code = true
# Disable all style rules for migrations
dotnet_analyzer_diagnostic.severity = none
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
* text=auto eol=lf
* text eol=lf

# (binary is a macro for -text -diff)
*.png binary
Expand Down
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -364,3 +364,13 @@ MigrationBackup/
# Prevent nested .editorconfig files - only root .editorconfig should be used
**/.editorconfig
!/.editorconfig

# MemPalace per-project files
.mempalace/
mempalace.yaml
entities.json

# Beads / Dolt files (added by bd init)
.dolt/
*.db
.beads-credential-key
7 changes: 6 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@
</PropertyGroup>
<ItemGroup>
<GlobalPackageReference Include="CSharpier.MSBuild" Version="1.2.6" />
<GlobalPackageReference Include="Meziantou.Analyzer" Version="3.0.77" />
<GlobalPackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4" />
<GlobalPackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="10.0.203" />
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.203" />
<GlobalPackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.14.15" />
<GlobalPackageReference Include="NetEvolve.Defaults" Version="2.3.1" />
<GlobalPackageReference Include="NetEvolve.Defaults" Version="2.6.19" />
<GlobalPackageReference Include="Roslynator.Analyzers" Version="4.15.0" />
<GlobalPackageReference Include="Roslynator.Formatting.Analyzers" Version="4.15.0" />
<GlobalPackageReference Include="Roslynator.CodeAnalysis.Analyzers" Version="4.15.0" />
<GlobalPackageReference Include="Roslynator.CodeFixes" Version="4.15.0" />
<GlobalPackageReference Include="Roslynator.Refactorings" Version="4.15.0" />
<GlobalPackageReference Include="SonarAnalyzer.CSharp" Version="10.25.0.139117" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public async Task WithTimeoutAsync_ParamTaskNull_ArgumentNullException()
{
Task task = null!;

var testCode = async () => await task!.WithTimeoutAsync(100);
var testCode = async () => await task!.WithTimeoutAsync(100).ConfigureAwait(false);
_ = await Assert.ThrowsAsync<ArgumentNullException>("task", testCode);
}

Expand All @@ -24,7 +24,7 @@ public async Task WithTimeoutAsync_IsValidTrue_Expected()
{
var timeoutInMilliseconds = 1000;

var isValid = await TestMethod().WithTimeoutAsync(timeoutInMilliseconds);
var isValid = await TestMethod().WithTimeoutAsync(timeoutInMilliseconds).ConfigureAwait(false);
_ = await Assert.That(isValid).IsTrue();

static Task TestMethod() => Task.Delay(20);
Expand All @@ -35,7 +35,7 @@ public async Task WithTimeoutAsync_IsValidFalse_Expected()
{
var timeoutInMilliseconds = 20;

var isValid = await TestMethod().WithTimeoutAsync(timeoutInMilliseconds);
var isValid = await TestMethod().WithTimeoutAsync(timeoutInMilliseconds).ConfigureAwait(false);
_ = await Assert.That(isValid).IsFalse();

static Task TestMethod() => Task.Delay(1000);
Expand All @@ -46,7 +46,7 @@ public async Task WithTimeoutAsync_TaskAlreadyCompleted_Expected()
{
var timeoutInMilliseconds = 1000;

var isValid = await TestMethod().WithTimeoutAsync(timeoutInMilliseconds);
var isValid = await TestMethod().WithTimeoutAsync(timeoutInMilliseconds).ConfigureAwait(false);
_ = await Assert.That(isValid).IsTrue();

static Task TestMethod() => Task.CompletedTask;
Expand All @@ -57,7 +57,7 @@ public async Task WithTimeoutAsync_TimeoutInfinite_Expected()
{
var timeoutInMilliseconds = Timeout.Infinite;

var isValid = await TestMethod().WithTimeoutAsync(timeoutInMilliseconds);
var isValid = await TestMethod().WithTimeoutAsync(timeoutInMilliseconds).ConfigureAwait(false);
_ = await Assert.That(isValid).IsTrue();

static Task TestMethod() => Task.Delay(1000);
Expand All @@ -68,7 +68,7 @@ public async Task WithTimeoutAsync_TimeoutZero_Expected()
{
var timeoutInMilliseconds = 0;

var isValid = await TestMethod().WithTimeoutAsync(timeoutInMilliseconds);
var isValid = await TestMethod().WithTimeoutAsync(timeoutInMilliseconds).ConfigureAwait(false);
_ = await Assert.That(isValid).IsFalse();

static Task TestMethod() => Task.Delay(1000);
Expand All @@ -79,7 +79,7 @@ public async Task WithTimeoutAsync_TimeoutMinusTwo_ThrowArgumentOutOfRangeExcept
{
var timeoutInMilliseconds = -2;

var testCode = async () => await TestMethod().WithTimeoutAsync(timeoutInMilliseconds);
var testCode = async () => await TestMethod().WithTimeoutAsync(timeoutInMilliseconds).ConfigureAwait(false);
_ = await Assert.ThrowsAsync<ArgumentOutOfRangeException>("timeoutInMilliseconds", testCode);

static Task TestMethod() => Task.Delay(1000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public async Task WithTimeoutAsync_ParamTaskNull_ArgumentNullException()
{
Task<bool> task = null!;

var testCode = async () => await task!.WithTimeoutAsync(100);
var testCode = async () => await task!.WithTimeoutAsync(100).ConfigureAwait(false);
_ = await Assert.ThrowsAsync<ArgumentNullException>("task", testCode);
}

Expand All @@ -24,13 +24,13 @@ public async Task WithTimeoutAsync_IsValidTrue_Expected()
{
var timeoutInMilliseconds = 1000;

var (isValid, result) = await TestMethod().WithTimeoutAsync(timeoutInMilliseconds);
var (isValid, result) = await TestMethod().WithTimeoutAsync(timeoutInMilliseconds).ConfigureAwait(false);
_ = await Assert.That(isValid).IsTrue();
_ = await Assert.That(result).IsEqualTo(1);

static async Task<int> TestMethod()
{
await Task.Delay(20);
await Task.Delay(20).ConfigureAwait(false);
return 1;
}
}
Expand All @@ -40,13 +40,13 @@ public async Task WithTimeoutAsync_IsValidFalse_Expected()
{
var timeoutInMilliseconds = 20;

var (isValid, result) = await TestMethod().WithTimeoutAsync(timeoutInMilliseconds);
var (isValid, result) = await TestMethod().WithTimeoutAsync(timeoutInMilliseconds).ConfigureAwait(false);
_ = await Assert.That(isValid).IsFalse();
_ = await Assert.That(result).IsEqualTo(1);

static async Task<int> TestMethod()
{
await Task.Delay(1000);
await Task.Delay(1000).ConfigureAwait(false);
return 1;
}
}
Expand All @@ -56,7 +56,7 @@ public async Task WithTimeoutAsync_TaskAlreadyCompleted_Expected()
{
var timeoutInMilliseconds = 20;

var (isValid, result) = await TestMethod().WithTimeoutAsync(timeoutInMilliseconds);
var (isValid, result) = await TestMethod().WithTimeoutAsync(timeoutInMilliseconds).ConfigureAwait(false);
_ = await Assert.That(isValid).IsTrue();
_ = await Assert.That(result).IsEqualTo(1);

Expand All @@ -68,13 +68,13 @@ public async Task WithTimeoutAsync_TimeoutInfinite_Expected()
{
var timeoutInMilliseconds = Timeout.Infinite;

var (isValid, result) = await TestMethod().WithTimeoutAsync(timeoutInMilliseconds);
var (isValid, result) = await TestMethod().WithTimeoutAsync(timeoutInMilliseconds).ConfigureAwait(false);
_ = await Assert.That(isValid).IsTrue();
_ = await Assert.That(result).IsEqualTo(1);

static async Task<int> TestMethod()
{
await Task.Delay(1000);
await Task.Delay(1000).ConfigureAwait(false);
return 1;
}
}
Expand All @@ -84,13 +84,13 @@ public async Task WithTimeoutAsync_TimeoutZero_Expected()
{
var timeoutInMilliseconds = 0;

var (isValid, result) = await TestMethod().WithTimeoutAsync(timeoutInMilliseconds);
var (isValid, result) = await TestMethod().WithTimeoutAsync(timeoutInMilliseconds).ConfigureAwait(false);
_ = await Assert.That(isValid).IsFalse();
_ = await Assert.That(result).IsEqualTo(1);

static async Task<int> TestMethod()
{
await Task.Delay(1000);
await Task.Delay(1000).ConfigureAwait(false);
return 1;
}
}
Expand All @@ -100,12 +100,12 @@ public async Task WithTimeoutAsync_TimeoutMinusTwo_ThrowsArgumentOutOfRangeExcep
{
var timeoutInMilliseconds = -2;

var testCode = async () => await TestMethod().WithTimeoutAsync(timeoutInMilliseconds);
var testCode = async () => await TestMethod().WithTimeoutAsync(timeoutInMilliseconds).ConfigureAwait(false);
_ = await Assert.ThrowsAsync<ArgumentOutOfRangeException>("timeoutInMilliseconds", testCode);

static async Task<int> TestMethod()
{
await Task.Delay(1000);
await Task.Delay(1000).ConfigureAwait(false);
return 1;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public async Task WithTimeoutAsync_ParamTaskNull_ArgumentNullException()
{
Task<bool> task = null!;

var testCode = async () => await task!.WithTimeoutAsync(TimeSpan.FromMilliseconds(100));
var testCode = async () => await task!.WithTimeoutAsync(TimeSpan.FromMilliseconds(100)).ConfigureAwait(false);
_ = await Assert.ThrowsAsync<ArgumentNullException>("task", testCode);
}

Expand All @@ -24,13 +24,13 @@ public async Task WithTimeoutAsync_IsValidTrue_Expected()
{
var timeout = TimeSpan.FromMilliseconds(1000);

var (isValid, result) = await TestMethod().WithTimeoutAsync(timeout);
var (isValid, result) = await TestMethod().WithTimeoutAsync(timeout).ConfigureAwait(false);
_ = await Assert.That(isValid).IsTrue();
_ = await Assert.That(result).IsEqualTo(1);

static async Task<int> TestMethod()
{
await Task.Delay(20);
await Task.Delay(20).ConfigureAwait(false);
return 1;
}
}
Expand All @@ -40,13 +40,13 @@ public async Task WithTimeoutAsync_IsValidFalse_Expected()
{
var timeout = TimeSpan.FromMilliseconds(20);

var (isValid, result) = await TestMethod().WithTimeoutAsync(timeout);
var (isValid, result) = await TestMethod().WithTimeoutAsync(timeout).ConfigureAwait(false);
_ = await Assert.That(isValid).IsFalse();
_ = await Assert.That(result).IsEqualTo(1);

static async Task<int> TestMethod()
{
await Task.Delay(1000);
await Task.Delay(1000).ConfigureAwait(false);
return 1;
}
}
Expand All @@ -56,7 +56,7 @@ public async Task WithTimeoutAsync_TaskAlreadyCompleted_Expected()
{
var timeout = TimeSpan.FromMilliseconds(20);

var (isValid, result) = await TestMethod().WithTimeoutAsync(timeout);
var (isValid, result) = await TestMethod().WithTimeoutAsync(timeout).ConfigureAwait(false);
_ = await Assert.That(isValid).IsTrue();
_ = await Assert.That(result).IsEqualTo(1);

Expand All @@ -68,13 +68,13 @@ public async Task WithTimeoutAsync_TimeoutInfinite_Expected()
{
var timeout = Timeout.InfiniteTimeSpan;

var (isValid, result) = await TestMethod().WithTimeoutAsync(timeout);
var (isValid, result) = await TestMethod().WithTimeoutAsync(timeout).ConfigureAwait(false);
_ = await Assert.That(isValid).IsTrue();
_ = await Assert.That(result).IsEqualTo(1);

static async Task<int> TestMethod()
{
await Task.Delay(1000);
await Task.Delay(1000).ConfigureAwait(false);
return 1;
}
}
Expand All @@ -84,13 +84,13 @@ public async Task WithTimeoutAsync_TimeoutZero_Expected()
{
var timeout = TimeSpan.Zero;

var (isValid, result) = await TestMethod().WithTimeoutAsync(timeout);
var (isValid, result) = await TestMethod().WithTimeoutAsync(timeout).ConfigureAwait(false);
_ = await Assert.That(isValid).IsFalse();
_ = await Assert.That(result).IsEqualTo(1);

static async Task<int> TestMethod()
{
await Task.Delay(1000);
await Task.Delay(1000).ConfigureAwait(false);
return 1;
}
}
Expand All @@ -100,12 +100,12 @@ public async Task WithTimeoutAsync_TimeoutMinusTwo_ThrowsArgumentOutOfRangeExcep
{
var timeout = new TimeSpan(0, 0, 0, 0, -2);

var testCode = async () => await TestMethod().WithTimeoutAsync(timeout);
var testCode = async () => await TestMethod().WithTimeoutAsync(timeout).ConfigureAwait(false);
_ = await Assert.ThrowsAsync<ArgumentOutOfRangeException>("timeout", testCode);

static async Task<int> TestMethod()
{
await Task.Delay(1000);
await Task.Delay(1000).ConfigureAwait(false);
return 1;
}
}
Expand Down
Loading