Skip to content

Commit d8228a0

Browse files
committed
cleanup
1 parent 577c9ab commit d8228a0

File tree

7 files changed

+11
-21
lines changed

7 files changed

+11
-21
lines changed

src/GitVersion.Configuration/ConfigurationSerializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public override IEnumerable<IPropertyDescriptor> GetProperties(Type type, object
3434
{
3535
var descriptor = new PropertyDescriptor(p);
3636
var member = p.GetCustomAttribute<JsonPropertyNameAttribute>();
37-
if (member is { Name: not null })
37+
if (member is not null)
3838
{
3939
descriptor.Name = member.Name;
4040
}

src/GitVersion.Core.Tests/Core/RepositoryStoreTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ public void FindCommitBranchWasBranchedFromShouldReturnNullIfTheRemoteIsTheOnlyS
227227
branch.ShouldNotBeNull();
228228

229229
var configuration = GitFlowConfigurationBuilder.New.Build();
230-
var branchedCommit = gitRepoMetadataProvider.FindCommitBranchBranchedFrom(branch, configuration, []);
230+
var branchedCommit = gitRepoMetadataProvider.FindCommitBranchBranchedFrom(branch, configuration);
231231
branchedCommit.ShouldBe(BranchCommit.Empty);
232232

233233
var branchedCommits = gitRepoMetadataProvider.FindCommitBranchesBranchedFrom(branch, configuration).ToArray();

src/GitVersion.Core/VersionCalculation/VersionSearchStrategies/BaseVersionOperator.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,14 @@ public override string ToString()
2121
StringBuilder stringBuilder = new();
2222

2323
stringBuilder.Append($"{Source}: ");
24-
if (ForceIncrement)
25-
stringBuilder.Append("Force version increment ");
26-
else
27-
{
28-
stringBuilder.Append("Version increment ");
29-
}
24+
stringBuilder.Append(ForceIncrement ? "Force version increment " : "Version increment ");
3025

3126
stringBuilder.Append($"+semver '{Increment}'");
3227

3328
if (Label is null)
29+
{
3430
stringBuilder.Append(" with no label");
31+
}
3532
else
3633
{
3734
stringBuilder.Append($" with label '{Label}'");

src/GitVersion.Output.Tests/Output/GitVersionInfoGeneratorTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public void ShouldCreateFile(string fileExtension)
4444
var variables = variableProvider.GetVariablesFor(semanticVersion, EmptyConfigurationBuilder.New.Build(), 0);
4545
using var generator = sp.GetRequiredService<IGitVersionInfoGenerator>();
4646

47-
generator.Execute(variables, new(directory, fileName, fileExtension));
47+
generator.Execute(variables, new(directory, fileName));
4848

4949
fileSystem.File.ReadAllText(fullPath).ShouldMatchApproved(c => c.SubFolder(FileSystemHelper.Path.Combine("Approved", fileExtension)));
5050

@@ -85,7 +85,7 @@ public void ShouldProperlyOutputNamespaceDeclaration(string fileExtension)
8585
var variables = variableProvider.GetVariablesFor(semanticVersion, EmptyConfigurationBuilder.New.Build(), 0);
8686
using var generator = sp.GetRequiredService<IGitVersionInfoGenerator>();
8787

88-
generator.Execute(variables, new(directory, fileName, fileExtension, targetNamespace));
88+
generator.Execute(variables, new(directory, fileName, targetNamespace));
8989

9090
fileSystem.File.ReadAllText(fullPath).ShouldMatchApproved(c => c.SubFolder(FileSystemHelper.Path.Combine("Approved", fileExtension)));
9191

src/GitVersion.Output/GitVersionInfo/GitVersionInfoContext.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,5 @@ namespace GitVersion.Output.GitVersionInfo;
33
internal readonly record struct GitVersionInfoContext(
44
string WorkingDirectory,
55
string FileName,
6-
string FileExtension,
76
string? TargetNamespace = null)
8-
: IConverterContext
9-
{
10-
public GitVersionInfoContext(string workingDirectory, string fileName, string fileExtension)
11-
: this(workingDirectory, fileName, fileExtension, null)
12-
{
13-
}
14-
}
7+
: IConverterContext;

src/GitVersion.Output/GitVersionOutputTool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void GenerateGitVersionInformation(GitVersionVariables variables, FileWri
6767
{
6868
using (this.gitVersionInfoGenerator)
6969
{
70-
this.gitVersionInfoGenerator.Execute(variables, new GitVersionInfoContext(gitVersionOptions.WorkingDirectory, fileWriteInfo.FileName, fileWriteInfo.FileExtension, targetNamespace));
70+
this.gitVersionInfoGenerator.Execute(variables, new GitVersionInfoContext(gitVersionOptions.WorkingDirectory, fileWriteInfo.FileName, targetNamespace));
7171
}
7272
}
7373
}

src/GitVersion.Output/TemplateManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ internal class TemplateManager(TemplateType templateType)
1616

1717
public string? GetTemplateFor(string? fileExtension)
1818
{
19-
ArgumentNullException.ThrowIfNull(fileExtension);
19+
ArgumentNullException.ThrowIfNull(fileExtension, nameof(fileExtension));
2020

2121
string? result = null;
2222

@@ -30,7 +30,7 @@ internal class TemplateManager(TemplateType templateType)
3030

3131
public string? GetAddFormatFor(string? fileExtension)
3232
{
33-
ArgumentNullException.ThrowIfNull(fileExtension);
33+
ArgumentNullException.ThrowIfNull(fileExtension, nameof(fileExtension));
3434

3535
string? result = null;
3636

0 commit comments

Comments
 (0)