-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support changelog customization options (#43)
* feat: support changelog customization options * test: add custom header test * docs: add sample .versionize changelog configuration
- Loading branch information
Showing
11 changed files
with
364 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System.Collections.Generic; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Versionize | ||
{ | ||
// TODO: Consider creating a ChangelogConfigurationContract as a layer of abstraction. | ||
public record class ChangelogOptions | ||
{ | ||
private const string Preamble = "# Change Log\n\nAll notable changes to this project will be documented in this file. See [versionize](https://github.com/saintedlama/versionize) for commit guidelines.\n"; | ||
public static readonly ChangelogOptions Default = new ChangelogOptions | ||
{ | ||
Header = Preamble, | ||
IncludeAllCommits = false, | ||
Sections = new ChangelogSection[] | ||
{ | ||
new ChangelogSection { Type = "feat", Section = "Features", Hidden = false }, | ||
new ChangelogSection { Type = "fix", Section = "Bug Fixes", Hidden = false }, | ||
} | ||
}; | ||
|
||
public string Header { get; set; } | ||
// Ignoring this serialization option for the moment, since ConfigurationContract | ||
// already has this option. It would be nice to remove that other option in favor | ||
// of this one, but it would be a breaking change. | ||
[JsonIgnore] | ||
public bool IncludeAllCommits { get; set; } | ||
public IEnumerable<ChangelogSection> Sections { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Versionize | ||
{ | ||
public class ChangelogSection | ||
{ | ||
public string Type { get; set; } | ||
public string Section { get; set; } | ||
public bool Hidden { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters