Skip to content

Commit 52280d4

Browse files
authored
fix: Disabled warning S6640 (#281) [skip ci]
1 parent e64d77a commit 52280d4

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,3 +277,6 @@ dotnet_diagnostic.SA1504.severity = none
277277
dotnet_diagnostic.SA1515.severity = none
278278
dotnet_diagnostic.SA1516.severity = none
279279

280+
# Support for NetEvolve.Arguments Methods
281+
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1062#null-check-validation-methods
282+
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)

Directory.Packages.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
1212
<GlobalPackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.12.19" />
1313
<GlobalPackageReference Include="NetEvolve.Defaults" Version="1.3.28" />
14+
<GlobalPackageReference Include="Roslynator.Analyzers" Version="4.12.9" />
15+
<GlobalPackageReference Include="SonarAnalyzer.CSharp" Version="10.3.0.106239" Condition=" '$(BuildingInsideVisualStudio)' == 'true' " />
1416
</ItemGroup>
1517
<ItemGroup>
1618
<PackageVersion Include="coverlet.collector" Version="6.0.2" />

src/NetEvolve.Arguments/Argument_ThrowIfNull.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ public static void ThrowIfNull(
4242
#else
4343
[MethodImpl(MethodImplOptions.NoInlining)]
4444
#endif
45+
#pragma warning disable S6640 // Make sure that using "unsafe" is safe here.
4546
public static unsafe void ThrowIfNull(
47+
#pragma warning restore S6640 // Make sure that using "unsafe" is safe here.
4648
[NotNull] void* argument,
4749
[CallerArgumentExpression(nameof(argument))] string? paramName = null
4850
)

0 commit comments

Comments
 (0)