diff --git a/new-cli/GitVersion.Common/GitVersion.Common.csproj b/new-cli/GitVersion.Common/GitVersion.Common.csproj
index f17ab3ec19..96f23e8568 100644
--- a/new-cli/GitVersion.Common/GitVersion.Common.csproj
+++ b/new-cli/GitVersion.Common/GitVersion.Common.csproj
@@ -6,6 +6,7 @@
+
diff --git a/src/GitVersion.App/ArgumentParserExtensions.cs b/src/GitVersion.App/ArgumentParserExtensions.cs
index 8370c70d28..d2b9d1f5b0 100644
--- a/src/GitVersion.App/ArgumentParserExtensions.cs
+++ b/src/GitVersion.App/ArgumentParserExtensions.cs
@@ -1,4 +1,4 @@
-using System.Text.RegularExpressions;
+using GitVersion.Core;
using GitVersion.Helpers;
namespace GitVersion;
@@ -39,9 +39,13 @@ public static bool IsValidPath(this string? path)
}
public static bool IsSwitchArgument(this string? value)
- => value != null
- && (value.StartsWith('-') || value.StartsWith('/'))
- && !Regex.Match(value, @"/\w+:").Success; //Exclude msbuild & project parameters in form /blah:, which should be parsed as values, not switch names.
+ {
+ var patternRegex = RegexPatterns.Common.SwitchArgumentRegex;
+ return value != null
+ && (value.StartsWith('-') || value.StartsWith('/'))
+ && !patternRegex.Match(value).Success;
+ //Exclude msbuild & project parameters in form /blah:, which should be parsed as values, not switch names.
+ }
public static bool IsSwitch(this string? value, string switchName)
{
diff --git a/src/GitVersion.Configuration/BranchConfiguration.cs b/src/GitVersion.Configuration/BranchConfiguration.cs
index 6547ea51ac..b49054a7d3 100644
--- a/src/GitVersion.Configuration/BranchConfiguration.cs
+++ b/src/GitVersion.Configuration/BranchConfiguration.cs
@@ -90,7 +90,7 @@ public virtual IBranchConfiguration Inherit(IBranchConfiguration configuration)
Increment = Increment == IncrementStrategy.Inherit ? configuration.Increment : Increment,
DeploymentMode = DeploymentMode ?? configuration.DeploymentMode,
Label = Label ?? configuration.Label,
- PreventIncrement = new PreventIncrementConfiguration()
+ PreventIncrement = new PreventIncrementConfiguration
{
OfMergedBranch = PreventIncrement.OfMergedBranch ?? configuration.PreventIncrement.OfMergedBranch,
WhenBranchMerged = PreventIncrement.WhenBranchMerged ?? configuration.PreventIncrement.WhenBranchMerged,
@@ -117,7 +117,7 @@ public virtual IBranchConfiguration Inherit(EffectiveConfiguration configuration
Increment = Increment == IncrementStrategy.Inherit ? configuration.Increment : Increment,
DeploymentMode = DeploymentMode ?? configuration.DeploymentMode,
Label = Label ?? configuration.Label,
- PreventIncrement = new PreventIncrementConfiguration()
+ PreventIncrement = new PreventIncrementConfiguration
{
OfMergedBranch = PreventIncrement.OfMergedBranch ?? configuration.PreventIncrementOfMergedBranch,
WhenBranchMerged = PreventIncrement.WhenBranchMerged ?? configuration.PreventIncrementWhenBranchMerged,
diff --git a/src/GitVersion.Configuration/Builders/BranchConfigurationBuilder.cs b/src/GitVersion.Configuration/Builders/BranchConfigurationBuilder.cs
index d3ac3080dd..db36d2b006 100644
--- a/src/GitVersion.Configuration/Builders/BranchConfigurationBuilder.cs
+++ b/src/GitVersion.Configuration/Builders/BranchConfigurationBuilder.cs
@@ -177,7 +177,7 @@ public virtual BranchConfigurationBuilder WithConfiguration(IBranchConfiguration
IsMainBranch = isMainBranch,
IsReleaseBranch = isReleaseBranch,
LabelNumberPattern = labelNumberPattern,
- PreventIncrement = new PreventIncrementConfiguration()
+ PreventIncrement = new PreventIncrementConfiguration
{
OfMergedBranch = preventIncrementOfMergedBranch,
WhenBranchMerged = preventIncrementWhenBranchMerged,
diff --git a/src/GitVersion.Configuration/Builders/ConfigurationBuilderBase.cs b/src/GitVersion.Configuration/Builders/ConfigurationBuilderBase.cs
index bef65714d7..465b16c59c 100644
--- a/src/GitVersion.Configuration/Builders/ConfigurationBuilderBase.cs
+++ b/src/GitVersion.Configuration/Builders/ConfigurationBuilderBase.cs
@@ -423,7 +423,7 @@ public virtual IGitVersionConfiguration Build()
IsMainBranch = this.isMainBranch,
IsReleaseBranch = this.isReleaseBranch,
LabelNumberPattern = this.labelNumberPattern,
- PreventIncrement = new PreventIncrementConfiguration()
+ PreventIncrement = new PreventIncrementConfiguration
{
OfMergedBranch = this.preventIncrementOfMergedBranch,
WhenBranchMerged = this.preventIncrementWhenBranchMerged,
diff --git a/src/GitVersion.Configuration/Builders/GitFlowConfigurationBuilder.cs b/src/GitVersion.Configuration/Builders/GitFlowConfigurationBuilder.cs
index e29e124530..b7ed9aff44 100644
--- a/src/GitVersion.Configuration/Builders/GitFlowConfigurationBuilder.cs
+++ b/src/GitVersion.Configuration/Builders/GitFlowConfigurationBuilder.cs
@@ -1,3 +1,4 @@
+using GitVersion.Core;
using GitVersion.VersionCalculation;
namespace GitVersion.Configuration;
@@ -13,10 +14,10 @@ private GitFlowConfigurationBuilder()
AssemblyFileVersioningScheme = ConfigurationConstants.DefaultAssemblyFileVersioningScheme,
AssemblyVersioningScheme = ConfigurationConstants.DefaultAssemblyVersioningScheme,
CommitDateFormat = ConfigurationConstants.DefaultCommitDateFormat,
- MajorVersionBumpMessage = IncrementStrategyFinder.DefaultMajorPattern,
- MinorVersionBumpMessage = IncrementStrategyFinder.DefaultMinorPattern,
- NoBumpMessage = IncrementStrategyFinder.DefaultNoBumpPattern,
- PatchVersionBumpMessage = IncrementStrategyFinder.DefaultPatchPattern,
+ MajorVersionBumpMessage = RegexPatterns.VersionCalculation.DefaultMajorPattern,
+ MinorVersionBumpMessage = RegexPatterns.VersionCalculation.DefaultMinorPattern,
+ NoBumpMessage = RegexPatterns.VersionCalculation.DefaultNoBumpPattern,
+ PatchVersionBumpMessage = RegexPatterns.VersionCalculation.DefaultPatchPattern,
SemanticVersionFormat = ConfigurationConstants.DefaultSemanticVersionFormat,
VersionStrategies = ConfigurationConstants.DefaultVersionStrategies,
TagPrefix = ConfigurationConstants.DefaultTagPrefix,
@@ -28,7 +29,7 @@ private GitFlowConfigurationBuilder()
Label = ConfigurationConstants.BranchNamePlaceholder,
Increment = IncrementStrategy.Inherit,
CommitMessageIncrementing = CommitMessageIncrementMode.Enabled,
- PreventIncrement = new PreventIncrementConfiguration()
+ PreventIncrement = new PreventIncrementConfiguration
{
OfMergedBranch = false,
WhenBranchMerged = false,
@@ -48,7 +49,7 @@ private GitFlowConfigurationBuilder()
RegularExpression = DevelopBranch.RegexPattern,
SourceBranches = [this.MainBranch.Name],
Label = "alpha",
- PreventIncrement = new PreventIncrementConfiguration()
+ PreventIncrement = new PreventIncrementConfiguration
{
WhenCurrentCommitTagged = false
},
@@ -66,7 +67,7 @@ private GitFlowConfigurationBuilder()
RegularExpression = MainBranch.RegexPattern,
SourceBranches = [],
Label = string.Empty,
- PreventIncrement = new PreventIncrementConfiguration()
+ PreventIncrement = new PreventIncrementConfiguration
{
OfMergedBranch = true
},
@@ -89,7 +90,7 @@ private GitFlowConfigurationBuilder()
this.SupportBranch.Name,
],
Label = "beta",
- PreventIncrement = new PreventIncrementConfiguration()
+ PreventIncrement = new PreventIncrementConfiguration
{
OfMergedBranch = true,
WhenCurrentCommitTagged = false
@@ -115,7 +116,7 @@ private GitFlowConfigurationBuilder()
this.HotfixBranch.Name
],
Label = ConfigurationConstants.BranchNamePlaceholder,
- PreventIncrement = new PreventIncrementConfiguration()
+ PreventIncrement = new PreventIncrementConfiguration
{
WhenCurrentCommitTagged = false
},
@@ -139,7 +140,7 @@ private GitFlowConfigurationBuilder()
this.HotfixBranch.Name
],
Label = "PullRequest",
- PreventIncrement = new PreventIncrementConfiguration()
+ PreventIncrement = new PreventIncrementConfiguration
{
OfMergedBranch = true,
WhenCurrentCommitTagged = false
@@ -154,7 +155,7 @@ private GitFlowConfigurationBuilder()
Increment = IncrementStrategy.Inherit,
RegularExpression = HotfixBranch.RegexPattern,
DeploymentMode = DeploymentMode.ManualDeployment,
- PreventIncrement = new PreventIncrementConfiguration()
+ PreventIncrement = new PreventIncrementConfiguration
{
WhenCurrentCommitTagged = false
},
@@ -175,7 +176,7 @@ private GitFlowConfigurationBuilder()
RegularExpression = SupportBranch.RegexPattern,
SourceBranches = [this.MainBranch.Name],
Label = string.Empty,
- PreventIncrement = new PreventIncrementConfiguration()
+ PreventIncrement = new PreventIncrementConfiguration
{
OfMergedBranch = true
},
@@ -202,7 +203,7 @@ private GitFlowConfigurationBuilder()
this.SupportBranch.Name
],
Label = ConfigurationConstants.BranchNamePlaceholder,
- PreventIncrement = new PreventIncrementConfiguration()
+ PreventIncrement = new PreventIncrementConfiguration
{
WhenCurrentCommitTagged = true
},
diff --git a/src/GitVersion.Configuration/Builders/GitHubFlowConfigurationBuilder.cs b/src/GitVersion.Configuration/Builders/GitHubFlowConfigurationBuilder.cs
index 3b67f085f8..8af099bcdc 100644
--- a/src/GitVersion.Configuration/Builders/GitHubFlowConfigurationBuilder.cs
+++ b/src/GitVersion.Configuration/Builders/GitHubFlowConfigurationBuilder.cs
@@ -1,3 +1,4 @@
+using GitVersion.Core;
using GitVersion.VersionCalculation;
namespace GitVersion.Configuration;
@@ -13,10 +14,10 @@ private GitHubFlowConfigurationBuilder()
AssemblyFileVersioningScheme = ConfigurationConstants.DefaultAssemblyFileVersioningScheme,
AssemblyVersioningScheme = ConfigurationConstants.DefaultAssemblyVersioningScheme,
CommitDateFormat = ConfigurationConstants.DefaultCommitDateFormat,
- MajorVersionBumpMessage = IncrementStrategyFinder.DefaultMajorPattern,
- MinorVersionBumpMessage = IncrementStrategyFinder.DefaultMinorPattern,
- NoBumpMessage = IncrementStrategyFinder.DefaultNoBumpPattern,
- PatchVersionBumpMessage = IncrementStrategyFinder.DefaultPatchPattern,
+ MajorVersionBumpMessage = RegexPatterns.VersionCalculation.DefaultMajorPattern,
+ MinorVersionBumpMessage = RegexPatterns.VersionCalculation.DefaultMinorPattern,
+ NoBumpMessage = RegexPatterns.VersionCalculation.DefaultNoBumpPattern,
+ PatchVersionBumpMessage = RegexPatterns.VersionCalculation.DefaultPatchPattern,
SemanticVersionFormat = ConfigurationConstants.DefaultSemanticVersionFormat,
VersionStrategies = ConfigurationConstants.DefaultVersionStrategies,
TagPrefix = ConfigurationConstants.DefaultTagPrefix,
@@ -26,7 +27,7 @@ private GitHubFlowConfigurationBuilder()
DeploymentMode = DeploymentMode.ContinuousDelivery,
Label = ConfigurationConstants.BranchNamePlaceholder,
Increment = IncrementStrategy.Inherit,
- PreventIncrement = new PreventIncrementConfiguration()
+ PreventIncrement = new PreventIncrementConfiguration
{
OfMergedBranch = false,
WhenBranchMerged = false,
@@ -45,7 +46,7 @@ private GitHubFlowConfigurationBuilder()
{
Label = string.Empty,
Increment = IncrementStrategy.Patch,
- PreventIncrement = new PreventIncrementConfiguration()
+ PreventIncrement = new PreventIncrementConfiguration
{
OfMergedBranch = true
},
@@ -64,7 +65,7 @@ private GitHubFlowConfigurationBuilder()
DeploymentMode = DeploymentMode.ManualDeployment,
Label = "beta",
Increment = IncrementStrategy.Patch,
- PreventIncrement = new PreventIncrementConfiguration()
+ PreventIncrement = new PreventIncrementConfiguration
{
OfMergedBranch = true,
WhenBranchMerged = false,
@@ -88,7 +89,7 @@ private GitHubFlowConfigurationBuilder()
DeploymentMode = DeploymentMode.ManualDeployment,
Label = ConfigurationConstants.BranchNamePlaceholder,
Increment = IncrementStrategy.Inherit,
- PreventIncrement = new PreventIncrementConfiguration()
+ PreventIncrement = new PreventIncrementConfiguration
{
WhenCurrentCommitTagged = false
},
@@ -108,7 +109,7 @@ private GitHubFlowConfigurationBuilder()
DeploymentMode = DeploymentMode.ContinuousDelivery,
Label = "PullRequest",
Increment = IncrementStrategy.Inherit,
- PreventIncrement = new PreventIncrementConfiguration()
+ PreventIncrement = new PreventIncrementConfiguration
{
OfMergedBranch = true,
WhenCurrentCommitTagged = false
@@ -130,7 +131,7 @@ private GitHubFlowConfigurationBuilder()
DeploymentMode = DeploymentMode.ManualDeployment,
Label = ConfigurationConstants.BranchNamePlaceholder,
Increment = IncrementStrategy.Inherit,
- PreventIncrement = new PreventIncrementConfiguration()
+ PreventIncrement = new PreventIncrementConfiguration
{
WhenCurrentCommitTagged = false
},
diff --git a/src/GitVersion.Configuration/Builders/TrunkBasedConfigurationBuilder.cs b/src/GitVersion.Configuration/Builders/TrunkBasedConfigurationBuilder.cs
index c6e5047b67..c1fbcdf519 100644
--- a/src/GitVersion.Configuration/Builders/TrunkBasedConfigurationBuilder.cs
+++ b/src/GitVersion.Configuration/Builders/TrunkBasedConfigurationBuilder.cs
@@ -1,3 +1,4 @@
+using GitVersion.Core;
using GitVersion.VersionCalculation;
namespace GitVersion.Configuration;
@@ -8,15 +9,15 @@ internal sealed class TrunkBasedConfigurationBuilder : ConfigurationBuilderBase<
private TrunkBasedConfigurationBuilder()
{
- WithConfiguration(new GitVersionConfiguration()
+ WithConfiguration(new GitVersionConfiguration
{
AssemblyFileVersioningScheme = ConfigurationConstants.DefaultAssemblyFileVersioningScheme,
AssemblyVersioningScheme = ConfigurationConstants.DefaultAssemblyVersioningScheme,
CommitDateFormat = ConfigurationConstants.DefaultCommitDateFormat,
- MajorVersionBumpMessage = IncrementStrategyFinder.DefaultMajorPattern,
- MinorVersionBumpMessage = IncrementStrategyFinder.DefaultMinorPattern,
- NoBumpMessage = IncrementStrategyFinder.DefaultNoBumpPattern,
- PatchVersionBumpMessage = IncrementStrategyFinder.DefaultPatchPattern,
+ MajorVersionBumpMessage = RegexPatterns.VersionCalculation.DefaultMajorPattern,
+ MinorVersionBumpMessage = RegexPatterns.VersionCalculation.DefaultMinorPattern,
+ NoBumpMessage = RegexPatterns.VersionCalculation.DefaultNoBumpPattern,
+ PatchVersionBumpMessage = RegexPatterns.VersionCalculation.DefaultPatchPattern,
SemanticVersionFormat = ConfigurationConstants.DefaultSemanticVersionFormat,
VersionStrategies = [
VersionStrategies.ConfiguredNextVersion,
@@ -31,7 +32,7 @@ private TrunkBasedConfigurationBuilder()
Label = ConfigurationConstants.BranchNamePlaceholder,
Increment = IncrementStrategy.Inherit,
CommitMessageIncrementing = CommitMessageIncrementMode.Enabled,
- PreventIncrement = new PreventIncrementConfiguration()
+ PreventIncrement = new PreventIncrementConfiguration
{
OfMergedBranch = false,
WhenBranchMerged = false,
@@ -44,12 +45,12 @@ private TrunkBasedConfigurationBuilder()
IsMainBranch = false
});
- WithBranch(MainBranch.Name).WithConfiguration(new BranchConfiguration()
+ WithBranch(MainBranch.Name).WithConfiguration(new BranchConfiguration
{
DeploymentMode = DeploymentMode.ContinuousDeployment,
Label = string.Empty,
Increment = IncrementStrategy.Patch,
- PreventIncrement = new PreventIncrementConfiguration()
+ PreventIncrement = new PreventIncrementConfiguration
{
OfMergedBranch = true
},
@@ -63,12 +64,12 @@ private TrunkBasedConfigurationBuilder()
PreReleaseWeight = 55000
});
- WithBranch(FeatureBranch.Name).WithConfiguration(new BranchConfiguration()
+ WithBranch(FeatureBranch.Name).WithConfiguration(new BranchConfiguration
{
DeploymentMode = DeploymentMode.ContinuousDelivery,
Label = ConfigurationConstants.BranchNamePlaceholder,
Increment = IncrementStrategy.Minor,
- PreventIncrement = new PreventIncrementConfiguration()
+ PreventIncrement = new PreventIncrementConfiguration
{
WhenCurrentCommitTagged = false
},
@@ -82,12 +83,12 @@ private TrunkBasedConfigurationBuilder()
PreReleaseWeight = 30000
});
- WithBranch(HotfixBranch.Name).WithConfiguration(new BranchConfiguration()
+ WithBranch(HotfixBranch.Name).WithConfiguration(new BranchConfiguration
{
DeploymentMode = DeploymentMode.ContinuousDelivery,
Label = ConfigurationConstants.BranchNamePlaceholder,
Increment = IncrementStrategy.Patch,
- PreventIncrement = new PreventIncrementConfiguration()
+ PreventIncrement = new PreventIncrementConfiguration
{
WhenCurrentCommitTagged = false
},
@@ -106,7 +107,7 @@ private TrunkBasedConfigurationBuilder()
DeploymentMode = DeploymentMode.ContinuousDelivery,
Label = "PullRequest",
Increment = IncrementStrategy.Inherit,
- PreventIncrement = new PreventIncrementConfiguration()
+ PreventIncrement = new PreventIncrementConfiguration
{
OfMergedBranch = true,
WhenCurrentCommitTagged = false
@@ -126,7 +127,7 @@ private TrunkBasedConfigurationBuilder()
WithBranch(UnknownBranch.Name).WithConfiguration(new BranchConfiguration
{
Increment = IncrementStrategy.Patch,
- PreventIncrement = new PreventIncrementConfiguration()
+ PreventIncrement = new PreventIncrementConfiguration
{
WhenCurrentCommitTagged = false
},
diff --git a/src/GitVersion.Configuration/GitVersionConfiguration.cs b/src/GitVersion.Configuration/GitVersionConfiguration.cs
index 1c2360d3a7..ee6981920c 100644
--- a/src/GitVersion.Configuration/GitVersionConfiguration.cs
+++ b/src/GitVersion.Configuration/GitVersionConfiguration.cs
@@ -1,6 +1,7 @@
using System.Globalization;
using System.Text.RegularExpressions;
using GitVersion.Configuration.Attributes;
+using GitVersion.Core;
using GitVersion.Extensions;
using GitVersion.VersionCalculation;
using static GitVersion.Configuration.ConfigurationConstants;
@@ -49,7 +50,7 @@ internal sealed record GitVersionConfiguration : BranchConfiguration, IGitVersio
public string? VersionInBranchPattern { get; internal set; }
[JsonIgnore]
- public Regex VersionInBranchRegex => versionInBranchRegex ??= new Regex(GetVersionInBranchPattern(), RegexOptions.Compiled);
+ public Regex VersionInBranchRegex => versionInBranchRegex ??= new(GetVersionInBranchPattern(), RegexOptions.Compiled);
private Regex? versionInBranchRegex;
private string GetVersionInBranchPattern()
@@ -72,26 +73,26 @@ public string? NextVersion
private string? nextVersion;
[JsonPropertyName("major-version-bump-message")]
- [JsonPropertyDescription($"The regular expression to match commit messages with to perform a major version increment. Defaults to '{IncrementStrategyFinder.DefaultMajorPattern}'")]
- [JsonPropertyDefault(IncrementStrategyFinder.DefaultMajorPattern)]
+ [JsonPropertyDescription($"The regular expression to match commit messages with to perform a major version increment. Defaults to '{RegexPatterns.VersionCalculation.DefaultMajorPattern}'")]
+ [JsonPropertyDefault(RegexPatterns.VersionCalculation.DefaultMajorPattern)]
[JsonPropertyFormat(Format.Regex)]
public string? MajorVersionBumpMessage { get; internal set; }
[JsonPropertyName("minor-version-bump-message")]
- [JsonPropertyDescription($"The regular expression to match commit messages with to perform a minor version increment. Defaults to '{IncrementStrategyFinder.DefaultMinorPattern}'")]
- [JsonPropertyDefault(IncrementStrategyFinder.DefaultMinorPattern)]
+ [JsonPropertyDescription($"The regular expression to match commit messages with to perform a minor version increment. Defaults to '{RegexPatterns.VersionCalculation.DefaultMinorPattern}'")]
+ [JsonPropertyDefault(RegexPatterns.VersionCalculation.DefaultMinorPattern)]
[JsonPropertyFormat(Format.Regex)]
public string? MinorVersionBumpMessage { get; internal set; }
[JsonPropertyName("patch-version-bump-message")]
- [JsonPropertyDescription($"The regular expression to match commit messages with to perform a patch version increment. Defaults to '{IncrementStrategyFinder.DefaultPatchPattern}'")]
- [JsonPropertyDefault(IncrementStrategyFinder.DefaultPatchPattern)]
+ [JsonPropertyDescription($"The regular expression to match commit messages with to perform a patch version increment. Defaults to '{RegexPatterns.VersionCalculation.DefaultPatchPattern}'")]
+ [JsonPropertyDefault(RegexPatterns.VersionCalculation.DefaultPatchPattern)]
[JsonPropertyFormat(Format.Regex)]
public string? PatchVersionBumpMessage { get; internal set; }
[JsonPropertyName("no-bump-message")]
- [JsonPropertyDescription($"Used to tell GitVersion not to increment when in Mainline development mode. Defaults to '{IncrementStrategyFinder.DefaultNoBumpPattern}'")]
- [JsonPropertyDefault(IncrementStrategyFinder.DefaultNoBumpPattern)]
+ [JsonPropertyDescription($"Used to tell GitVersion not to increment when in Mainline development mode. Defaults to '{RegexPatterns.VersionCalculation.DefaultNoBumpPattern}'")]
+ [JsonPropertyDefault(RegexPatterns.VersionCalculation.DefaultNoBumpPattern)]
[JsonPropertyFormat(Format.Regex)]
public string? NoBumpMessage { get; internal set; }
diff --git a/src/GitVersion.Core.Tests/IntegrationTests/IgnoreCommitScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/IgnoreCommitScenarios.cs
index 0ab82ba0e8..e1f567e92f 100644
--- a/src/GitVersion.Core.Tests/IntegrationTests/IgnoreCommitScenarios.cs
+++ b/src/GitVersion.Core.Tests/IntegrationTests/IgnoreCommitScenarios.cs
@@ -63,7 +63,7 @@ public void GivenTrunkBasedWorkflowWithIgnoreConfigurationForCommitThenVersionSh
fixture.MakeACommit("D");
var configuration = TrunkBasedConfigurationBuilder.New
- .WithIgnoreConfiguration(new IgnoreConfiguration() { Shas = [commitB.Sha] })
+ .WithIgnoreConfiguration(new IgnoreConfiguration { Shas = [commitB.Sha] })
.Build();
// ✅ succeeds as expected
@@ -81,7 +81,7 @@ public void GivenTrunkBasedWorkflowWithIgnoreConfigurationForCommitBAndCommitPar
fixture.MakeACommit("D");
var configuration = TrunkBasedConfigurationBuilder.New
- .WithIgnoreConfiguration(new IgnoreConfiguration() { Shas = [commitB.Sha] })
+ .WithIgnoreConfiguration(new IgnoreConfiguration { Shas = [commitB.Sha] })
.Build();
// ✅ succeeds as expected
@@ -98,7 +98,7 @@ public void GivenTrunkBasedWorkflowWithIgnoreConfigurationForCommitCAndCommitPar
var commitC = fixture.Repository.MakeACommit("C");
var configuration = TrunkBasedConfigurationBuilder.New
- .WithIgnoreConfiguration(new IgnoreConfiguration() { Shas = [commitC.Sha] })
+ .WithIgnoreConfiguration(new IgnoreConfiguration { Shas = [commitC.Sha] })
.Build();
// ✅ succeeds as expected
@@ -117,7 +117,7 @@ public void GivenTrunkBasedWorkflowWithIgnoreConfigurationForTaggedCommitThenTag
fixture.MakeACommit("D");
var configuration = TrunkBasedConfigurationBuilder.New
- .WithIgnoreConfiguration(new IgnoreConfiguration() { Shas = [commitC.Sha] })
+ .WithIgnoreConfiguration(new IgnoreConfiguration { Shas = [commitC.Sha] })
.Build();
// ✅ succeeds as expected
@@ -136,7 +136,7 @@ public void GivenTrunkBasedWorkflowWithIgnoreConfigurationBeforeCommitWithTagThe
fixture.MakeACommit("D");
var configuration = TrunkBasedConfigurationBuilder.New
- .WithIgnoreConfiguration(new IgnoreConfiguration() { Before = commitC.Committer.When })
+ .WithIgnoreConfiguration(new IgnoreConfiguration { Before = commitC.Committer.When })
.Build();
// ✅ succeeds as expected
@@ -155,7 +155,7 @@ public void GivenTrunkBasedWorkflowWithIgnoreConfigurationOfCommitBThenTagShould
var commitB = fixture.Repository.MakeACommit("B");
var configuration = TrunkBasedConfigurationBuilder.New
- .WithIgnoreConfiguration(new IgnoreConfiguration() { Shas = [commitB.Sha] })
+ .WithIgnoreConfiguration(new IgnoreConfiguration { Shas = [commitB.Sha] })
.WithBranch("main", b => b.WithIncrement(IncrementStrategy.Patch)
.WithPreventIncrementWhenCurrentCommitTagged(preventIncrementWhenCurrentCommitTagged)
.WithDeploymentMode(GitVersion.VersionCalculation.DeploymentMode.ContinuousDelivery)
@@ -213,7 +213,7 @@ public void GivenGitHubFlowWorkflowWithIgnoreConfigurationForCommitThenVersionSh
fixture.MakeACommit("D");
var configuration = GitHubFlowConfigurationBuilder.New
- .WithIgnoreConfiguration(new IgnoreConfiguration() { Shas = [commitB.Sha] })
+ .WithIgnoreConfiguration(new IgnoreConfiguration { Shas = [commitB.Sha] })
.Build();
// ✅ succeeds as expected
@@ -231,7 +231,7 @@ public void GivenGitHubFlowWorkflowWithIgnoreConfigurationForCommitBAndCommitPar
fixture.MakeACommit("D");
var configuration = GitHubFlowConfigurationBuilder.New
- .WithIgnoreConfiguration(new IgnoreConfiguration() { Shas = [commitB.Sha] })
+ .WithIgnoreConfiguration(new IgnoreConfiguration { Shas = [commitB.Sha] })
.Build();
// ✅ succeeds as expected
@@ -248,7 +248,7 @@ public void GivenGitHubFlowWorkflowWithIgnoreConfigurationForCommitCAndCommitPar
var commitC = fixture.Repository.MakeACommit("C");
var configuration = GitHubFlowConfigurationBuilder.New
- .WithIgnoreConfiguration(new IgnoreConfiguration() { Shas = [commitC.Sha] })
+ .WithIgnoreConfiguration(new IgnoreConfiguration { Shas = [commitC.Sha] })
.Build();
// ✅ succeeds as expected
@@ -267,7 +267,7 @@ public void GivenGitHubFlowWorkflowWithIgnoreConfigurationForTaggedCommitThenTag
fixture.MakeACommit("D");
var configuration = GitHubFlowConfigurationBuilder.New
- .WithIgnoreConfiguration(new IgnoreConfiguration() { Shas = [commitC.Sha] })
+ .WithIgnoreConfiguration(new IgnoreConfiguration { Shas = [commitC.Sha] })
.Build();
// ✅ succeeds as expected
@@ -286,7 +286,7 @@ public void GivenGitHubFlowWorkflowWithIgnoreConfigurationBeforeCommitWithTagThe
fixture.MakeACommit("D");
var configuration = GitHubFlowConfigurationBuilder.New
- .WithIgnoreConfiguration(new IgnoreConfiguration() { Before = commitC.Committer.When })
+ .WithIgnoreConfiguration(new IgnoreConfiguration { Before = commitC.Committer.When })
.Build();
// ✅ succeeds as expected
@@ -305,7 +305,7 @@ public void GivenGitHubFlowWorkflowWithIgnoreConfigurationOfCommitBThenTagShould
var commitB = fixture.Repository.MakeACommit("B");
var configuration = GitHubFlowConfigurationBuilder.New
- .WithIgnoreConfiguration(new IgnoreConfiguration() { Shas = [commitB.Sha] })
+ .WithIgnoreConfiguration(new IgnoreConfiguration { Shas = [commitB.Sha] })
.WithBranch("main", b => b.WithPreventIncrementWhenCurrentCommitTagged(preventIncrementWhenCurrentCommitTagged))
.Build();
diff --git a/src/GitVersion.Core.Tests/VersionCalculation/NextVersionCalculatorTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/NextVersionCalculatorTests.cs
index 369ad1ade6..af8dd75d35 100644
--- a/src/GitVersion.Core.Tests/VersionCalculation/NextVersionCalculatorTests.cs
+++ b/src/GitVersion.Core.Tests/VersionCalculation/NextVersionCalculatorTests.cs
@@ -30,7 +30,7 @@ public void DoesNotIncrementWhenBaseVersionSaysNotTo()
{
using var contextBuilder = new GitVersionContextBuilder();
- var overrideConfiguration = new Dictionary