Skip to content

Commit

Permalink
Fixed code analysis issues
Browse files Browse the repository at this point in the history
  • Loading branch information
credfeto committed Dec 10, 2023
1 parent 489ab94 commit 097da91
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
9 changes: 3 additions & 6 deletions src/FunFair.BuildVersion.Detection/PreReleaseTagBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@ internal static class PreReleaseTagBuilder

public static StringBuilder NormalizeSourceBranchName(this string currentBranch, IBranchClassification branchClassification)
{
if (branchClassification.IsPullRequest(currentBranch: currentBranch, out long pullRequestId))
{
return new("pr-" + pullRequestId.ToString(CultureInfo.InvariantCulture));
}

return new(currentBranch.ToLowerInvariant());
return new(branchClassification.IsPullRequest(currentBranch: currentBranch, out long pullRequestId)
? "pr-" + pullRequestId.ToString(CultureInfo.InvariantCulture)
: currentBranch.ToLowerInvariant());
}

public static StringBuilder ReplaceInvalidCharacters(this StringBuilder suffix)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ public void Publish(NuGetVersion version)
if (!string.IsNullOrEmpty(env))
{
File.AppendAllLines(path: env,
new[]
{
$"BUILD_VERSION={version}"
});
[
$"BUILD_VERSION={version}"
]);
}
}
}
1 change: 1 addition & 0 deletions src/FunFair.BuildVersion/EnumExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ namespace FunFair.BuildVersion;
[SuppressMessage(category: "ReSharper", checkId: "PartialTypeWithSinglePart", Justification = "Needed for generated code")]
internal static partial class EnumExtensions
{
// Code generated
}

0 comments on commit 097da91

Please sign in to comment.