Skip to content

Commit

Permalink
[Cleanup] - Code cleanup on FunFair.BuildCheck.sln
Browse files Browse the repository at this point in the history
  • Loading branch information
credfeto committed Dec 24, 2023
1 parent d5912ad commit 0f2e2a3
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/FunFair.BuildCheck.Helpers/PathHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ public static string ConvertToNative(string path)
return path.Replace(Path.DirectorySeparatorChar == '\\'
? '/'
: '\\',
Path.DirectorySeparatorChar);
newChar: Path.DirectorySeparatorChar);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public async ValueTask CheckAsync(string projectName, string projectFolder, XmlD

referencedProject = i.FullName;

XmlDocument otherProject = await this._projectXmlLoader.LoadAsync(referencedProject, cancellationToken);
XmlDocument otherProject = await this._projectXmlLoader.LoadAsync(path: referencedProject, cancellationToken: cancellationToken);

if (!otherProject.IsPackable())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace FunFair.BuildCheck.ProjectChecks.Settings;

public sealed class EnableNetAnalyzersPolicy : SimplePropertyProjectCheckBase
public sealed class EnableNetAnalyzersPolicy : SimplePropertyProjectCheckBase

{
public EnableNetAnalyzersPolicy(ILogger<EnableNetAnalyzersPolicy> logger)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public ValueTask CheckAsync(string projectName, string projectFolder, XmlDocumen
}

ProjectValueHelpers.CheckValue(projectName: projectName, project: project, nodePresence: "IsTransformWebConfigDisabled", requiredValue: true, logger: this._logger);

return ValueTask.CompletedTask;
}
}
9 changes: 7 additions & 2 deletions src/FunFair.BuildCheck.Runner/CheckRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ private static async ValueTask CheckProjectAsync(SolutionProject project,
await TestProjectAsync(projectChecks: projectChecks, project: project, projectFolder: projectFolder, doc: doc, cancellationToken: cancellationToken);
}

private static async ValueTask TestProjectAsync(IReadOnlyList<IProjectCheck> projectChecks, SolutionProject project, string projectFolder, XmlDocument doc, CancellationToken cancellationToken)
private static async ValueTask TestProjectAsync(IReadOnlyList<IProjectCheck> projectChecks,
SolutionProject project,
string projectFolder,
XmlDocument doc,
CancellationToken cancellationToken)
{
foreach (IProjectCheck check in projectChecks)
{
Expand Down Expand Up @@ -117,7 +121,8 @@ private static IServiceProvider Setup(bool warningsAsErrors,
.AddSingleton<IProjectXmlLoader, ProjectXmlLoader>()
.SetupSolutionChecks()
.SetupProjectChecks(repositorySettings: wrappedRepositorySettings)
.AddSingleton<ICheckConfiguration>(new CheckConfiguration(preReleaseBuild: preReleaseBuild, allowPackageVersionMismatch: false)));
.AddSingleton<ICheckConfiguration>(
new CheckConfiguration(preReleaseBuild: preReleaseBuild, allowPackageVersionMismatch: false)));
}

private static async ValueTask<IReadOnlyList<SolutionProject>> LoadProjectsAsync(string solution, CancellationToken cancellationToken)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
<ProjectReference Include="..\FunFair.BuildCheck.SolutionChecks\FunFair.BuildCheck.SolutionChecks.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageReference Include="NonBlocking" Version="2.1.2" />
<PackageReference Include="NuGet.Versioning" Version="6.8.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AsyncFixer" Version="1.6.0" PrivateAssets="All" ExcludeAssets="runtime" />
Expand Down
3 changes: 2 additions & 1 deletion src/FunFair.BuildCheck.Runner/Services/LoggerProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ public sealed class LoggerProxy<TLogClass> : ILogger<TLogClass>
{
private readonly ILogger _diagnosticLogger;

public LoggerProxy([SuppressMessage(category: "FunFair.CodeAnalysis", checkId: "FFS0024: Logger parameters should be ILogger<T>", Justification = "Not created through DI")] ILogger logger)
public LoggerProxy(
[SuppressMessage(category: "FunFair.CodeAnalysis", checkId: "FFS0024: Logger parameters should be ILogger<T>", Justification = "Not created through DI")] ILogger logger)
{
this._diagnosticLogger = logger;
}
Expand Down

0 comments on commit 0f2e2a3

Please sign in to comment.