Skip to content

Commit 9446385

Browse files
committed
Rename variable configProvider to configurationProvider
1 parent dae1636 commit 9446385

File tree

5 files changed

+46
-46
lines changed

5 files changed

+46
-46
lines changed

src/GitVersion.App/GitVersionExecutor.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@ public class GitVersionExecutor : IGitVersionExecutor
1212
private readonly IConfigurationFileLocator configFileLocator;
1313
private readonly IHelpWriter helpWriter;
1414
private readonly IGitRepositoryInfo repositoryInfo;
15-
private readonly IConfigurationProvider configProvider;
15+
private readonly IConfigurationProvider configurationProvider;
1616
private readonly IGitVersionCalculateTool gitVersionCalculateTool;
1717
private readonly IGitVersionOutputTool gitVersionOutputTool;
1818
private readonly IVersionWriter versionWriter;
1919

2020
public GitVersionExecutor(ILog log, IConsole console,
21-
IConfigurationFileLocator configFileLocator, IConfigurationProvider configProvider,
21+
IConfigurationFileLocator configFileLocator, IConfigurationProvider configurationProvider,
2222
IGitVersionCalculateTool gitVersionCalculateTool, IGitVersionOutputTool gitVersionOutputTool,
2323
IVersionWriter versionWriter, IHelpWriter helpWriter, IGitRepositoryInfo repositoryInfo)
2424
{
2525
this.log = log.NotNull();
2626
this.console = console.NotNull();
2727
this.configFileLocator = configFileLocator.NotNull();
28-
this.configProvider = configProvider.NotNull();
28+
this.configurationProvider = configurationProvider.NotNull();
2929

3030
this.gitVersionCalculateTool = gitVersionCalculateTool.NotNull();
3131
this.gitVersionOutputTool = gitVersionOutputTool.NotNull();
@@ -65,7 +65,7 @@ private int RunGitVersionTool(GitVersionOptions gitVersionOptions)
6565

6666
var variables = this.gitVersionCalculateTool.CalculateVersionVariables();
6767

68-
var configuration = this.configProvider.Provide(gitVersionOptions.ConfigInfo.OverrideConfig);
68+
var configuration = this.configurationProvider.Provide(gitVersionOptions.ConfigInfo.OverrideConfig);
6969

7070
this.gitVersionOutputTool.OutputVariables(variables, configuration.UpdateBuildNumber ?? true);
7171
this.gitVersionOutputTool.UpdateAssemblyInfo(variables);
@@ -148,14 +148,14 @@ private bool HandleNonMainCommand(GitVersionOptions gitVersionOptions, out int e
148148

149149
if (gitVersionOptions.Init)
150150
{
151-
this.configProvider.Init(workingDirectory);
151+
this.configurationProvider.Init(workingDirectory);
152152
exitCode = 0;
153153
return true;
154154
}
155155

156156
if (gitVersionOptions.ConfigInfo.ShowConfig)
157157
{
158-
var configuration = this.configProvider.Provide(workingDirectory);
158+
var configuration = this.configurationProvider.Provide(workingDirectory);
159159
this.console.WriteLine(configuration.ToString());
160160
exitCode = 0;
161161
return true;

src/GitVersion.App/PublicAPI.Shipped.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ GitVersion.GitVersionAppModule.GitVersionAppModule() -> void
3737
GitVersion.GitVersionAppModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void
3838
GitVersion.GitVersionExecutor
3939
GitVersion.GitVersionExecutor.Execute(GitVersion.GitVersionOptions! gitVersionOptions) -> int
40-
GitVersion.GitVersionExecutor.GitVersionExecutor(GitVersion.Logging.ILog! log, GitVersion.Logging.IConsole! console, GitVersion.Configuration.IConfigurationFileLocator! configFileLocator, GitVersion.Configuration.IConfigurationProvider! configProvider, GitVersion.IGitVersionCalculateTool! gitVersionCalculateTool, GitVersion.IGitVersionOutputTool! gitVersionOutputTool, GitVersion.IVersionWriter! versionWriter, GitVersion.IHelpWriter! helpWriter, GitVersion.IGitRepositoryInfo! repositoryInfo) -> void
40+
GitVersion.GitVersionExecutor.GitVersionExecutor(GitVersion.Logging.ILog! log, GitVersion.Logging.IConsole! console, GitVersion.Configuration.IConfigurationFileLocator! configFileLocator, GitVersion.Configuration.IConfigurationProvider! configurationProvider, GitVersion.IGitVersionCalculateTool! gitVersionCalculateTool, GitVersion.IGitVersionOutputTool! gitVersionOutputTool, GitVersion.IVersionWriter! versionWriter, GitVersion.IHelpWriter! helpWriter, GitVersion.IGitRepositoryInfo! repositoryInfo) -> void
4141
GitVersion.GlobbingResolver
4242
GitVersion.GlobbingResolver.GlobbingResolver() -> void
4343
GitVersion.GlobbingResolver.Resolve(string! workingDirectory, string! pattern) -> System.Collections.Generic.IEnumerable<string!>!

src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.cs

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class ConfigurationProviderTests : TestBase
1919
private const string DefaultRepoPath = @"c:\MyGitRepo";
2020

2121
private string repoPath;
22-
private IConfigurationProvider configProvider;
22+
private IConfigurationProvider configurationProvider;
2323
private IFileSystem fileSystem;
2424

2525
[SetUp]
@@ -28,7 +28,7 @@ public void Setup()
2828
this.repoPath = DefaultRepoPath;
2929
var options = Options.Create(new GitVersionOptions { WorkingDirectory = repoPath });
3030
var sp = ConfigureServices(services => services.AddSingleton(options));
31-
this.configProvider = sp.GetRequiredService<IConfigurationProvider>();
31+
this.configurationProvider = sp.GetRequiredService<IConfigurationProvider>();
3232
this.fileSystem = sp.GetRequiredService<IFileSystem>();
3333

3434
ShouldlyConfiguration.ShouldMatchApprovedDefaults.LocateTestMethodUsingAttribute<TestAttribute>();
@@ -37,15 +37,15 @@ public void Setup()
3737
[Test]
3838
public void OverwritesDefaultsWithProvidedConfig()
3939
{
40-
var defaultConfig = this.configProvider.Provide(this.repoPath);
40+
var defaultConfig = this.configurationProvider.Provide(this.repoPath);
4141
const string text = @"
4242
next-version: 2.0.0
4343
branches:
4444
develop:
4545
mode: ContinuousDeployment
4646
tag: dev";
4747
SetupConfigFileContent(text);
48-
var configuration = this.configProvider.Provide(this.repoPath);
48+
var configuration = this.configurationProvider.Provide(this.repoPath);
4949

5050
configuration.NextVersion.ShouldBe("2.0.0");
5151
configuration.Branches.ShouldNotBeNull();
@@ -59,7 +59,7 @@ public void AllBranchesModeWhenUsingMainline()
5959
{
6060
const string text = "mode: Mainline";
6161
SetupConfigFileContent(text);
62-
var configuration = this.configProvider.Provide(this.repoPath);
62+
var configuration = this.configurationProvider.Provide(this.repoPath);
6363
var branches = configuration.Branches.Select(x => x.Value);
6464
branches.All(branch => branch.VersioningMode == VersioningMode.Mainline).ShouldBe(true);
6565
}
@@ -73,7 +73,7 @@ public void CanRemoveTag()
7373
release:
7474
tag: """"";
7575
SetupConfigFileContent(text);
76-
var configuration = this.configProvider.Provide(this.repoPath);
76+
var configuration = this.configurationProvider.Provide(this.repoPath);
7777

7878
configuration.NextVersion.ShouldBe("2.0.0");
7979
configuration.Branches["release"].Tag.ShouldBe(string.Empty);
@@ -88,7 +88,7 @@ public void RegexIsRequired()
8888
bug:
8989
tag: bugfix";
9090
SetupConfigFileContent(text);
91-
var ex = Should.Throw<ConfigurationException>(() => this.configProvider.Provide(this.repoPath));
91+
var ex = Should.Throw<ConfigurationException>(() => this.configurationProvider.Provide(this.repoPath));
9292
ex.Message.ShouldBe($"Branch configuration 'bug' is missing required configuration 'regex'{System.Environment.NewLine}" +
9393
"See https://gitversion.net/docs/reference/configuration for more info");
9494
}
@@ -103,7 +103,7 @@ public void SourceBranchIsRequired()
103103
regex: 'bug[/-]'
104104
tag: bugfix";
105105
SetupConfigFileContent(text);
106-
var ex = Should.Throw<ConfigurationException>(() => this.configProvider.Provide(this.repoPath));
106+
var ex = Should.Throw<ConfigurationException>(() => this.configurationProvider.Provide(this.repoPath));
107107
ex.Message.ShouldBe($"Branch configuration 'bug' is missing required configuration 'source-branches'{System.Environment.NewLine}" +
108108
"See https://gitversion.net/docs/reference/configuration for more info");
109109
}
@@ -118,7 +118,7 @@ public void SourceBranchesValidationShouldFailWhenMatchingBranchConfigurationIsM
118118
tag: bugfix
119119
source-branches: [notconfigured]";
120120
SetupConfigFileContent(text);
121-
var ex = Should.Throw<ConfigurationException>(() => this.configProvider.Provide(this.repoPath));
121+
var ex = Should.Throw<ConfigurationException>(() => this.configurationProvider.Provide(this.repoPath));
122122
ex.Message.ShouldBe($"Branch configuration 'bug' defines these 'source-branches' that are not configured: '[notconfigured]'{System.Environment.NewLine}" +
123123
"See https://gitversion.net/docs/reference/configuration for more info");
124124
}
@@ -135,7 +135,7 @@ public void SourceBranchesValidationShouldSucceedForWellKnownBranches(string wel
135135
tag: bugfix
136136
source-branches: [{wellKnownBranchKey}]";
137137
SetupConfigFileContent(text);
138-
var configuration = this.configProvider.Provide(this.repoPath);
138+
var configuration = this.configurationProvider.Provide(this.repoPath);
139139

140140
configuration.Branches["bug"].SourceBranches.ShouldBe(new List<string> { wellKnownBranchKey });
141141
}
@@ -151,7 +151,7 @@ public void CanProvideConfigForNewBranch()
151151
tag: bugfix
152152
source-branches: []";
153153
SetupConfigFileContent(text);
154-
var configuration = this.configProvider.Provide(this.repoPath);
154+
var configuration = this.configurationProvider.Provide(this.repoPath);
155155

156156
configuration.Branches["bug"].Regex.ShouldBe("bug[/-]");
157157
configuration.Branches["bug"].Tag.ShouldBe("bugfix");
@@ -168,7 +168,7 @@ public void MasterConfigReplacedWithMain()
168168
tag: beta";
169169
SetupConfigFileContent(text);
170170

171-
var configuration = this.configProvider.Provide(this.repoPath);
171+
var configuration = this.configurationProvider.Provide(this.repoPath);
172172

173173
configuration.Branches[MainBranch].Regex.ShouldBe("^master$|^main$");
174174
configuration.Branches[MainBranch].Tag.ShouldBe("beta");
@@ -188,7 +188,7 @@ public void MasterConfigReplacedWithMainInSourceBranches()
188188
is-release-branch: false";
189189
SetupConfigFileContent(text);
190190

191-
var configuration = this.configProvider.Provide(this.repoPath);
191+
var configuration = this.configurationProvider.Provide(this.repoPath);
192192

193193
configuration.Branches["breaking"].Regex.ShouldBe("breaking[/]");
194194
configuration.Branches["breaking"].SourceBranches.ShouldHaveSingleItem();
@@ -200,7 +200,7 @@ public void NextVersionCanBeInteger()
200200
{
201201
const string text = "next-version: 2";
202202
SetupConfigFileContent(text);
203-
var configuration = this.configProvider.Provide(this.repoPath);
203+
var configuration = this.configurationProvider.Provide(this.repoPath);
204204

205205
configuration.NextVersion.ShouldBe("2.0");
206206
}
@@ -210,7 +210,7 @@ public void NextVersionCanHaveEnormousMinorVersion()
210210
{
211211
const string text = "next-version: 2.118998723";
212212
SetupConfigFileContent(text);
213-
var configuration = this.configProvider.Provide(this.repoPath);
213+
var configuration = this.configurationProvider.Provide(this.repoPath);
214214

215215
configuration.NextVersion.ShouldBe("2.118998723");
216216
}
@@ -220,7 +220,7 @@ public void NextVersionCanHavePatch()
220220
{
221221
const string text = "next-version: 2.12.654651698";
222222
SetupConfigFileContent(text);
223-
var configuration = this.configProvider.Provide(this.repoPath);
223+
var configuration = this.configurationProvider.Provide(this.repoPath);
224224

225225
configuration.NextVersion.ShouldBe("2.12.654651698");
226226
}
@@ -229,7 +229,7 @@ public void NextVersionCanHavePatch()
229229
[MethodImpl(MethodImplOptions.NoInlining)]
230230
public void CanWriteOutEffectiveConfiguration()
231231
{
232-
var configuration = this.configProvider.Provide(this.repoPath);
232+
var configuration = this.configurationProvider.Provide(this.repoPath);
233233

234234
configuration.ToString().ShouldMatchApproved();
235235
}
@@ -244,7 +244,7 @@ public void CanUpdateAssemblyInformationalVersioningScheme()
244244

245245
SetupConfigFileContent(text);
246246

247-
var configuration = this.configProvider.Provide(this.repoPath);
247+
var configuration = this.configurationProvider.Provide(this.repoPath);
248248
configuration.AssemblyVersioningScheme.ShouldBe(AssemblyVersioningScheme.MajorMinor);
249249
configuration.AssemblyFileVersioningScheme.ShouldBe(AssemblyFileVersioningScheme.MajorMinorPatch);
250250
configuration.AssemblyInformationalFormat.ShouldBe("{NugetVersion}");
@@ -260,7 +260,7 @@ public void CanUpdateAssemblyInformationalVersioningSchemeWithMultipleVariables(
260260

261261
SetupConfigFileContent(text);
262262

263-
var configuration = this.configProvider.Provide(this.repoPath);
263+
var configuration = this.configurationProvider.Provide(this.repoPath);
264264
configuration.AssemblyVersioningScheme.ShouldBe(AssemblyVersioningScheme.MajorMinor);
265265
configuration.AssemblyFileVersioningScheme.ShouldBe(AssemblyFileVersioningScheme.MajorMinorPatch);
266266
configuration.AssemblyInformationalFormat.ShouldBe("{Major}.{Minor}.{Patch}");
@@ -279,7 +279,7 @@ public void CanUpdateAssemblyInformationalVersioningSchemeWithFullSemVer()
279279

280280
SetupConfigFileContent(text);
281281

282-
var configuration = this.configProvider.Provide(this.repoPath);
282+
var configuration = this.configurationProvider.Provide(this.repoPath);
283283
configuration.AssemblyVersioningScheme.ShouldBe(AssemblyVersioningScheme.MajorMinorPatch);
284284
configuration.AssemblyFileVersioningScheme.ShouldBe(AssemblyFileVersioningScheme.MajorMinorPatch);
285285
configuration.AssemblyInformationalFormat.ShouldBe("{FullSemVer}");
@@ -290,7 +290,7 @@ public void CanReadDefaultDocument()
290290
{
291291
const string text = "";
292292
SetupConfigFileContent(text);
293-
var configuration = this.configProvider.Provide(this.repoPath);
293+
var configuration = this.configurationProvider.Provide(this.repoPath);
294294
configuration.AssemblyVersioningScheme.ShouldBe(AssemblyVersioningScheme.MajorMinorPatch);
295295
configuration.AssemblyFileVersioningScheme.ShouldBe(AssemblyFileVersioningScheme.MajorMinorPatch);
296296
configuration.AssemblyInformationalFormat.ShouldBe(null);
@@ -329,9 +329,9 @@ public void NoWarnOnGitVersionYmlFile()
329329
services.AddSingleton(options);
330330
services.AddSingleton<ILog>(log);
331331
});
332-
this.configProvider = sp.GetRequiredService<IConfigurationProvider>();
332+
this.configurationProvider = sp.GetRequiredService<IConfigurationProvider>();
333333

334-
this.configProvider.Provide(this.repoPath);
334+
this.configurationProvider.Provide(this.repoPath);
335335

336336
stringLogger.Length.ShouldBe(0);
337337
}
@@ -355,7 +355,7 @@ public void ShouldUseSpecifiedSourceBranchesForDevelop()
355355
source-branches: ['develop']
356356
tag: dev";
357357
SetupConfigFileContent(text);
358-
var configuration = this.configProvider.Provide(this.repoPath);
358+
var configuration = this.configurationProvider.Provide(this.repoPath);
359359

360360
configuration.Branches["develop"].SourceBranches.ShouldBe(new List<string> { "develop" });
361361
}
@@ -370,7 +370,7 @@ public void ShouldUseDefaultSourceBranchesWhenNotSpecifiedForDevelop()
370370
mode: ContinuousDeployment
371371
tag: dev";
372372
SetupConfigFileContent(text);
373-
var configuration = this.configProvider.Provide(this.repoPath);
373+
var configuration = this.configurationProvider.Provide(this.repoPath);
374374

375375
configuration.Branches["develop"].SourceBranches.ShouldBe(new List<string>());
376376
}
@@ -386,7 +386,7 @@ public void ShouldUseSpecifiedSourceBranchesForFeature()
386386
source-branches: ['develop', 'release']
387387
tag: dev";
388388
SetupConfigFileContent(text);
389-
var configuration = this.configProvider.Provide(this.repoPath);
389+
var configuration = this.configurationProvider.Provide(this.repoPath);
390390

391391
configuration.Branches["feature"].SourceBranches.ShouldBe(new List<string> { "develop", "release" });
392392
}
@@ -401,7 +401,7 @@ public void ShouldUseDefaultSourceBranchesWhenNotSpecifiedForFeature()
401401
mode: ContinuousDeployment
402402
tag: dev";
403403
SetupConfigFileContent(text);
404-
var configuration = this.configProvider.Provide(this.repoPath);
404+
var configuration = this.configurationProvider.Provide(this.repoPath);
405405

406406
configuration.Branches["feature"].SourceBranches.ShouldBe(
407407
new List<string> { "develop", MainBranch, "release", "feature", "support", "hotfix" });
@@ -415,8 +415,8 @@ public void ShouldNotOverrideAnythingWhenOverrideConfigIsEmpty()
415415
tag-prefix: custom-tag-prefix-from-yml";
416416
SetupConfigFileContent(text);
417417

418-
var expectedConfig = this.configProvider.Provide(this.repoPath);
419-
var overridenConfig = this.configProvider.Provide(this.repoPath, new GitVersionConfiguration());
418+
var expectedConfig = this.configurationProvider.Provide(this.repoPath);
419+
var overridenConfig = this.configurationProvider.Provide(this.repoPath, new GitVersionConfiguration());
420420

421421
overridenConfig.AssemblyVersioningScheme.ShouldBe(expectedConfig.AssemblyVersioningScheme);
422422
overridenConfig.AssemblyFileVersioningScheme.ShouldBe(expectedConfig.AssemblyFileVersioningScheme);
@@ -453,7 +453,7 @@ public void ShouldUseDefaultTagPrefixWhenNotSetInConfigFile()
453453
{
454454
const string text = "";
455455
SetupConfigFileContent(text);
456-
var configuration = this.configProvider.Provide(this.repoPath);
456+
var configuration = this.configurationProvider.Provide(this.repoPath);
457457

458458
configuration.TagPrefix.ShouldBe("[vV]");
459459
}
@@ -463,7 +463,7 @@ public void ShouldUseTagPrefixFromConfigFileWhenProvided()
463463
{
464464
const string text = "tag-prefix: custom-tag-prefix-from-yml";
465465
SetupConfigFileContent(text);
466-
var configuration = this.configProvider.Provide(this.repoPath);
466+
var configuration = this.configurationProvider.Provide(this.repoPath);
467467

468468
configuration.TagPrefix.ShouldBe("custom-tag-prefix-from-yml");
469469
}
@@ -473,7 +473,7 @@ public void ShouldOverrideTagPrefixWithOverrideConfigValue([Values] bool tagPref
473473
{
474474
var text = tagPrefixSetAtYmlFile ? "tag-prefix: custom-tag-prefix-from-yml" : "";
475475
SetupConfigFileContent(text);
476-
var configuration = this.configProvider.Provide(this.repoPath, new GitVersionConfiguration { TagPrefix = "tag-prefix-from-override-configuration" });
476+
var configuration = this.configurationProvider.Provide(this.repoPath, new GitVersionConfiguration { TagPrefix = "tag-prefix-from-override-configuration" });
477477

478478
configuration.TagPrefix.ShouldBe("tag-prefix-from-override-configuration");
479479
}
@@ -483,7 +483,7 @@ public void ShouldNotOverrideDefaultTagPrefixWhenNotSetInOverrideConfig()
483483
{
484484
const string text = "";
485485
SetupConfigFileContent(text);
486-
var configuration = this.configProvider.Provide(this.repoPath, new GitVersionConfiguration { TagPrefix = null });
486+
var configuration = this.configurationProvider.Provide(this.repoPath, new GitVersionConfiguration { TagPrefix = null });
487487

488488
configuration.TagPrefix.ShouldBe("[vV]");
489489
}
@@ -493,7 +493,7 @@ public void ShouldNotOverrideTagPrefixFromConfigFileWhenNotSetInOverrideConfig()
493493
{
494494
const string text = "tag-prefix: custom-tag-prefix-from-yml";
495495
SetupConfigFileContent(text);
496-
var configuration = this.configProvider.Provide(this.repoPath, new GitVersionConfiguration { TagPrefix = null });
496+
var configuration = this.configurationProvider.Provide(this.repoPath, new GitVersionConfiguration { TagPrefix = null });
497497

498498
configuration.TagPrefix.ShouldBe("custom-tag-prefix-from-yml");
499499
}

0 commit comments

Comments
 (0)