Update StyleCop

This commit is contained in:
Bond_009
2021-12-24 18:28:27 +01:00
parent 2e7d173188
commit cbfa355e31
103 changed files with 550 additions and 465 deletions

View File

@@ -30,7 +30,7 @@
<!-- Code Analyzers-->
<ItemGroup>
<PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.376" PrivateAssets="All" />
<PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" />
</ItemGroup>

View File

@@ -25,7 +25,7 @@ namespace Jellyfin.Extensions.Json
/// -> AddJellyfinApi
/// -> AddJsonOptions.
/// </summary>
private static readonly JsonSerializerOptions _jsonSerializerOptions = new ()
private static readonly JsonSerializerOptions _jsonSerializerOptions = new()
{
ReadCommentHandling = JsonCommentHandling.Disallow,
WriteIndented = false,
@@ -44,12 +44,12 @@ namespace Jellyfin.Extensions.Json
}
};
private static readonly JsonSerializerOptions _pascalCaseJsonSerializerOptions = new (_jsonSerializerOptions)
private static readonly JsonSerializerOptions _pascalCaseJsonSerializerOptions = new(_jsonSerializerOptions)
{
PropertyNamingPolicy = null
};
private static readonly JsonSerializerOptions _camelCaseJsonSerializerOptions = new (_jsonSerializerOptions)
private static readonly JsonSerializerOptions _camelCaseJsonSerializerOptions = new(_jsonSerializerOptions)
{
PropertyNamingPolicy = JsonNamingPolicy.CamelCase
};

View File

@@ -43,7 +43,7 @@ namespace Jellyfin.Extensions
/// <param name="separator">The separator to split on.</param>
/// <returns>The enumerator struct.</returns>
[Pure]
public static Enumerator SpanSplit(this string str, char separator) => new (str.AsSpan(), separator);
public static Enumerator SpanSplit(this string str, char separator) => new(str.AsSpan(), separator);
/// <summary>
/// Creates a new span split enumerator.
@@ -52,7 +52,7 @@ namespace Jellyfin.Extensions
/// <param name="separator">The separator to split on.</param>
/// <returns>The enumerator struct.</returns>
[Pure]
public static Enumerator Split(this ReadOnlySpan<char> str, char separator) => new (str, separator);
public static Enumerator Split(this ReadOnlySpan<char> str, char separator) => new(str, separator);
/// <summary>
/// Provides an enumerator for the substrings seperated by the separator.