CodingStlye: Fixing whitespaces

This commit is contained in:
Zoe Roux 2021-09-03 21:52:15 +02:00
parent 8ff2fe3965
commit d3a03771dd
152 changed files with 2138 additions and 2120 deletions

View File

@ -7,6 +7,7 @@ trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab
indent_size = tab
smart_tab = true
[{*.yaml,*.yml}]
indent_style = space

View File

@ -6,12 +6,15 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.354" />
<PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.354" PrivateAssets="All" />
<None Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" Visible="false" />
<None Include="$(MSBuildThisFileDirectory).editorconfig" Link="stylecop.json" Visible="false" />
<None Include="$(MSBuildThisFileDirectory).editorconfig" Link=".editorconfig" Visible="false" />
</ItemGroup>
<PropertyGroup>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)Kyoo.ruleset</CodeAnalysisRuleSet>
<!-- <AnalysisMode>AllEnabledByDefault</AnalysisMode>-->
</PropertyGroup>
</Project>

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Runtime.InteropServices;

View File

@ -1,6 +1,6 @@
using Kyoo.Abstractions.Models;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Kyoo.Abstractions.Models;
namespace Kyoo.Abstractions.Controllers
{

View File

@ -11,7 +11,7 @@ namespace Kyoo.Abstractions.Models
public float StartTime { get; set; }
/// <summary>
/// The end time of the chapter (in second from the start of the episode)&.
/// The end time of the chapter (in second from the start of the episode).
/// </summary>
public float EndTime { get; set; }

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using JetBrains.Annotations;

View File

@ -14,7 +14,8 @@ namespace Kyoo.Abstractions.Models
/// <summary>
/// The link to metadata providers that this show has. See <see cref="MetadataID"/> for more information.
/// </summary>
[EditableRelation] [LoadableRelation]
[EditableRelation]
[LoadableRelation]
public ICollection<MetadataID> ExternalIDs { get; set; }
}

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using JetBrains.Annotations;

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Globalization;
using System.Linq;
using System.Text.RegularExpressions;
@ -46,8 +46,10 @@ namespace Kyoo.Abstractions.Models
@"(?<ep>[^\.]+)\.(?<lang>\w{0,3})(-(?<index>\d+))?(\.(?<forced>forced))?\.(?<type>\w+)(\.\w*)?");
if (!match.Success)
{
throw new ArgumentException("Invalid track slug. " +
"Format: {episodeSlug}.{language}[-{index}][.forced].{type}[.{extension}]");
}
EpisodeSlug = match.Groups["ep"].Value;
Language = match.Groups["lang"].Value;

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Reflection;
@ -70,6 +71,8 @@ namespace Kyoo.Authentication
/// <param name="configuration">The configuration to use</param>
/// <param name="logger">The logger used to allow IdentityServer to log things</param>
/// <param name="environment">The environment information to check if the app runs in debug mode</param>
[SuppressMessage("ReSharper", "ContextualLoggerProblem",
Justification = "The logger is used for a dependency that is not created via the container.")]
public AuthenticationModule(IConfiguration configuration,
ILogger<DefaultCorsPolicyService> logger,
IWebHostEnvironment environment)

View File

@ -135,7 +135,8 @@ namespace Kyoo.Authentication.Views
{
return BadRequest(new
{
code = "ExpiredOTAC", description = "The OTAC has expired. Try to login with your password."
code = "ExpiredOTAC",
description = "The OTAC has expired. Try to login with your password."
});
}

View File

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
@ -6,7 +6,6 @@
<RootNamespace>Kyoo.Database</RootNamespace>
<Authors>Zoe Roux</Authors>
<RepositoryUrl>https://github.com/AnonymusRaccoon/Kyoo</RepositoryUrl>
<OutputType>Library</OutputType>
<LangVersion>default</LangVersion>
</PropertyGroup>

View File

@ -41,9 +41,11 @@ namespace Kyoo.WebApp
public WebAppModule(ILogger<WebAppModule> logger)
{
if (!Enabled)
{
logger.LogError("The web app files could not be found, it will be disabled. " +
"If you cloned the project, you probably forgot to use the --recurse flag");
}
}
/// <inheritdoc />
public void Configure(IServiceCollection services)

View File

@ -10,10 +10,15 @@
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.CSharp.ReadabilityRules">
<Rule Id="SA1101" Action="None" /> <!-- PrefixLocalCallsWithThis -->
<Rule Id="SX1101" Action="Warning" /> <!-- DoNotPrefixLocalMembersWithThis -->
<Rule Id="SA1134" Action="None" /> <!-- AttributesMustNotShareLine -->
</Rules>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.CSharp.SpacingRules">
<Rule Id="SA1502" Action="None"/> <!-- DocumentationLinesMustBeginWithSingleSpace -->
</Rules>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.CSharp.LayoutRules">
<Rule Id="SA1503" Action="None"/> <!-- BracesMustNotBeOmitted -->
<Rule Id="SA1520" Action="None"/> <!-- UseBracesConsistently -->
</Rules>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.CSharp.DocumentationRules">
<Rule Id="SA1642" Action="None" /> <!-- ConstructorSummaryDocumentationMustBeginWithStandardText -->
<Rule Id="SA1643" Action="None" /> <!-- DestructorSummaryDocumentationMustBeginWithStandardText -->

View File

@ -410,7 +410,8 @@ namespace Kyoo.Tests.Utility
{
public Dictionary<int, int> Backing;
[UsedImplicitly] public Dictionary<int, int> Dictionary
[UsedImplicitly]
public Dictionary<int, int> Dictionary
{
get => Backing;
set