Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add the contains, hasPrefix, hasSuffix, replace, lower and upper functions to Changelog template #34

Merged
merged 1 commit into from
Feb 23, 2019

Conversation

atosatto
Copy link
Contributor

@atosatto atosatto commented Feb 10, 2019

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 and hasSuffix 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 the template.FuncMap are named using a camel-case convention and starts with a lower-case first letter consistently with the already implemented datetime.
It is also be possible to adopt a different naming convention.

Check lists

  • Test passed
  • Coding style (indentation, etc)

…r functions to the template functions map

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.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 105

  • 1 of 19 (5.26%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.6%) to 70.147%

Changes Missing Coverage Covered Lines Changed/Added Lines %
chglog.go 1 19 5.26%
Totals Coverage Status
Change from base Build 103: -0.6%
Covered Lines: 1478
Relevant Lines: 2107

💛 - Coveralls

@atosatto
Copy link
Contributor Author

atosatto commented Feb 17, 2019

@tsuyoshiwada can you please have a look to see whether the proposed changes looks good to you?
The idea is to add some additional strings functions into the template to filter/prettify the commit messages.

Copy link
Member

@wadackel wadackel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@atosatto

Thank you for contributing 🐶 !!
Also, I'm sorry response was delayed...

The suggested function looks very convenient to me 👍

@wadackel wadackel added the type: feature New feature or request label Feb 23, 2019
@wadackel wadackel merged commit b7edc16 into git-chglog:master Feb 23, 2019
@atosatto
Copy link
Contributor Author

Awesome! Thanks @tsuyoshiwada for merging it into master!

@wadackel
Copy link
Member

@atosatto Thank you, too. Please wait just a little because I will that I would like to release it 👌

@wadackel
Copy link
Member

Released as 0.8.0, thx 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants