Skip to content

Commit cb5a19c

Browse files
committed
refs
1 parent 0297a58 commit cb5a19c

File tree

5 files changed

+17
-14
lines changed

5 files changed

+17
-14
lines changed

src/.editorconfig

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ indent_style = space
1111
indent_size = 4
1212
charset = utf-8
1313

14+
# Redundant accessor body
15+
resharper_redundant_accessor_body_highlighting = error
16+
17+
# Replace with field keyword
18+
resharper_replace_with_field_keyword_highlighting = error
1419

1520
# Declare types in namespaces
1621
dotnet_diagnostic.CA1050.severity = None
@@ -200,6 +205,7 @@ resharper_field_can_be_made_read_only_local_highlighting = none
200205
resharper_merge_into_logical_pattern_highlighting = warning
201206
resharper_merge_into_pattern_highlighting = error
202207
resharper_method_has_async_overload_highlighting = warning
208+
# because stop rider giving errors before source generators have run
203209
resharper_partial_type_with_single_part_highlighting = warning
204210
resharper_redundant_base_qualifier_highlighting = warning
205211
resharper_redundant_cast_highlighting = error
@@ -316,7 +322,7 @@ ij_xml_space_inside_empty_tag = true
316322
indent_size = 2
317323

318324
# Verify settings
319-
[*.{received,verified}.{txt,xml,json,md,sql,csv,html}]
325+
[*.{received,verified}.{txt,xml,json,md,sql,csv,html,md}]
320326
charset = "utf-8-bom"
321327
end_of_line = lf
322328
indent_size = unset

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
33
<PropertyGroup>
4-
<NoWarn>CS1591;CS0649;xUnit1026;xUnit1013;CS1573;VerifyTestsProjectDir;VerifySetParameters;PolyFillTargetsForNuget</NoWarn>
4+
<NoWarn>CA1822;CS1591;CS0649;xUnit1026;xUnit1013;CS1573;VerifyTestsProjectDir;VerifySetParameters;PolyFillTargetsForNuget</NoWarn>
55
<Version>28.2.1</Version>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<LangVersion>preview</LangVersion>

src/Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<PackageVersion Include="MSTest.TestFramework" Version="3.6.2" />
2525
<PackageVersion Include="NUnit3TestAdapter" Version="4.6.0" />
2626
<PackageVersion Include="Polyfill" Version="7.4.1" />
27-
<PackageVersion Include="ProjectDefaults" Version="1.0.141" />
27+
<PackageVersion Include="ProjectDefaults" Version="1.0.144" />
2828
<PackageVersion Include="PublicApiGenerator" Version="11.1.0" />
2929
<PackageVersion Include="SimpleInfoName" Version="3.0.1" />
3030
<PackageVersion Include="System.Drawing.Common" Version="8.0.10" />

src/Verify/Combinations/CombinationResult.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public static CombinationResult ForException(IReadOnlyList<object?> keys, Except
99
{
1010
Keys = keys;
1111
Type = CombinationResultType.Exception;
12-
this.exception = exception;
12+
Exception = exception;
1313
}
1414

1515
public static CombinationResult ForValue(IReadOnlyList<object?> keys, object? value) =>
@@ -19,7 +19,7 @@ public static CombinationResult ForValue(IReadOnlyList<object?> keys, object? va
1919
{
2020
Keys = keys;
2121
Type = CombinationResultType.Value;
22-
this.value = value;
22+
Value = value;
2323
}
2424

2525
public static CombinationResult ForVoid(IReadOnlyList<object?> keys) =>
@@ -34,8 +34,6 @@ public static CombinationResult ForVoid(IReadOnlyList<object?> keys) =>
3434
public CombinationResultType Type { get; }
3535
public IReadOnlyList<object?> Keys { get; }
3636

37-
readonly object? value;
38-
3937
public object? Value
4038
{
4139
get
@@ -45,12 +43,11 @@ public object? Value
4543
throw new($"Invalid CombinationResultType: {Type}");
4644
}
4745

48-
return value;
46+
return field;
4947
}
5048
}
5149

52-
Exception? exception;
53-
50+
[field: AllowNull, MaybeNull]
5451
public Exception Exception
5552
{
5653
get
@@ -60,7 +57,7 @@ public Exception Exception
6057
throw new($"Invalid CombinationResultType: {Type}");
6158
}
6259

63-
return exception!;
60+
return field!;
6461
}
6562
}
6663
}

src/Verify/SettingsTask.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@ namespace VerifyTests;
22

33
public partial class SettingsTask
44
{
5-
VerifySettings? settings;
65
Func<VerifySettings, Task<VerifyResult>> buildTask;
76
Task<VerifyResult>? task;
87

98
public SettingsTask(VerifySettings? settings, Func<VerifySettings, Task<VerifyResult>> buildTask)
109
{
1110
if (settings is not null)
1211
{
13-
this.settings = new(settings);
12+
CurrentSettings = new(settings);
1413
}
1514

1615
this.buildTask = buildTask;
@@ -304,7 +303,8 @@ public SettingsTask DontUseSplitModeForUniqueDirectory()
304303
return this;
305304
}
306305

307-
public VerifySettings CurrentSettings => settings ??= new();
306+
[field: AllowNull, MaybeNull]
307+
public VerifySettings CurrentSettings => field ??= new();
308308

309309
[Pure]
310310
public Task<VerifyResult> ToTask() =>

0 commit comments

Comments
 (0)