Skip to content

Commit

Permalink
Use PascalCase for named placeh // suppress
Browse files Browse the repository at this point in the history
  • Loading branch information
qdraw committed Mar 7, 2024
1 parent 6cd7db2 commit ec1a56c
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 18 deletions.
26 changes: 15 additions & 11 deletions starsky/build/Build.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using helpers;
using Nuke.Common;
Expand All @@ -10,14 +11,17 @@
// ReSharper disable once CheckNamespace
namespace build;

[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage",
[SuppressMessage("Usage",
"S3887:Use an immutable collection or reduce the " +
"accessibility of the non-private readonly field",
Justification = "Not production code.")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage",
[SuppressMessage("Usage",
"S2386:Use an immutable collection or reduce " +
"the accessibility of the non-private readonly field",
Justification = "Not production code.")]
[SuppressMessage("Sonar",
"S2629: Don't use string interpolation in logging message templates",
Justification = "Not production code.")]
[ShutdownDotNetAfterServerBuild]
public sealed class Build : NukeBuild
{
Expand Down Expand Up @@ -64,7 +68,7 @@ public sealed class Build : NukeBuild
/// Nuget & NPM dependencies are always installed
/// </summary>
[Parameter("Skip Dependencies download e.g. exiftool / " +
"geo data, nuget/npm deps are always installed")]
"geo data, nuget/npm deps are always installed")]
readonly bool NoDependencies;

/// <summary>
Expand Down Expand Up @@ -104,7 +108,7 @@ string GetBranchName()
{
var branchName = Branch;
if ( !string.IsNullOrEmpty(branchName) &&
branchName.StartsWith("refs/heads/") )
branchName.StartsWith("refs/heads/") )
{
branchName = branchName.Replace("refs/heads/", "");
}
Expand All @@ -126,7 +130,7 @@ string GetBranchName()
/// --ready-to-run
/// </summary>
/// <returns></returns>
public bool IsReadyToRunEnabled()
bool IsReadyToRunEnabled()
{
return ReadyToRun;
}
Expand Down Expand Up @@ -236,7 +240,7 @@ void ShowSettingsInfo()
$"Current RID: {RuntimeIdentifier.GetCurrentRuntimeIdentifier()}");

Log.Information("SolutionParentFolder: " +
WorkingDirectory.GetSolutionParentFolder());
WorkingDirectory.GetSolutionParentFolder());

Log.Information(NoClient
? "Client is: disabled"
Expand All @@ -251,8 +255,8 @@ void ShowSettingsInfo()
: "Publish: enabled");

Log.Information(NoSonar ||
string.IsNullOrEmpty(SonarQube.GetSonarKey()) ||
string.IsNullOrEmpty(SonarQube.GetSonarToken())
string.IsNullOrEmpty(SonarQube.GetSonarKey()) ||
string.IsNullOrEmpty(SonarQube.GetSonarToken())
? "Sonarcloud scan: disabled"
: "Sonarcloud scan: enabled");

Expand Down Expand Up @@ -319,7 +323,7 @@ void ShowSettingsInfo()
IsPublishDisabled());
});

[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage",
[SuppressMessage("Usage",
"S1144:UnusedMember.Local", Justification = "Not production code.")]
// ReSharper disable once UnusedMember.Local
Target DownloadDependencies => p => p
Expand Down Expand Up @@ -370,7 +374,7 @@ void ShowSettingsInfo()
});

// ReSharper disable once UnusedMember.Local
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage",
[SuppressMessage("Usage",
"S1144:UnusedMember.Local", Justification = "Not production code.")]
Target BuildNetCore => p => p
.Executes(() =>
Expand All @@ -383,7 +387,7 @@ void ShowSettingsInfo()
});

// ReSharper disable once UnusedMember.Local
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage",
[SuppressMessage("Usage",
"S1144:UnusedMember.Local", Justification = "Not production code.")]
Target TestNetCore => p => p
.Executes(() =>
Expand Down
4 changes: 2 additions & 2 deletions starsky/build/helpers/DotnetGenericHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static class DotnetGenericHelper
/// <param name="solution">solution file .sln</param>
public static void RestoreNetCoreCommand(Solution solution)
{
Log.Information("dotnet restore: solution: {solution}", solution);
Log.Information("dotnet restore: solution: {Solution}", solution);

DotNetRestore(p => p
.SetProjectFile(solution.Path)
Expand Down Expand Up @@ -64,7 +64,7 @@ public static void DownloadDependencies(Configuration configuration,
{
Environment.SetEnvironmentVariable("app__DependenciesFolder", genericDepsFullPath);
Log.Information("Next: DownloadDependencies");
Log.Information("Run: " + Path.Combine(
Log.Information("Run: {Path}", Path.Combine(
WorkingDirectory.GetSolutionParentFolder(), geoCliCsproj)
);

Expand Down
3 changes: 2 additions & 1 deletion starsky/build/helpers/HttpQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public static class HttpQuery
}
catch ( HttpRequestException exception )
{
Log.Information($"GetJsonFromApi {exception.StatusCode} {exception.Message}");
Log.Information("GetJsonFromApi {StatusCode} {Message}", exception.StatusCode,
exception.Message);
return null;
}
}
Expand Down
2 changes: 1 addition & 1 deletion starsky/build/helpers/RuntimeIdentifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static bool IsReadyToRunSupported(string currentIdentifier, string toRuntimeIden
}

// Handle unsupported currentIdentifier
Log.Error("Unsupported currentIdentifier: {currentIdentifier}", currentIdentifier);
Log.Error("Unsupported currentIdentifier: {CurrentIdentifier}", currentIdentifier);
return false;
}
}
6 changes: 3 additions & 3 deletions starsky/build/helpers/TrxParserHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ public static void DisplayFileTests(string trxFullFilePath)

foreach ( var result in results )
{
Log.Error($"Test Name: {result.Item1}");
Log.Error($"Message: {result.Item2}");
Log.Error($"Stack Trace: {result.Item3}");
Log.Error("Test Name: {TestName}", result.Item1);
Log.Error("Message: {Message}", result.Item2);
Log.Error("Stack Trace: {StackTrace}", result.Item3);
Log.Information("------------------------");
}
}
Expand Down

0 comments on commit ec1a56c

Please sign in to comment.