Enable recommended interoperability and maintainability rules

This commit is contained in:
Huo Yaoyuan
2024-11-27 23:00:33 +08:00
parent 1f604fdc34
commit a91fef22e9
3 changed files with 7 additions and 1 deletions

View File

@@ -32,6 +32,8 @@
<AnalysisModeDesign>Default</AnalysisModeDesign>
<AnalysisModeDocumentation>Recommended</AnalysisModeDocumentation>
<AnalysisModeGlobalization>Recommended</AnalysisModeGlobalization>
<AnalysisModeInteroperability>Recommended</AnalysisModeInteroperability>
<AnalysisModeMaintainability>Recommended</AnalysisModeMaintainability>
</PropertyGroup>
<PropertyGroup Label="NuGet">
<Authors>ppy Pty Ltd</Authors>

View File

@@ -891,7 +891,9 @@ namespace osu.Framework.Tests.IO
[JsonProperty("json")]
public TestObject Json { get; set; }
#pragma warning disable CA1507 // Happens to name the same because of casing preference
[JsonProperty("form")]
#pragma warning restore CA1507
private Dictionary<string, object> form { get; set; }
}
@@ -906,7 +908,9 @@ namespace osu.Framework.Tests.IO
[JsonProperty("args")]
private Dictionary<string, object> arguments { get; set; }
#pragma warning disable CA1507 // Happens to name the same because of casing preference
[JsonProperty("form")]
#pragma warning restore CA1507
private Dictionary<string, object> form { get; set; }
}

View File

@@ -270,7 +270,7 @@ namespace osu.Framework.Audio.Track
/// <returns>An async task for the generation of the <see cref="Waveform"/>.</returns>
public async Task<Waveform> GenerateResampledAsync(int pointCount, CancellationToken cancellationToken = default)
{
if (pointCount < 0) throw new ArgumentOutOfRangeException(nameof(pointCount));
ArgumentOutOfRangeException.ThrowIfNegative(pointCount);
if (pointCount == 0)
return new Waveform(null);