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

@@ -27,7 +27,7 @@
<!-- Code Analyzers -->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<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

@@ -22,7 +22,7 @@
<!-- Code Analyzers -->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<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

@@ -13,22 +13,22 @@ namespace Jellyfin.Controller.Tests
private static readonly FileSystemMetadata[] _lowerCaseFileSystemMetadata =
{
new ()
new()
{
FullName = LowerCasePath + "/Artwork",
IsDirectory = true
},
new ()
new()
{
FullName = LowerCasePath + "/Some Other Folder",
IsDirectory = true
},
new ()
new()
{
FullName = LowerCasePath + "/Song 2.mp3",
IsDirectory = false
},
new ()
new()
{
FullName = LowerCasePath + "/Song 3.mp3",
IsDirectory = false
@@ -37,12 +37,12 @@ namespace Jellyfin.Controller.Tests
private static readonly FileSystemMetadata[] _upperCaseFileSystemMetadata =
{
new ()
new()
{
FullName = UpperCasePath + "/Lyrics",
IsDirectory = true
},
new ()
new()
{
FullName = UpperCasePath + "/Song 1.mp3",
IsDirectory = false

View File

@@ -22,7 +22,7 @@
<!-- Code Analyzers -->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<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

@@ -46,7 +46,7 @@ namespace Jellyfin.Dlna.Tests
ModelDescription = "LG WebOSTV DMRplus",
ModelName = "LG TV",
ModelNumber = "1.0",
Identification = new ()
Identification = new()
{
FriendlyName = "My Device",
Manufacturer = "LG Electronics",
@@ -92,7 +92,7 @@ namespace Jellyfin.Dlna.Tests
ModelDescription = "LG WebOSTV DMRplus",
ModelName = "LG TV",
ModelNumber = "1.0",
Identification = new ()
Identification = new()
{
FriendlyName = "My Device",
Manufacturer = "LG Electronics",
@@ -120,7 +120,7 @@ namespace Jellyfin.Dlna.Tests
{
Name = "Test Profile",
FriendlyName = "My .*",
Identification = new ()
Identification = new()
};
var deviceMatch = GetManager().IsMatch(device.ToDeviceIdentification(), profile.Identification);

View File

@@ -17,7 +17,7 @@
<!-- Code Analyzers -->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<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

@@ -23,7 +23,7 @@
<!-- Code Analyzers -->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<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

@@ -6,7 +6,7 @@ namespace Jellyfin.Extensions.Tests.Json.Converters
{
public class JsonStringConverterTests
{
private readonly JsonSerializerOptions _jsonSerializerOptions = new ()
private readonly JsonSerializerOptions _jsonSerializerOptions = new()
{
Converters =
{

View File

@@ -31,7 +31,7 @@
<!-- Code Analyzers -->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<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

@@ -17,7 +17,7 @@
<!-- Code Analyzers -->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<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 @@
<!-- Code Analyzers-->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<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

@@ -23,7 +23,7 @@
<!-- Code Analyzers-->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<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

@@ -29,7 +29,7 @@
<!-- Code Analyzers -->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<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

@@ -62,7 +62,7 @@ namespace Jellyfin.Providers.Tests.MediaInfo
for (int i = 1; i <= targetIndex; i++)
{
var name = i == targetIndex ? filename : "unmatched";
attachments.Add(new ()
attachments.Add(new()
{
FileName = name,
MimeType = mimetype,
@@ -107,7 +107,7 @@ namespace Jellyfin.Providers.Tests.MediaInfo
for (int i = 1; i <= targetIndex; i++)
{
var comment = i == targetIndex ? label : "unmatched";
streams.Add(new ()
streams.Add(new()
{
Type = MediaStreamType.EmbeddedImage,
Index = i,

View File

@@ -113,7 +113,7 @@ namespace Jellyfin.Providers.Tests.MediaInfo
private static MediaStream CreateMediaStream(string path, string codec, string? language, int index, bool isForced = false, bool isDefault = false)
{
return new ()
return new()
{
Index = index,
Codec = codec,

View File

@@ -21,7 +21,7 @@ namespace Jellyfin.Providers.Tests.MediaInfo
{
private static TheoryData<Video> GetImage_UnsupportedInput_ReturnsNoImage_TestData()
{
return new ()
return new()
{
new Movie { IsPlaceHolder = true },
@@ -82,7 +82,7 @@ namespace Jellyfin.Providers.Tests.MediaInfo
[InlineData(500, 50)] // calculated time
public async void GetImage_TimeSpan_SelectsCorrectTime(int? runTimeSeconds, long expectedSeconds)
{
MediaStream targetStream = new () { Type = MediaStreamType.Video, Index = 0 };
MediaStream targetStream = new() { Type = MediaStreamType.Video, Index = 0 };
var input = new Movie
{
DefaultVideoStreamIndex = 0,

View File

@@ -173,7 +173,7 @@ namespace Jellyfin.Server.Implementations.Tests.Data
"/mnt/series/Family Guy/Season 1/Family Guy - S01E01-thumb.jpg*637452096478512963*Primary*1920*1080*WjQbtJtSO8nhNZ%L_Io#R/oaS6o}-;adXAoIn7j[%hW9s:WGw[nN|test|1234||ss",
new ItemImageInfo[]
{
new ()
new()
{
Path = "/mnt/series/Family Guy/Season 1/Family Guy - S01E01-thumb.jpg",
Type = ImageType.Primary,

View File

@@ -32,7 +32,7 @@
<!-- Code Analyzers -->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<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

@@ -14,7 +14,7 @@ namespace Jellyfin.Server.Implementations.Tests.Library
{
public class EpisodeResolverTest
{
private static readonly NamingOptions _namingOptions = new ();
private static readonly NamingOptions _namingOptions = new();
[Fact]
public void Resolve_GivenVideoInExtrasFolder_DoesNotResolveToEpisode()
@@ -65,7 +65,7 @@ namespace Jellyfin.Server.Implementations.Tests.Library
{
}
protected override TVideoType ResolveVideo<TVideoType>(ItemResolveArgs args, bool parseName) => new ();
protected override TVideoType ResolveVideo<TVideoType>(ItemResolveArgs args, bool parseName) => new();
}
}
}

View File

@@ -97,7 +97,7 @@ public class FindExtrasTests
false))
.Returns(new List<FileSystemMetadata>
{
new ()
new()
{
FullName = "/movies/Up/trailers/some trailer.mkv",
Name = "some trailer.mkv",
@@ -112,7 +112,7 @@ public class FindExtrasTests
false))
.Returns(new List<FileSystemMetadata>
{
new ()
new()
{
FullName = "/movies/Up/behind the scenes/the making of Up.mkv",
Name = "the making of Up.mkv",
@@ -127,7 +127,7 @@ public class FindExtrasTests
false))
.Returns(new List<FileSystemMetadata>
{
new ()
new()
{
FullName = "/movies/Up/theme-music/theme2.mp3",
Name = "theme2.mp3",

View File

@@ -1,8 +1,8 @@
using System;
using System.Net;
using System.Net.Http;
using System.Net.Http.Json;
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Text.Json;
using System.Threading.Tasks;
using Jellyfin.Api.Models.StartupDtos;

View File

@@ -29,7 +29,7 @@
<!-- Code Analyzers -->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<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

@@ -26,7 +26,8 @@ namespace Jellyfin.Server.Integration.Tests
{
Scheme = "ws",
Path = "websocket"
}.Uri, CancellationToken.None));
}.Uri,
CancellationToken.None));
}
}
}

View File

@@ -22,7 +22,7 @@
<!-- Code Analyzers -->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<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

@@ -23,7 +23,7 @@
<!-- Code Analyzers -->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<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>