diff --git a/src/ConventionalChangelog/Changelog.cs b/src/ConventionalChangelog/Changelog.cs index 97155c2..23efbbc 100644 --- a/src/ConventionalChangelog/Changelog.cs +++ b/src/ConventionalChangelog/Changelog.cs @@ -11,11 +11,11 @@ public class Changelog public Changelog(Configuration configuration) { - IConfigured configured = new Configured(configuration); - _relationshipResolver = new RelationshipResolver(configuration); - _repositoryReader = new RepositoryReader(configured); - _parser = new MessageParser(configured); - _logWriter = new LogWriter(configured); + ICustomization customization = new Customization(configuration); + _repositoryReader = new RepositoryReader(customization); + _parser = new MessageParser(customization); + _relationshipResolver = new RelationshipResolver(customization); + _logWriter = new LogWriter(customization); } public string FromRepository(string path) diff --git a/src/ConventionalChangelog/Conventional/MessageParser.cs b/src/ConventionalChangelog/Conventional/MessageParser.cs index 3b4ab97..d86f28d 100644 --- a/src/ConventionalChangelog/Conventional/MessageParser.cs +++ b/src/ConventionalChangelog/Conventional/MessageParser.cs @@ -5,13 +5,13 @@ namespace ConventionalChangelog.Conventional; public class MessageParser { - private readonly IConfigured _configured; + private readonly ICustomization _customization; - public MessageParser(Configuration configuration) : this(new Configured(configuration)) + public MessageParser(Configuration configuration) : this(new Customization(configuration)) { } - internal MessageParser(IConfigured configured) => _configured = configured; + internal MessageParser(ICustomization customization) => _customization = customization; public CommitMessage Parse(Commit commit) { @@ -28,7 +28,7 @@ private CommitMessage Read(TextReader lines) { var (typeIndicator, description) = HeaderFrom(lines.ReadLine()); var (body, footers) = BodyFrom(lines); - typeIndicator = _configured.Sanitize(typeIndicator, footers); + typeIndicator = _customization.Sanitize(typeIndicator, footers); return new CommitMessage(typeIndicator, description, body, footers); } @@ -36,14 +36,14 @@ private CommitMessage Read(TextReader lines) #if NET6_0 private (string, string) HeaderFrom(string? header) { - var twoParts = header?.Split(_configured.Separator); + var twoParts = header?.Split(_customization.Separator); return twoParts?.Length == 2 ? (twoParts.First(), twoParts.Last().Trim()) : ("", ""); } #elif NET7_0_OR_GREATER private (string, string) HeaderFrom(string? header) => - header?.Split(_configured.Separator) is [var first, var second] + header?.Split(_customization.Separator) is [var first, var second] ? (first,second.Trim()) : ("", ""); #endif @@ -54,7 +54,7 @@ private CommitMessage Read(TextReader lines) var footers = Enumerable.Empty