cbcrouse / Versioning.NET

A dotnet tool that automatically increments versions in csproj files based on git commit hints.
MIT License
20 stars 3 forks source link

Add version-increment option to increment-version-with-git #27

Closed 0nary closed 2 years ago

0nary commented 2 years ago

Is your feature request related to a problem? Please describe. Sometime for some reasons (most of time bad reasons), we don't want to follow the pattern you propose for determines the increment of the version.

Describe the solution you'd like Add the same option (--version-increment) as in increment-version command to the increment-version-with-git command.

Describe alternatives you've considered An other and maybe better option is to allow user to override your switch to make it match they desiderata.

return type.ToLower() switch
{
    "feat" => VersionIncrement.Minor,
    "fix" => VersionIncrement.Patch,
    "build" => VersionIncrement.Patch,
    "config" => VersionIncrement.Patch,
    "docs" => VersionIncrement.Patch,
    "perf" => VersionIncrement.Patch,
    "refactor" => VersionIncrement.Patch,
    "resolve" => VersionIncrement.Patch,
    "style" => VersionIncrement.Patch,
    "test" => VersionIncrement.Patch,
    "ci" => VersionIncrement.Patch,
    _ => VersionIncrement.Unknown
};

Also include #breaking.

cbcrouse commented 2 years ago

Hi @0nary, thanks for your interest in the tool. It is my understanding that you like the idea of the automatic versioning with the git commit but would like to override the determined version on demand. I will look into supporting this.

0nary commented 2 years ago

@cbcrouse Yes, it will be perfect.