-
Notifications
You must be signed in to change notification settings - Fork 21
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
changelog-gen to generate changelog entries for local setup #13
Conversation
cmd/changelog-gen/main.go
Outdated
os.Exit(1) | ||
} | ||
} | ||
typeValues := []string{"enhancement", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this array be moved up somewhere external to this file and potentially used to generate the template in https://github.com/hashicorp/go-changelog/blob/master/cmd/changelog-build/changelog.tmpl so we can be sure to keep generation, validation and build in sync?
The TypeValid
check is nice! I could see this helping with some of the issues we've had with typos in the type field causing entries to be skipped during changelog-build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes good idea, I will see in which package it make more sense to move it. For the template generation, my knowledge with it is very limited, I will need some help to set it up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I extracted both the slice and the typecheck func and used them in both tools, I'm not sure how to use it in template though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I might poke at implementing the configurable types list proposed in #6 as a followup.
cmd/changelog-gen/README.md
Outdated
|
||
The changelog template by default is as follow but also can be passed as parameter: | ||
|
||
```gotemplate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would maybe link out to the file instead of having it inline here in case content changes, and rename to something like changelog-entry.tmpl
to avoid confusion with https://github.com/hashicorp/go-changelog/blob/master/cmd/changelog-build/changelog.tmpl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My fear is that it will add an extra install step at the user end (copy the template somewhere) or the other option was to embed the template in the repo but then we will risk having it diverge between different projects.
I'm less familiar with the other projects and what are their workflow so I'm not sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looked again and I like the current default template embedding with optional template path CLI flag.
Also: fix linter issues
…y template and help text, add subcategory prompt
minor cleanup of changelog-gen command, rename to changelog-entry
@mikemorris Thank you for the help and the review on this, please merge it as I don't have write permission on this repo. |
I don't either! Maybe @i0rek or @bflad could? |
This PR add a tool for generating changelog entries based on input parameters and also the current git branch in the current directory. This tool can be helpful to streamline the changelog entries creation in a personal setup.
Feature wise the command:
(see the added README for more details)