feat: add the contains, hasPrefix, hasSuffix, replace, lower and upper functions to Changelog template #34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this do / why do we need it?
This PR adds the strings.Contains, strings.HasPrefix, strings.HasSuffix, strings.Replace, strings.Lower and strings.Upper to the set of functions
available for usage in the changelog template.
The added functions can be used to manipulate commit messages before rendering the changelog.
How this PR fixes the problem?
These new functions can be used, for example, to replace custom git commit markers (e.g.
[ci-skip]
) from the commit messages rendered to the changelog.In addition, the
hasPrefix
andhasSuffix
functions allow to easily filter out commits starting with a given prefix as described in #26 in situations where the commit messages are not always prefixed by a "chore" prefix.What should your reviewer look out for in this PR?
The functions provided by the
strings
package and added in this PR to thetemplate.FuncMap
are named using a camel-case convention and starts with a lower-case first letter consistently with the already implementeddatetime
.It is also be possible to adopt a different naming convention.
Check lists