Skip to content

Commit e78e998

Browse files
Resolve dotnet format warnings
1 parent 023621d commit e78e998

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/GitVersion.Core.Tests/VersionCalculation/SemanticVersionTests.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,7 @@ public void VersionSorting()
8181
public void ToStringWithInvalidFormatTest()
8282
{
8383
var semVer = BuildSemVer(1, 2, 3, "rc", 1, 1);
84-
Should.Throw<FormatException>(() =>
85-
{
86-
semVer.ToString("invalid");
87-
});
84+
Should.Throw<FormatException>(() => semVer.ToString("invalid"));
8885
}
8986

9087
[TestCase(1, 2, 3, null, null, null, null, null, null, ExpectedResult = "1.2.3")]

src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersionPreReleaseTag.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public string ToString(string format, IFormatProvider formatProvider)
141141

142142
return format switch
143143
{
144-
"t" => (Number.HasValue ? Name.IsNullOrEmpty() ? $"{Number}" : $"{Name}.{Number}" : Name),
144+
"t" => (Number.HasValue ? Name.IsNullOrEmpty() ? $"{Number}" : $"{Name}.{Number}" : Name!),
145145
"l" => (Number.HasValue ? FormatLegacy(GetLegacyName(), Number.Value.ToString()) : FormatLegacy(GetLegacyName())),
146146
_ => throw new FormatException($"Unknown format '{format}'.")
147147
};

0 commit comments

Comments
 (0)