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

Use templates for custom commit message formats #12

Open
mainrs opened this issue Jul 17, 2020 · 1 comment
Open

Use templates for custom commit message formats #12

mainrs opened this issue Jul 17, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@mainrs
Copy link
Owner

mainrs commented Jul 17, 2020

I do think that this would be a great addition to the CLI. We could provide a template that reflects the conventional commits specification but allow people to customize the template if they want to.

The template engine would need the following features:

  • variable substitutions to insert the user's answers.
  • conditional branches to allow for basic logic. This allows to not apply certain elements if no text has been entered.

A list of possible engines can be found here: https://lib.rs/keywords/template

@mainrs
Copy link
Owner Author

mainrs commented Jul 19, 2020

I am working on this right now. I decided to go for the tera crate. There are only two template engines that work on runtime-provided strings: handlebars and tera. And since tera had the better benchmarking results I opted for it.

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

No branches or pull requests

1 participant