-
Notifications
You must be signed in to change notification settings - Fork 43
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
Allow a custom changelog format #640
Conversation
|
||
<comment> | ||
templates: | ||
changelog: [".gush/templates/changelog.twig"] |
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 am not too fond of this one, keep it simple rather with templates.changelog key, it does not need to redirect to a file.
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.
OK, no problem :)
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.
Done
$output->writeln(sprintf('<info>Found %s commits</info>', count($commits)), OutputInterface::VERBOSITY_DEBUG); | ||
|
||
$items = []; | ||
|
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.
remove line break
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 try to keep language constructs and variable definitions separate for better readability 👍
I actually want to move the try-catch block to it's own function. But that's for a later refactoring 😃
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.
it makes the code lengthy unnecessarily
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.
OK, I will change 👍
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.
Done
FYI, I did not enable caching as this doesn't work all the to well with String templates 😉 |
$twig = new \Twig_Environment($loader, [ | ||
'autoescape' => false, | ||
'strict_variables' => true, | ||
'cache' => false, // This may have to be reconsidered |
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.
Comment can be removed, I did not find any performance problems 😃
A custom changelog format, this is has been on my wish-list for to long, but I finally came-up
with something that solves my (and others) use-cases 😋
Instead of using a risky unreadable format like
%nn
(what is nn??)I decided to use a fully-fledged Template engine, Twig to be exact.
But this is just the start, Gush has always been very opinionated about
which format we use for everything (pull-request merge message, changelog).
With this new system this is finally customizable, and performance is not affected
to much (Twig is lazy loaded).
Not only that, I have a great idea about a new feature (for which I will disclose
some more details soon. In short it's about keeping multiple repositories
common files (README, LICENSE, etc.) in sync (like Sonata-Devkit does).
Which will also use Twig for it's templates.